diff options
| author | Yong He <yonghe@outlook.com> | 2024-12-30 23:39:41 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-30 23:39:41 -0800 |
| commit | 3f43d6c14320c71a170b697bf13a4f130a71d297 (patch) | |
| tree | f2e97eff84b666095ed73e95333b674d99036934 /tests | |
| parent | cc1b96d91d8875bf727079d58fbf78af1135f505 (diff) | |
Add `RaytracingAccelerationStructure::__init(uint64_t)`. (#5967)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/spirv/u-to-accelstruct.slang | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/spirv/u-to-accelstruct.slang b/tests/spirv/u-to-accelstruct.slang new file mode 100644 index 000000000..71d693c63 --- /dev/null +++ b/tests/spirv/u-to-accelstruct.slang @@ -0,0 +1,22 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv +//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-via-glsl + +uniform uint64_t accelStructAddr; +RWStructuredBuffer<int> output; + +// CHECK: %[[REG:[A-Za-z0-9_]+]] = OpConvertUToAccelerationStructureKHR +// CHECK: OpRayQueryInitializeKHR %rayQuery{{.*}} %[[REG]] + +[numthreads(1,1,1)] +void main() +{ + let accelStruct = RaytracingAccelerationStructure(accelStructAddr); + RayQuery rayQuery; + RayDesc ray; + ray.Direction = float3(0, 0, 1); + ray.Origin = float3(0, 0, 0); + ray.TMax = 1000; + ray.TMin = 0; + let rs = rayQuery.TraceRayInline(accelStruct, 0, 0, ray); + output[0] = rayQuery.CandidateGeometryIndex(); +}
\ No newline at end of file |
