blob: 47b108414ea1ecbcea3eb037dbd9469acc674e5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// entry-point-params.slang
// Test that entry-point `uniform` parameters on ray-tracing
// shaders properly map to the "shader record" in SPIR-V output.
//TEST:SIMPLE(filecheck=CHECK): -profile glsl_460+spirv_1_4 -stage raygeneration -entry main -target spirv-assembly
//TEST:SIMPLE(filecheck=CHECK): -stage raygeneration -entry main -target spirv-assembly -emit-spirv-directly
RWStructuredBuffer<float> buffer;
void main(
uniform float value)
{
buffer[DispatchRaysIndex().x] = value;
}
// CHECK: OpCapability RayTracingKHR
// CHECK: OpExtension "SPV_KHR_ray_tracing"
// CHECK: OpEntryPoint RayGeneration{{NV|KHR}} %main
// CHECK-DAG: OpDecorate %[[LaunchID:[A-Za-z0-9_]+]] BuiltIn LaunchId{{NV|KHR}}
// CHECK-DAG: %[[LaunchID]] = OpVariable %_ptr_Input_v3uint Input
// CHECK-DAG: %{{.*}} = OpLoad %v3uint %[[LaunchID]]
// CHECK-DAG: %{{.*}} = Op{{.*}}AccessChain %_ptr_ShaderRecordBuffer{{NV|KHR}}_float %{{.*}} %int_0
|