yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
055d4acd8
master
1//TEST:SIMPLE(filecheck=GLSL): -target glsl 2//TEST:SIMPLE(filecheck=SPIRV): -target spirv 3//TEST:SIMPLE(filecheck=SPIRV): -target spirv -emit-spirv-via-glsl 4 5// GLSL: GL_ARB_shader_clock : require 6// GLSL: GL_ARB_gpu_shader_int64 : require 7 8//SPIRV: OpCapability ShaderClockKHR 9//SPIRV: OpExtension "SPV_KHR_shader_clock" 10RWStructuredBuffer<float> output; 11 12[shader("compute")] 13[numthreads(1, 1, 1)] 14void computeMain(uint3 id: SV_DispatchThreadID) 15{ 16 //GLSL: clock2x32ARB 17 //SPIRV: OpReadClockKHR %v2uint %uint_3 18 output[0] = clock2x32ARB().x; 19 20 //GLSL: clockARB 21 //SPIRV: OpReadClockKHR %ulong %uint_3 22 uint64_t c = clockARB(); 23 output[1] = c; 24}