Add unit test for reserved custom types field names

このコミットが含まれているのは:
Sergio Pedri committed 2022-06-05 13:37:22 +02:00
1 親 94b40e5d61
コミット da4c42cafa
2ファイル変更
+39

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

+1
ファイルの表示
@@ -4,6 +4,7 @@
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<Platforms>AnyCPU;x64;ARM64</Platforms>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
+38
ファイルの表示
@@ -32,6 +32,44 @@ namespace ComputeSharp.Tests
}
}
[TestMethod]
public void ReservedKeywordsInCustomTypes()
{
_ = ReflectionServices.GetShaderInfo<ReservedKeywordsInCustomTypesShader>();
}
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<float> 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()
{