yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
14764896c
master
1// callable-caller.slang 2 3//TEST:SIMPLE(filecheck=CHECK): -profile glsl_460 -capability GL_NV_ray_tracing -stage raygeneration -entry main -target spirv-assembly 4//TEST:SIMPLE(filecheck=CHECK): -profile glsl_460 -capability GL_NV_ray_tracing -stage raygeneration -entry main -target spirv-assembly -emit-spirv-directly 5 6 7import callable_shared; 8 9cbuffer C 10{ 11 uint shaderIndex; 12}; 13 14RWTexture2D<float4> gImage; 15 16void main() 17{ 18 MaterialPayload payload; 19 payload.albedo = 0; 20 payload.uv = float2(DispatchRaysIndex().xy) / float2(DispatchRaysDimensions().xy); 21 // CHECK: OpExecuteCallable 22 CallShader(shaderIndex, payload); 23 24 gImage[DispatchRaysIndex().xy] = payload.albedo; 25}