rayquery-no-cse.hlsl 1.2 KB

1234567891011121314151617181920212223
  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: %[[RQ1:[^ ]+]] = call i32 @dx.op.allocateRayQuery(i32 178, i32 513)
  4. // CHECK: %[[RQ2:[^ ]+]] = call i32 @dx.op.allocateRayQuery(i32 178, i32 513)
  5. // CHECK: call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %[[RQ1]], %dx.types.Handle %[[RTAS]], i32 0, i32 1,
  6. // CHECK: call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %[[RQ1]], %dx.types.Handle %[[RTAS]], i32 1, i32 2,
  7. // CHECK: call void @dx.op.rayQuery_TraceRayInline(i32 179, i32 %[[RQ2]], %dx.types.Handle %[[RTAS]], i32 0, i32 1,
  8. RaytracingAccelerationStructure RTAS;
  9. void DoTrace(RayQuery<RAY_FLAG_FORCE_OPAQUE|RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES> rayQuery, RayDesc rayDesc) {
  10. rayQuery.TraceRayInline(RTAS, 0, 1, rayDesc);
  11. }
  12. float main(RayDesc rayDesc : RAYDESC) : OUT {
  13. RayQuery<RAY_FLAG_FORCE_OPAQUE|RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES> rayQuery1;
  14. RayQuery<RAY_FLAG_FORCE_OPAQUE|RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES> rayQuery2;
  15. DoTrace(rayQuery1, rayDesc);
  16. rayQuery1.TraceRayInline(RTAS, 1, 2, rayDesc);
  17. DoTrace(rayQuery2, rayDesc);
  18. return 0;
  19. }