Added test for HelloWorld shader and screenshot

このコミットが含まれているのは:
patan77 committed 2021-10-19 21:31:00 +02:00
1 親 7215a97ebd
コミット f35d8e903d
5ファイル変更
+41 -1

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

-1
ファイルの表示
@@ -4,7 +4,6 @@
/// A simple shader to get started with based on shadertoy new shader template.
/// Ported from <see href="https://www.shadertoy.com/new"/>.
/// </summary>
///
[AutoConstructor]
internal readonly partial struct HelloWorld : IPixelShader<Float4>
{
バイナリファイルは表示されません。

変更後

幅:  |  高さ:  |  サイズ: 23 KiB

+4
ファイルの表示
@@ -27,6 +27,7 @@
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Processors\HlslBokehBlurProcessor{TPixel}.cs" Link="Imaging\Processors\HlslBokehBlurProcessor{TPixel}.cs" />
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Processors\HlslGaussianBlurProcessor.cs" Link="Imaging\Processors\HlslGaussianBlurProcessor.cs" />
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Processors\HlslGaussianBlurProcessor{TPixel}.cs" Link="Imaging\Processors\HlslGaussianBlurProcessor{TPixel}.cs" />
<Compile Include="..\..\samples\ComputeSharp.SwapChain\Shaders\HelloWorld.cs" Link="Shaders\Pixel\HelloWorld.cs" />
<Compile Include="..\..\samples\ComputeSharp.SwapChain\Shaders\ColorfulInfinity.cs" Link="Shaders\Pixel\ColorfulInfinity.cs" />
<Compile Include="..\..\samples\ComputeSharp.SwapChain\Shaders\ContouredLayers.cs" Link="Shaders\Pixel\ContouredLayers.cs" />
<Compile Include="..\..\samples\ComputeSharp.SwapChain\Shaders\ExtrudedTruchetPattern.cs" Link="Shaders\Pixel\ExtrudedTruchetPattern.cs" />
@@ -45,6 +46,9 @@
<None Update="Assets/CityAfter1024x1024Sampling.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\HelloWorld.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\ColorfulInfinity.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+28
ファイルの表示
@@ -0,0 +1,28 @@
namespace ComputeSharp.SwapChain.Shaders.Compute
{
/// <summary>
/// A simple shader to get started with based on shadertoy new shader template.
/// Ported from <see href="https://www.shadertoy.com/new"/>.
/// </summary>
[AutoConstructor]
internal readonly partial struct HelloWorld : IPixelShader<Float4>
{
/// <summary>
/// The current time since the start of the application.
/// </summary>
public readonly float time;
/// <inheritdoc/>
public Float4 Execute()
{
// Normalized screen space UV coordinates from 0.0f to 1.0f
Float2 uv = ThreadIds.Normalized.XY;
// Time varying pixel color
Float3 col = 0.5f + 0.5f * Hlsl.Cos(time + new Float3(uv, uv.X) + new Float3(0, 2, 4));
// Output to screen
return new(col, 1f);
}
}
}
+9
ファイルの表示
@@ -16,6 +16,15 @@ namespace ComputeSharp.Tests
[TestCategory("Shaders")]
public class ShadersTests
{
[CombinatorialTestMethod]
[AllDevices]
[Data(typeof(HelloWorld))]
[Data(typeof(SwapChain.Shaders.Compute.HelloWorld))]
public void HelloWorld(Device device, Type shaderType)
{
RunAndCompareShader(device, shaderType, 0.0000004f);
}
[CombinatorialTestMethod]
[AllDevices]
[Data(typeof(ColorfulInfinity))]