yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
447b7e0e2
master
1//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj 2 3/* Test here is to try and associate a value with a type 4 5Works 6*/ 7 8//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer 9RWStructuredBuffer<int> outputBuffer; 10 11enum class Enum 12{ 13 A, B 14}; 15 16struct A 17{ 18 typedef A Type; 19 static const Enum kE = Enum::A; 20}; 21 22struct B 23{ 24 typedef B Type; 25 static const Enum kE = Enum::B; 26} 27 28[numthreads(4, 1, 1)] 29void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 30{ 31 int index = dispatchThreadID.x; 32 let e = B::Type::kE; 33 outputBuffer[index] = int(e); 34}