diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/spirv/pointer-access.slang | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/spirv/pointer-access.slang b/tests/spirv/pointer-access.slang new file mode 100644 index 000000000..281613640 --- /dev/null +++ b/tests/spirv/pointer-access.slang @@ -0,0 +1,48 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -O0 + +//CHECK: OpEntryPoint + +struct Result +{ + float3 value; +}; + +struct Indirect +{ + float scale; +}; + +struct PushConstant +{ + Indirect *ptr; +}; + +struct Payload +{ + uint seed; +}; + +ConstantBuffer<PushConstant> pushConstants; + +Result f3(Indirect ss, float2 randomSample) +{ + Result result; + result.value = randomSample.x; + return result; +} + +float3 f2(inout uint seed) +{ + return f3(*pushConstants.ptr, float2(seed)).value; +} + +float3 f1(inout Payload payload) +{ + return f2(payload.seed); +} + +[shader("closesthit")] +void main(inout Payload payload, in BuiltInTriangleIntersectionAttributes attr) +{ + f1(payload); +}
\ No newline at end of file |
