diff --git a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj index 1365ca64..cc0194a8 100644 --- a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj +++ b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj @@ -4,6 +4,7 @@ net472;netcoreapp3.1;net6.0 false AnyCPU;x64;ARM64 + preview diff --git a/tests/ComputeSharp.Tests/ShaderCompilerTests.cs b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs index 7b5d0d08..849cff55 100644 --- a/tests/ComputeSharp.Tests/ShaderCompilerTests.cs +++ b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs @@ -32,6 +32,44 @@ namespace ComputeSharp.Tests } } + [TestMethod] + public void ReservedKeywordsInCustomTypes() + { + _ = ReflectionServices.GetShaderInfo(); + } + + public struct CellData + { + public float testX; + public float testY; + public uint seed; + + public float distance; + public readonly float dword; + public readonly float float2; + public readonly int int2x2; + } + + [AutoConstructor] + public readonly partial struct ReservedKeywordsInCustomTypesShader : IComputeShader + { + public readonly ReadWriteBuffer row_major; + public readonly CellData cellData; + public readonly float dword; + public readonly float float2; + public readonly int int2x2; + public readonly CellData cbuffer; + + public void Execute() + { + float exp = Hlsl.Exp(cellData.distance * row_major[ThreadIds.X]); + float log = Hlsl.Log(1 + exp); + float temp = log + cellData.dword + cellData.int2x2; + + row_major[ThreadIds.X] = log / dword + float2 + int2x2 + cbuffer.float2; + } + } + [TestMethod] public void ReservedKeywordsPrecompiled() {