From 4720e4d65cba205edee72c0274c5816a6106f761 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 10 Aug 2022 20:41:08 +0200 Subject: [PATCH] Add float texture to test shader, compile it too --- tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderTests.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderTests.cs b/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderTests.cs index c0c06e06..7b3d1e3b 100644 --- a/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderTests.cs +++ b/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderTests.cs @@ -190,7 +190,7 @@ public partial class D2D1PixelShaderTests { ReadOnlyMemory resourceTextureDescriptions = D2D1PixelShader.GetResourceTextureDescriptions(); - Assert.AreEqual(resourceTextureDescriptions.Length, 3); + Assert.AreEqual(resourceTextureDescriptions.Length, 4); ReadOnlySpan span = resourceTextureDescriptions.Span; @@ -202,6 +202,9 @@ public partial class D2D1PixelShaderTests Assert.AreEqual(span[2].Index, 7); Assert.AreEqual(span[2].Rank, 3); + + Assert.AreEqual(span[3].Index, 8); + Assert.AreEqual(span[3].Rank, 2); } [D2DInputCount(4)] @@ -209,6 +212,7 @@ public partial class D2D1PixelShaderTests [D2DInputSimple(2)] [D2DInputComplex(1)] [D2DInputComplex(3)] + [D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)] [AutoConstructor] partial struct ShaderWithResourceTextures : ID2D1PixelShader { @@ -223,6 +227,9 @@ public partial class D2D1PixelShaderTests [D2DResourceTextureIndex(7)] D2D1ResourceTexture3D myTexture3; + [D2DResourceTextureIndex(8)] + D2D1ResourceTexture2D myTexture4; + public Float4 Execute() { float4 pixel1 = myTexture1[0]; @@ -231,6 +238,8 @@ public partial class D2D1PixelShaderTests float4 pixel4 = myTexture2.Sample(0.4f, 0.3f); float4 pixel5 = myTexture3[0, 1, 2]; float4 pixel6 = myTexture3.Sample(0.4f, 0.5f, 0.6f); + float number1 = myTexture4[0, 2]; + float number2 = myTexture4.Sample(0.4f, 0.6f); return 0; }