yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
d84aeeffd
master
1//TEST:SIMPLE(filecheck=CHECK): -target glsl -entry computeMain -stage compute -profile sm_5_0 2//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target glsl -emit-spirv-directly -entry computeMain -stage compute -profile sm_5_0 -ignore-capabilities -skip-spirv-validation 3 4// Test that we diagnose simplified capabilities 5// CHECK_IGNORE_CAPS-NOT: error 36104 6// CHECK-NOT: sm_4_0 7// CHECK-NOT: sm_5_0 8// CHECK-NOT: sm_5_1 9// CHECK: error 36104: 'processDataBad' uses undeclared capability 'sm_6_0' 10// CHECK: capability7.slang(28): note: see using of 'processDataBadNested' 11// CHECK: capability7.slang(20): note: see definition of 'processDataBadNested' 12 13 14[require(glsl_hlsl_metal_spirv)] 15void processDataGood() 16{ 17} 18 19[require(hlsl, sm_6_0)] 20void processDataBadNested() 21{ 22 AllMemoryBarrier(); 23} 24 25[require(hlsl)] 26void processDataBad() 27{ 28 processDataBadNested(); 29} 30 31void myNestedNestedSafeCall() 32{ 33 processDataGood(); 34} 35 36void myNestedNestedBadCall() 37{ 38 processDataGood(); 39 processDataBad(); 40} 41 42void myNestedCall() 43{ 44 myNestedNestedSafeCall(); 45 myNestedNestedBadCall(); 46} 47 48[numthreads(1,1,1)] 49void computeMain() 50{ 51 myNestedCall(); 52}