Fixed rewriting of locals/members with intrinsics names

このコミットが含まれているのは:
Sergio Pedri committed 2021-02-21 20:17:48 +01:00
1 親 2992825e4c
コミット a20fcd16ff
2ファイル変更
+76 -11

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

+31
ファイルの表示
@@ -0,0 +1,31 @@
using ComputeSharp.Interop;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ComputeSharp.Tests
{
[TestClass]
[TestCategory("ShaderCompiler")]
public partial class ShaderCompilerTests
{
[TestMethod]
public void ReservedKeywords()
{
ReflectionServices.GetShaderInfo<SoftmaxActivation>(out _);
}
[AutoConstructor]
public readonly partial struct SoftmaxActivation : IComputeShader
{
public readonly ReadWriteBuffer<float> row_major;
public readonly float dword;
public void Execute()
{
float exp = Hlsl.Exp(dword * row_major[ThreadIds.X]);
float log = Hlsl.Log(1 + exp);
row_major[ThreadIds.X] = log / dword;
}
}
}
}