yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
65103bc9a
master
1//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj 2 3//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer 4RWStructuredBuffer<int> outputBuffer; 5[numthreads(1, 1, 1)] 6void computeMain(uint tig : SV_GroupIndex) 7{ 8 // Test that we infer the type parameters to X from the type of f 9 x(f); 10 // Testthat we infer the type paramters to from a specialized generic (g) 11 y(g<int>); 12 outputBuffer[tig] = p; 13} 14 15static int p = 0; 16 17func x<A, B>(f : functype (A) -> B) 18{ 19 ++p; 20} 21 22float f(int) 23{ 24 return 1; 25} 26 27func y<A, B, C>(g : functype (A, B) -> C) 28{ 29 p += 2; 30} 31 32void g<A>(A, bool) 33{ } 34