yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
0ec8e5b01
master
1//DISABLED_TEST(compute):COMPARE_COMPUTE: -shaderobj 2 3//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer 4 5//TEST_INPUT:type AssocImpl 6 7 8RWStructuredBuffer<float> outputBuffer; 9 10interface IBase 11{ 12 float getVal(); 13}; 14 15interface IAssoc 16{ 17 associatedtype TBase : IBase; 18}; 19 20struct BaseImpl : IBase 21{ 22 float getVal() { return 1.0; } 23}; 24 25struct AssocImpl : IAssoc 26{ 27 typedef BaseImpl TBase; 28}; 29 30[numthreads(4, 1, 1)] 31void computeMain<T:IAssoc>( 32 uint3 dispatchThreadID : SV_DispatchThreadID) 33{ 34 uint tid = dispatchThreadID.x; 35 T.TBase base; 36 float rs = base.getVal(); 37 outputBuffer[tid] = rs; 38}