rayquery-array.hlsl 1.2 KB

12345678910111213141516171819202122232425262728
  1. // RUN: %dxc -T vs_6_5 -E main %s | FileCheck %s
  2. // CHECK: %[[RTAS:[^ ]+]] = call %dx.types.Handle @dx.op.createHandle(i32 57, i8 0, i32 0, i32 0, i1 false)
  3. // CHECK: %[[RQ2:[^ ]+]] = call i32 @dx.op.allocateRayQuery(i32 178, i32 513)
  4. // CHECK: %[[RQ1:[^ ]+]] = call i32 @dx.op.allocateRayQuery(i32 178, i32 513)
  5. // Additional allocations should have been cleaned up
  6. // CHECK-NOT: call i32 @dx.op.allocateRayQuery(i32 178,
  7. // CHECK: call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %[[RQ1]], %dx.types.Handle %[[RTAS]], i32 0, i32 1,
  8. // CHECK: call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %[[RQ1]], %dx.types.Handle %[[RTAS]], i32 1, i32 2,
  9. // CHECK: call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %[[RQ2]], %dx.types.Handle %[[RTAS]], i32 0, i32 1,
  10. RaytracingAccelerationStructure RTAS;
  11. void DoTrace(RayQuery<RAY_FLAG_FORCE_OPAQUE|RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES> rayQuery, RayDesc rayDesc) {
  12. rayQuery.TraceRayInline(RTAS, 0, 1, rayDesc);
  13. }
  14. int C;
  15. float main(RayDesc rayDesc : RAYDESC) : OUT {
  16. RayQuery<RAY_FLAG_FORCE_OPAQUE|RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES> rayQuery[2];
  17. DoTrace(rayQuery[1], rayDesc);
  18. rayQuery[1].TraceRayInline(RTAS, 1, 2, rayDesc);
  19. DoTrace(rayQuery[0], rayDesc);
  20. return 0;
  21. }