Move WinUI 3 code behind to shared project

このコミットが含まれているのは:
Sergio Pedri committed 2024-12-21 12:27:20 +01:00
1 親 50de61c5be
コミット 93538b190f
10ファイル変更
+11

検索条件に一致するファイルはありません

+11
ファイルの表示
@@ -64,4 +64,15 @@
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-200.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Wide310x150Logo.scale-400.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Controls\D2D1AnimatedPixelShaderPanel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\RenderingPauseConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Converters\ResolutionScaleConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Enums\RenderingMode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Shaders\PixelShaderEffect.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Shaders\Runners\ContouredLayersRunner.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Shaders\Runners\D2D1ContouredLayersRunner.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModels\MainViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModels\ShaderRunnerViewModel.cs" />
</ItemGroup>
</Project>
+148
ファイルの表示
@@ -0,0 +1,148 @@
using ComputeSharp.SwapChain.Core.Shaders;
using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.UI.Xaml;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace ComputeSharp.SwapChain.WinUI.Views;
/// <summary>
/// A custom <see cref="Control"/> that can be used to render animated backgrounds via Win2D.
/// </summary>
[TemplatePart(Name = "PART_CanvasAnimatedControl", Type = typeof(CanvasAnimatedControl))]
public sealed partial class D2D1AnimatedPixelShaderPanel : Control
{
/// <summary>
/// The <see cref="DependencyProperty"/> backing <see cref="PixelShaderEffect"/>.
/// </summary>
public static readonly DependencyProperty PixelShaderEffectProperty = DependencyProperty.Register(
nameof(PixelShaderEffect),
typeof(PixelShaderEffect),
typeof(D2D1AnimatedPixelShaderPanel),
new PropertyMetadata(null, OnPixelShaderEffectPropertyChanged));
/// <summary>
/// The <see cref="DependencyProperty"/> backing <see cref="IsPaused"/>.
/// </summary>
public static readonly DependencyProperty IsPausedProperty = DependencyProperty.Register(
nameof(IsPaused),
typeof(bool),
typeof(D2D1AnimatedPixelShaderPanel),
new PropertyMetadata(false, OnIsPausedPropertyChanged));
/// <summary>
/// The wrapped <see cref="CanvasAnimatedControl"/> instance used to render frames.
/// </summary>
private CanvasAnimatedControl? canvasAnimatedControl;
/// <summary>
/// The <see cref="PixelShaderEffect"/> instance currently in use, if any.
/// </summary>
private volatile PixelShaderEffect? pixelShaderEffect;
/// <summary>
/// Creates a new <see cref="D2D1AnimatedPixelShaderPanel"/> instance.
/// </summary>
public D2D1AnimatedPixelShaderPanel()
{
DefaultStyleKey = typeof(D2D1AnimatedPixelShaderPanel);
Loaded += D2D1AnimatedPixelShaderPanel_Loaded;
Unloaded += D2D1AnimatedPixelShaderPanel_Unloaded;
}
/// <summary>
/// Gets or sets the <see cref="Core.Shaders.PixelShaderEffect"/> instance to use to render content.
/// </summary>
public PixelShaderEffect? PixelShaderEffect
{
get => (PixelShaderEffect?)GetValue(PixelShaderEffectProperty);
set => SetValue(PixelShaderEffectProperty, value);
}
/// <summary>
/// Gets or sets whether or not the rendering is paused.
/// </summary>
public bool IsPaused
{
get => (bool)GetValue(IsPausedProperty);
set => SetValue(IsPausedProperty, value);
}
/// <inheritdoc/>
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
this.canvasAnimatedControl = (CanvasAnimatedControl)GetTemplateChild("PART_CanvasAnimatedControl")!;
this.canvasAnimatedControl.Draw += CanvasAnimatedControl_Draw;
}
// Ensure the panel is not paused when the control is loaded
private void D2D1AnimatedPixelShaderPanel_Loaded(object sender, RoutedEventArgs e)
{
if (this.canvasAnimatedControl is { } canvasAnimatedControl &&
PixelShaderEffect is not null &&
!IsPaused)
{
canvasAnimatedControl.Paused = false;
}
}
// Always pause rendering when the control is unloaded
private void D2D1AnimatedPixelShaderPanel_Unloaded(object sender, RoutedEventArgs e)
{
if (this.canvasAnimatedControl is { } canvasAnimatedControl)
{
canvasAnimatedControl.Paused = true;
}
}
/// <summary>
/// Draws a new frame on the wrapped <see cref="CanvasAnimatedControl"/> instance.
/// </summary>
/// <param name="sender">The source <see cref="ICanvasAnimatedControl"/> instance.</param>
/// <param name="args">The <see cref="CanvasAnimatedDrawEventArgs"/> object to perform drawing with.</param>
private void CanvasAnimatedControl_Draw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEventArgs args)
{
// Set the effect properties
this.pixelShaderEffect!.ElapsedTime = args.Timing.TotalTime;
this.pixelShaderEffect.ScreenWidth = sender.ConvertDipsToPixels((float)sender.Size.Width, CanvasDpiRounding.Round);
this.pixelShaderEffect.ScreenHeight = sender.ConvertDipsToPixels((float)sender.Size.Height, CanvasDpiRounding.Round);
// Draw the effect
args.DrawingSession.DrawImage(this.pixelShaderEffect);
}
/// <inheritdoc cref="DependencyPropertyChangedCallback"/>
private static void OnPixelShaderEffectPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
D2D1AnimatedPixelShaderPanel @this = (D2D1AnimatedPixelShaderPanel)d;
PixelShaderEffect? pixelShaderEffect = (PixelShaderEffect?)e.NewValue;
// Save the new pixel shader effect for later (as the dependency property cannot be accessed by the render thread)
@this.pixelShaderEffect = pixelShaderEffect;
// Pause or start the render thread if an effect is available
if (@this.canvasAnimatedControl is { } canvasAnimatedControl)
{
bool shouldRender = @this.IsLoaded && !@this.IsPaused && pixelShaderEffect is not null;
canvasAnimatedControl.Paused = !shouldRender;
}
}
/// <inheritdoc cref="DependencyPropertyChangedCallback"/>
private static void OnIsPausedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
D2D1AnimatedPixelShaderPanel @this = (D2D1AnimatedPixelShaderPanel)d;
bool isPaused = (bool)e.NewValue;
if (@this.canvasAnimatedControl is { } canvasAnimatedControl)
{
bool shouldRender = @this.IsLoaded && !isPaused && @this.PixelShaderEffect is not null;
canvasAnimatedControl.Paused = !shouldRender;
}
}
}
+19
ファイルの表示
@@ -0,0 +1,19 @@
using Microsoft.UI.Xaml.Controls;
namespace ComputeSharp.SwapChain.Core.Converters;
/// <summary>
/// A class with some static converters for rendering state.
/// </summary>
public static class RenderingPauseConverter
{
/// <summary>
/// Gets a symbol for an input rendering state.
/// </summary>
/// <param name="value">Whether or not the rendering is currently paused.</param>
/// <returns>A symbol representing the next action for the rendering.</returns>
public static Symbol ConvertPausedToSymbol(bool value)
{
return value ? Symbol.Play : Symbol.Pause;
}
}
+27
ファイルの表示
@@ -0,0 +1,27 @@
namespace ComputeSharp.SwapChain.Core.Converters;
/// <summary>
/// A class with some static converters for resolution scale settings.
/// </summary>
public static class ResolutionScaleConverter
{
/// <summary>
/// Converts a resolution scale to a formatted string.
/// </summary>
/// <param name="value">The input resolution scale (in percentage).</param>
/// <returns>A formatted percentage string for <paramref name="value"/>.</returns>
public static string ConvertPercentageToFormattedString(int value)
{
return $"{value}%";
}
/// <summary>
/// Converts a percentage value to a scaled value in the [0, 1] range.
/// </summary>
/// <param name="value">The input percentage value to scale.</param>
/// <returns>The input percentage scaled to the [0, 1] range.</returns>
public static double ConvertPercentageToScale(int value)
{
return value / 100.0;
}
}
+17
ファイルの表示
@@ -0,0 +1,17 @@
namespace ComputeSharp.SwapChain.Core.Enums;
/// <summary>
/// Indicates the rendering mode being used.
/// </summary>
public enum RenderingMode
{
/// <summary>
/// Render using DirectX 12 APIs.
/// </summary>
DirectX12,
/// <summary>
/// Render using Win2D (ie. Direct2D behind the scenes).
/// </summary>
Win2D
}
+89
ファイルの表示
@@ -0,0 +1,89 @@
using System;
using ComputeSharp.D2D1;
using ComputeSharp.D2D1.Descriptors;
using ComputeSharp.D2D1.WinUI;
namespace ComputeSharp.SwapChain.Core.Shaders;
/// <summary>
/// An base effect for an animated pixel shader.
/// </summary>
public abstract partial class PixelShaderEffect : CanvasEffect
{
/// <summary>
/// The current elapsed time.
/// </summary>
private TimeSpan elapsedTime;
/// <summary>
/// The current screen width in raw pixels.
/// </summary>
private int screenWidth;
/// <summary>
/// The current screen height in raw pixels.
/// </summary>
private int screenHeight;
/// <summary>
/// Gets or sets the total elapsed time.
/// </summary>
public TimeSpan ElapsedTime
{
get => this.elapsedTime;
set => SetPropertyAndInvalidateEffectGraph(ref this.elapsedTime, value);
}
/// <summary>
/// Gets or sets the screen width in raw pixels.
/// </summary>
public int ScreenWidth
{
get => this.screenWidth;
set => SetPropertyAndInvalidateEffectGraph(ref this.screenWidth, value);
}
/// <summary>
/// Gets or sets the screen height in raw pixels.
/// </summary>
public int ScreenHeight
{
get => this.screenHeight;
set => SetPropertyAndInvalidateEffectGraph(ref this.screenHeight, value);
}
/// <summary>
/// An effect for an animated pixel shader.
/// </summary>
/// <typeparam name="T">The type of pixel shader to render.</typeparam>
/// <param name="factory">The input <typeparamref name="T"/> factory.</param>
public sealed partial class For<T>(For<T>.Factory factory) : PixelShaderEffect
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
{
/// <summary>
/// The <see cref="PixelShaderEffect{T}"/> node in use.
/// </summary>
private static readonly CanvasEffectNode<PixelShaderEffect<T>> Effect = new();
/// <inheritdoc/>
protected override void BuildEffectGraph(CanvasEffectGraph effectGraph)
{
effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect<T>());
}
/// <inheritdoc/>
protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph)
{
effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight);
}
/// <summary>
/// A factory of a given shader instance.
/// </summary>
/// <param name="elapsedTime">The total elapsed time.</param>
/// <param name="screenWidth">The screen width in raw pixels.</param>
/// <param name="screenHeight">The screen height in raw pixels.</param>
/// <returns>A shader instance to render.</returns>
public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight);
}
}
+36
ファイルの表示
@@ -0,0 +1,36 @@
using System;
using System.IO;
using ComputeSharp.SwapChain.Shaders;
using ComputeSharp.WinUI;
using Windows.ApplicationModel;
namespace ComputeSharp.SwapChain.Core.Shaders.Runners;
/// <summary>
/// A specialized <see cref="IShaderRunner"/> for <see cref="ContouredLayers"/>.
/// </summary>
public sealed class ContouredLayersRunner : IShaderRunner
{
/// <summary>
/// A texture for <c>\Textures\RustyMetal.png</c>.
/// </summary>
private ReadOnlyTexture2D<Rgba32, Float4>? texture;
/// <inheritdoc/>
public bool TryExecute(IReadWriteNormalizedTexture2D<Float4> texture, TimeSpan timespan, object? parameter)
{
if (this.texture is null ||
this.texture.GraphicsDevice != texture.GraphicsDevice)
{
string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png");
this.texture?.Dispose();
this.texture = texture.GraphicsDevice.LoadReadOnlyTexture2D<Rgba32, Float4>(filename);
}
texture.GraphicsDevice.ForEach(texture, new ContouredLayers((float)timespan.TotalSeconds, this.texture));
return true;
}
}
+63
ファイルの表示
@@ -0,0 +1,63 @@
using System;
using System.IO;
using ComputeSharp.D2D1;
using ComputeSharp.D2D1.Interop;
using ComputeSharp.D2D1.WinUI;
using ComputeSharp.SwapChain.Shaders.D2D1;
using Windows.ApplicationModel;
namespace ComputeSharp.SwapChain.Core.Shaders.Runners;
/// <summary>
/// A specialized <see cref="PixelShaderEffect"/> for <see cref="ContouredLayers"/>.
/// </summary>
public sealed partial class D2D1ContouredLayersEffect : PixelShaderEffect
{
/// <summary>
/// The reusable <see cref="PixelShaderEffect{T}"/> node to use to render frames.
/// </summary>
private static readonly CanvasEffectNode<PixelShaderEffect<ContouredLayers>> PixelShaderEffect = new();
/// <inheritdoc/>
protected override unsafe void BuildEffectGraph(CanvasEffectGraph effectGraph)
{
string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png");
// As a temporary workaround for the lack of image decoding helpers for D2D1ResourceTextureManager, and in order to
// keep the code here synchronous and simple, we can just leverage the DirectX 12 APIs to load textures. That is, we
// first load a texture (which will use WIC behind the scenes) to get the decoded image data in GPU memory, and then
// copy the data in a readback texture we can read from on the CPU. We can't just load an upload texture and read
// from it, as that type of texture can only be written to from the CPU. From there, we create a D2D resource texture.
using ReadOnlyTexture2D<Rgba32, float4> readOnlyTexture = GraphicsDevice.GetDefault().LoadReadOnlyTexture2D<Rgba32, float4>(filename);
using ReadBackTexture2D<Rgba32> readBackTexture = GraphicsDevice.GetDefault().AllocateReadBackTexture2D<Rgba32>(readOnlyTexture.Width, readOnlyTexture.Height);
readOnlyTexture.CopyTo(readBackTexture);
// Get the buffer pointer, the stride, and calculate the buffer size without the trailing padding.
// That is, the area between the end of the data in the last row and the stride is not included.
Rgba32* dataBuffer = readBackTexture.View.DangerousGetAddressAndByteStride(out int strideInBytes);
int bufferSize = ((readBackTexture.Height - 1) * strideInBytes) + (readBackTexture.View.Width * sizeof(Rgba32));
// Create the resource texture manager to use in the shader
D2D1ResourceTextureManager resourceTextureManager = new(
extents: [(uint)readBackTexture.Height, (uint)readBackTexture.Width],
bufferPrecision: D2D1BufferPrecision.UInt8Normalized,
channelDepth: D2D1ChannelDepth.Four,
filter: D2D1Filter.MinMagMipLinear,
extendModes: [D2D1ExtendMode.Mirror, D2D1ExtendMode.Mirror],
data: new ReadOnlySpan<byte>(dataBuffer, bufferSize),
strides: [(uint)strideInBytes]);
// Create the new pixel shader effect
PixelShaderEffect<ContouredLayers> pixelShaderEffect = new() { ResourceTextureManagers = { [0] = resourceTextureManager } };
// Register the pixel shader effect as the output node in the effect graph
effectGraph.RegisterOutputNode(PixelShaderEffect, pixelShaderEffect);
}
/// <inheritdoc/>
protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph)
{
effectGraph.GetNode(PixelShaderEffect).ConstantBuffer = new ContouredLayers((float)ElapsedTime.TotalSeconds, new int2(ScreenWidth, ScreenHeight));
}
}
+157
ファイルの表示
@@ -0,0 +1,157 @@
using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using ComputeSharp.SwapChain.Core.Enums;
using ComputeSharp.SwapChain.Core.Shaders;
using ComputeSharp.SwapChain.Core.Shaders.Runners;
using ComputeSharp.SwapChain.Shaders;
using ComputeSharp.WinUI;
#pragma warning disable IDE0300 // CsWinRT does not support marshalling collection expression (https://github.com/microsoft/CsWinRT/issues/1661)
namespace ComputeSharp.SwapChain.Core.ViewModels;
/// <summary>
/// The viewmodel for for a view that allows users to select shaders and customize settings.
/// </summary>
public sealed partial class MainViewModel : ObservableObject
{
/// <summary>
/// Creates a new <see cref="MainViewModel"/> instance.
/// </summary>
public MainViewModel()
{
this.selectedRenderingMode = RenderingMode.DirectX12;
this.isVerticalSyncEnabled = true;
this.isDynamicResolutionEnabled = true;
this.selectedResolutionScale = 100;
this.selectedComputeShader = ComputeShaderOptions[0];
this.selectedComputeShader.IsSelected = true;
}
/// <summary>
/// Gets or sets the selected rendering mode.
/// </summary>
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsResolutionScaleOptionEnabled))]
private RenderingMode selectedRenderingMode;
/// <summary>
/// Gets or sets whether the vertical sync is enabled.
/// </summary>
[ObservableProperty]
private bool isVerticalSyncEnabled;
/// <summary>
/// Gets or sets whether the dynamic resolution is enabled.
/// </summary>
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsResolutionScaleOptionEnabled))]
private bool isDynamicResolutionEnabled;
/// <summary>
/// Gets the currently selected resolution scale setting (as percentage value).
/// </summary>
[ObservableProperty]
private int selectedResolutionScale;
/// <summary>
/// Gets or sets the currently selected compute shader.
/// </summary>
[ObservableProperty]
private ShaderRunnerViewModel selectedComputeShader;
/// <summary>
/// Gets or sets whether the rendering is currently paused.
/// </summary>
[ObservableProperty]
private bool isRenderingPaused;
/// <summary>
/// Gets the available resolution scaling options (as percentage values).
/// </summary>
public IList<int> ResolutionScaleOptions { get; } = new int[] { 25, 50, 75, 100 };
/// <summary>
/// Gets the collection of available compute shader.
/// </summary>
public IReadOnlyList<ShaderRunnerViewModel> ComputeShaderOptions { get; } = new ShaderRunnerViewModel[]
{
new(
nameof(ColorfulInfinity),
new ShaderRunner<ColorfulInfinity>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.ColorfulInfinity>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(
nameof(FractalTiling),
new ShaderRunner<FractalTiling>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.FractalTiling>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(
nameof(MengerJourney),
new ShaderRunner<MengerJourney>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.MengerJourney>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(
nameof(Octagrams),
new ShaderRunner<Octagrams>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.Octagrams>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(
nameof(ProteanClouds),
new ShaderRunner<ProteanClouds>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.ProteanClouds>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(
nameof(TwoTiledTruchet),
new ShaderRunner<TwoTiledTruchet>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.TwoTiledTruchet>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(
nameof(PyramidPattern),
new ShaderRunner<PyramidPattern>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.PyramidPattern>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(
nameof(TriangleGridContouring),
new ShaderRunner<TriangleGridContouring>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.TriangleGridContouring>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
new(nameof(ContouredLayers), new ContouredLayersRunner(), new D2D1ContouredLayersEffect()),
new(
nameof(TerracedHills),
new ShaderRunner<TerracedHills>(static time => new((float)time.TotalSeconds)),
new PixelShaderEffect.For<SwapChain.Shaders.D2D1.TerracedHills>(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
};
/// <summary>
/// Checks whether the resolution scale can currently be expliclty set.
/// </summary>
public bool IsResolutionScaleOptionEnabled => SelectedRenderingMode == RenderingMode.DirectX12 && !IsDynamicResolutionEnabled;
/// <summary>
/// Sets <see cref="SelectedRenderingMode"/>.
/// </summary>
[RelayCommand]
private void SetRenderingMode(RenderingMode renderingMode)
{
SelectedRenderingMode = renderingMode;
}
/// <summary>
/// Sets <see cref="SelectedResolutionScale"/>.
/// </summary>
[RelayCommand]
private void SetResolutionScale(int resolutionScale)
{
SelectedResolutionScale = resolutionScale;
}
/// <summary>
/// Toggles <see cref="IsRenderingPaused"/>.
/// </summary>
[RelayCommand]
private void ToggleRenderingPaused()
{
IsRenderingPaused = !IsRenderingPaused;
}
/// <inheritdoc/>
partial void OnSelectedComputeShaderChanging(ShaderRunnerViewModel? oldValue, ShaderRunnerViewModel newValue)
{
oldValue!.IsSelected = false;
newValue.IsSelected = true;
}
}
+38
ファイルの表示
@@ -0,0 +1,38 @@
using CommunityToolkit.Mvvm.ComponentModel;
using ComputeSharp.SwapChain.Core.Shaders;
using ComputeSharp.WinUI;
namespace ComputeSharp.SwapChain.Core.ViewModels;
/// <summary>
/// A viewmodel for a compute shader.
/// </summary>
/// <param name="shaderType">The name of the shader type to execute.</param>
/// <param name="shaderRunner">The <see cref="IShaderRunner"/> instance to execute.</param>
/// <param name="pixelShaderEffect">The <see cref="Shaders.PixelShaderEffect"/> instance to execute.</param>
public sealed partial class ShaderRunnerViewModel(
string shaderType,
IShaderRunner shaderRunner,
PixelShaderEffect pixelShaderEffect) : ObservableObject
{
/// <summary>
/// Gets the name of the shader type to execute.
/// </summary>
public string ShaderType => shaderType;
/// <summary>
/// Gets the <see cref="IShaderRunner"/> instance to execute.
/// </summary>
public IShaderRunner ShaderRunner => shaderRunner;
/// <summary>
/// Gets the <see cref="PixelShaderEffect"/> instance to execute.
/// </summary>
public PixelShaderEffect PixelShaderEffect => pixelShaderEffect;
/// <summary>
/// Gets or sets whether the current shader is selected.
/// </summary>
[ObservableProperty]
private bool isSelected;
}