yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f8294202c
master
1// Bug related to resource specialization on unused resource typed fields. 2 3//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj 4 5//TEST_INPUT: Texture2D(size=4, content = one):name t2D 6Texture2D t2D; 7 8struct MyType 9{ 10 Texture2D tex; 11 int data; 12 [mutating] 13 void f(int val) 14 { 15 data += val; 16 } 17} 18 19int test(int val) 20{ 21 MyType t = {t2D, 0}; 22 t.f(val); 23 return t.data; 24} 25 26//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=gOutputBuffer 27RWStructuredBuffer<int> gOutputBuffer; 28 29[numthreads(4, 1, 1)] 30void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) 31{ 32 int tid = dispatchThreadID.x; 33 int inputVal = tid; 34 int outputVal = test(inputVal); 35 gOutputBuffer[tid] = outputVal; 36}