using System; using System.IO; using ComputeSharp.SwapChain.Shaders; #if WINDOWS_UWP using ComputeSharp.Uwp; #else using ComputeSharp.WinUI; #endif using Windows.ApplicationModel; #nullable enable namespace ComputeSharp.SwapChain.Core.Shaders.Runners; /// /// A specialized for . /// public sealed class ContouredLayersRunner : IShaderRunner { /// /// A texture for \Textures\RustyMetal.png. /// private ReadOnlyTexture2D? texture; /// public void Execute(IReadWriteTexture2D texture, TimeSpan timespan) { if (this.texture is null) { string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png"); this.texture = GraphicsDevice.Default.LoadReadOnlyTexture2D(filename); } GraphicsDevice.Default.ForEach(texture, new ContouredLayers((float)timespan.TotalSeconds, this.texture)); } }