Browse Source

Rename/refactor raytracing unit tests a bit.

Tex Riddell 7 years ago
parent
commit
dfa032cf16

+ 0 - 147
tools/clang/test/CodeGenHLSL/quick-test/lib_rt.hlsl

@@ -1,147 +0,0 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
-
-////////////////////////////////////////////////////////////////////////////
-// Prototype header contents to be removed on implementation of features:
-#define HIT_KIND_TRIANGLE_FRONT_FACE              0xFE
-#define HIT_KIND_TRIANGLE_BACK_FACE               0xFF
-
-typedef uint RAY_FLAG;
-#define RAY_FLAG_NONE                             0x00
-#define RAY_FLAG_FORCE_OPAQUE                     0x01
-#define RAY_FLAG_FORCE_NON_OPAQUE                 0x02
-#define RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH  0x04
-#define RAY_FLAG_SKIP_CLOSEST_HIT_SHADER          0x08
-#define RAY_FLAG_CULL_BACK_FACING_TRIANGLES       0x10
-#define RAY_FLAG_CULL_FRONT_FACING_TRIANGLES      0x20
-#define RAY_FLAG_CULL_OPAQUE                      0x40
-#define RAY_FLAG_CULL_NON_OPAQUE                  0x80
-
-struct BuiltInTriangleIntersectionAttributes
-{
-    float2 barycentrics;
-};
-
-////////////////////////////////////////////////////////////////////////////
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-struct MyParam {
-  float2 coord;
-  float4 output;
-};
-
-// CHECK: ; S                                 sampler      NA          NA      S0             s1     1
-// CHECK: ; RTAS                              texture     i32         ras      T0             t5     1
-// CHECK: ; T                                 texture     f32          2d      T1             t1     1
-
-// CHECK:@"\01?RTAS@@3URaytracingAccelerationStructure@@A" = external global %struct.RaytracingAccelerationStructure, align 4
-// CHECK:@"\01?T@@3V?$Texture2D@V?$vector@M$03@@@@A" = external global %class.Texture2D, align 4
-// CHECK:@"\01?S@@3USamplerState@@A" = external global %struct.SamplerState, align 4
-
-RaytracingAccelerationStructure RTAS : register(t5);
-
-// CHECK: define void [[raygen1:@"\\01\?raygen1@[^\"]+"]]() #0 {
-// CHECK:   %[[i_0:[0-9]+]] = load %struct.RaytracingAccelerationStructure, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", align 4
-// CHECK:   call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 0)
-// CHECK:   call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 1)
-// CHECK:   call i32 @dx.op.rayDispatchDimension.i32(i32 146, i8 0)
-// CHECK:   %[[i_8:[0-9]+]] = call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.RaytracingAccelerationStructure(i32 160, %struct.RaytracingAccelerationStructure %[[i_0]])
-// CHECK:   call void @dx.op.traceRay.struct.MyPayload(i32 157, %dx.types.Handle %[[i_8]], i32 0, i32 0, i32 0, i32 1, i32 0, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.250000e-01, float {{.*}}, float {{.*}}, float {{.*}}, float 1.280000e+02, %struct.MyPayload* nonnull {{.*}})
-// CHECK:   ret void
-
-[shader("raygeneration")]
-void raygen1()
-{
-  MyPayload p = (MyPayload)0;
-  p.pos = RayDispatchIndex();
-  float3 origin = {0, 0, 0};
-  float3 dir = normalize(float3(p.pos / (float)RayDispatchDimension(), 1));
-  RayDesc ray = { origin, 0.125, dir, 128.0};
-  TraceRay(RTAS, RAY_FLAG_NONE, 0, 0, 1, 0, ray, p);
-}
-
-// CHECK: define void [[intersection1:@"\\01\?intersection1@[^\"]+"]]() #0 {
-// CHECK:   [[CurrentRayT:%[^ ]+]] = call float @dx.op.currentRayT.f32(i32 154)
-// CHECK:   call i1 @dx.op.reportHit.struct.MyAttributes(i32 158, float [[CurrentRayT]], i32 0, %struct.MyAttributes* nonnull {{.*}})
-// CHECK:   ret void
-
-[shader("intersection")]
-void intersection1()
-{
-  float hitT = CurrentRayT();
-  MyAttributes attr = (MyAttributes)0;
-  bool bReported = ReportHit(hitT, 0, attr);
-}
-
-// CHECK: define void [[anyhit1:@"\\01\?anyhit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.MyAttributes* nocapture readonly %attr) #0 {
-// CHECK:   call float @dx.op.objectRayOrigin.f32(i32 149, i8 2)
-// CHECK:   call float @dx.op.objectRayDirection.f32(i32 150, i8 2)
-// CHECK:   call float @dx.op.currentRayT.f32(i32 154)
-// CHECK:   call void @dx.op.acceptHitAndEndSearch(i32 156)
-// CHECK:   call void @dx.op.ignoreHit(i32 155)
-// CHECK:   %color = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
-// CHECK:   store <4 x float> {{.*}}, <4 x float>* %color, align 4
-// CHECK:   ret void
-
-[shader("anyhit")]
-void anyhit1( inout MyPayload payload : SV_RayPayload,
-              in MyAttributes attr : SV_IntersectionAttributes )
-{
-  float3 hitLocation = ObjectRayOrigin() + ObjectRayDirection() * CurrentRayT();
-  if (hitLocation.z < attr.bary.x)
-    AcceptHitAndEndSearch();         // aborts function
-  if (hitLocation.z < attr.bary.y)
-    IgnoreHit();   // aborts function
-  payload.color += float4(0.125, 0.25, 0.5, 1.0);
-}
-
-// CHECK: define void [[closesthit1:@"\\01\?closesthit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.MyAttributes* nocapture readonly %attr) #0 {
-// CHECK:   call void @dx.op.callShader.struct.MyParam(i32 159, i32 %2, %struct.MyParam* nonnull %0)
-// CHECK:   %color = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
-// CHECK:   store <4 x float> {{.*}}, <4 x float>* %color, align 4
-// CHECK:   ret void
-
-[shader("closesthit")]
-void closesthit1( inout MyPayload payload : SV_RayPayload,
-                  in MyAttributes attr : SV_IntersectionAttributes )
-{
-  MyParam param = {attr.bary, {0,0,0,0}};
-  CallShader(attr.id, param);
-  payload.color += param.output;
-}
-
-// CHECK: define void [[miss1:@"\\01\?miss1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload) #0 {
-// CHECK:   %0 = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
-// CHECK:   store <4 x float> <float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %0, align 4
-// CHECK:   ret void
-
-[shader("miss")]
-void miss1(inout MyPayload payload : SV_RayPayload)
-{
-  payload.color = float4(1.0, 0.0, 1.0, 1.0);
-}
-
-Texture2D T : register(t1);
-SamplerState S : register(s1);
-
-// CHECK: define void [[callable1:@"\\01\?callable1@[^\"]+"]](%struct.MyParam* noalias nocapture %param) #0 {
-// CHECK:   %[[i_0:[0-9]+]] = load %struct.SamplerState, %struct.SamplerState* @"\01?S@@3USamplerState@@A", align 4
-// CHECK:   %[[i_1:[0-9]+]] = load %class.Texture2D, %class.Texture2D* @"\01?T@@3V?$Texture2D@V?$vector@M$03@@@@A", align 4
-// CHECK:   %[[i_3:[0-9]+]] = call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.class.Texture2D(i32 160, %class.Texture2D %[[i_1]])
-// CHECK:   %[[i_4:[0-9]+]] = call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.SamplerState(i32 160, %struct.SamplerState %[[i_0]])
-// CHECK:   %[[i_7:[0-9]+]] = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %[[i_3]], %dx.types.Handle %[[i_4]], float %[[i_5:[0-9]+]], float %[[i_6:[0-9]+]], float undef, float undef, i32 undef, i32 undef, i32 undef, float 0.000000e+00)
-// CHECK:   ret void
-
-[shader("callable")]
-void callable1(inout MyParam param)
-{
-  param.output = T.SampleLevel(S, param.coord, 0);
-}

+ 11 - 11
tools/clang/test/CodeGenHLSL/quick-test/ray_trace6.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_accept_ignore_hit.hlsl

@@ -1,12 +1,12 @@
-// RUN: %dxc -T lib_6_2 %s | FileCheck %s
-
-// CHECK: call void @dx.op.acceptHitAndEndSearch(i32 156)
-// CHECK: call void @dx.op.ignoreHit(i32 155)
-
-float4 emit(uint shader)  {
-  if (shader < 2)
-    AcceptHitAndEndSearch();
-  if (shader < 9)
-    IgnoreHit();
-   return 2.6;
+// RUN: %dxc -T lib_6_2 %s | FileCheck %s
+
+// CHECK: call void @dx.op.acceptHitAndEndSearch(i32 156)
+// CHECK: call void @dx.op.ignoreHit(i32 155)
+
+float4 emit(uint shader)  {
+  if (shader < 2)
+    AcceptHitAndEndSearch();
+  if (shader < 9)
+    IgnoreHit();
+   return 2.6;
 }

+ 33 - 0
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit.hlsl

@@ -0,0 +1,33 @@
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// CHECK: define void [[anyhit1:@"\\01\?anyhit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.MyAttributes* nocapture readonly %attr) #0 {
+// CHECK:   call float @dx.op.objectRayOrigin.f32(i32 149, i8 2)
+// CHECK:   call float @dx.op.objectRayDirection.f32(i32 150, i8 2)
+// CHECK:   call float @dx.op.currentRayT.f32(i32 154)
+// CHECK:   call void @dx.op.acceptHitAndEndSearch(i32 156)
+// CHECK:   call void @dx.op.ignoreHit(i32 155)
+// CHECK:   %color = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
+// CHECK:   store <4 x float> {{.*}}, <4 x float>* %color, align 4
+// CHECK:   ret void
+
+struct MyPayload {
+  float4 color;
+  uint2 pos;
+};
+
+struct MyAttributes {
+  float2 bary;
+  uint id;
+};
+
+[shader("anyhit")]
+void anyhit1( inout MyPayload payload : SV_RayPayload,
+              in MyAttributes attr : SV_IntersectionAttributes )
+{
+  float3 hitLocation = ObjectRayOrigin() + ObjectRayDirection() * CurrentRayT();
+  if (hitLocation.z < attr.bary.x)
+    AcceptHitAndEndSearch();         // aborts function
+  if (hitLocation.z < attr.bary.y)
+    IgnoreHit();   // aborts function
+  payload.color += float4(0.125, 0.25, 0.5, 1.0);
+}

+ 6 - 6
tools/clang/test/CodeGenHLSL/quick-test/ray_trace4.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_attr_struct.hlsl

@@ -1,7 +1,7 @@
-// RUN: %dxc -E main -T lib_6_2 %s | FileCheck %s
-
-//CHECK: User define type intrinsic arg must be struct
-
-float main(float THit : t, uint HitKind : h, float2 f2 : F) {
-  return ReportHit(THit, HitKind, f2);
+// RUN: %dxc -E main -T lib_6_2 %s | FileCheck %s
+
+//CHECK: User define type intrinsic arg must be struct
+
+float main(float THit : t, uint HitKind : h, float2 f2 : F) {
+  return ReportHit(THit, HitKind, f2);
 }

+ 29 - 0
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable.hlsl

@@ -0,0 +1,29 @@
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// CHECK: ; S                                 sampler      NA          NA      S0             s1     1
+// CHECK: ; T                                 texture     f32          2d      T0             t1     1
+
+// CHECK:@"\01?T@@3V?$Texture2D@V?$vector@M$03@@@@A" = external global %class.Texture2D, align 4
+// CHECK:@"\01?S@@3USamplerState@@A" = external global %struct.SamplerState, align 4
+
+// CHECK: define void [[callable1:@"\\01\?callable1@[^\"]+"]](%struct.MyParam* noalias nocapture %param) #0 {
+// CHECK:   %[[i_0:[0-9]+]] = load %struct.SamplerState, %struct.SamplerState* @"\01?S@@3USamplerState@@A", align 4
+// CHECK:   %[[i_1:[0-9]+]] = load %class.Texture2D, %class.Texture2D* @"\01?T@@3V?$Texture2D@V?$vector@M$03@@@@A", align 4
+// CHECK:   %[[i_3:[0-9]+]] = call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.class.Texture2D(i32 160, %class.Texture2D %[[i_1]])
+// CHECK:   %[[i_4:[0-9]+]] = call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.SamplerState(i32 160, %struct.SamplerState %[[i_0]])
+// CHECK:   %[[i_7:[0-9]+]] = call %dx.types.ResRet.f32 @dx.op.sampleLevel.f32(i32 62, %dx.types.Handle %[[i_3]], %dx.types.Handle %[[i_4]], float %[[i_5:[0-9]+]], float %[[i_6:[0-9]+]], float undef, float undef, i32 undef, i32 undef, i32 undef, float 0.000000e+00)
+// CHECK:   ret void
+
+struct MyParam {
+  float2 coord;
+  float4 output;
+};
+
+Texture2D T : register(t1);
+SamplerState S : register(s1);
+
+[shader("callable")]
+void callable1(inout MyParam param)
+{
+  param.output = T.SampleLevel(S, param.coord, 0);
+}

+ 13 - 13
tools/clang/test/CodeGenHLSL/quick-test/ray_trace5.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_callshader.hlsl

@@ -1,14 +1,14 @@
-// RUN: %dxc -T lib_6_2 %s | FileCheck %s
-
-// CHECK: call void @dx.op.callShader.struct.Parameter(i32 159
-
-struct Parameter {
-   float2 t;
-   int3 t2;
-};
-
-float4 emit(uint shader, inout Parameter p )  {
-  CallShader(shader, p);
-
-   return 2.6;
+// RUN: %dxc -T lib_6_2 %s | FileCheck %s
+
+// CHECK: call void @dx.op.callShader.struct.Parameter(i32 159
+
+struct Parameter {
+   float2 t;
+   int3 t2;
+};
+
+float4 emit(uint shader, inout Parameter p )  {
+  CallShader(shader, p);
+
+   return 2.6;
 }

+ 31 - 0
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit.hlsl

@@ -0,0 +1,31 @@
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// CHECK: define void [[closesthit1:@"\\01\?closesthit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.MyAttributes* nocapture readonly %attr) #0 {
+// CHECK:   call void @dx.op.callShader.struct.MyParam(i32 159, i32 %2, %struct.MyParam* nonnull %0)
+// CHECK:   %color = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
+// CHECK:   store <4 x float> {{.*}}, <4 x float>* %color, align 4
+// CHECK:   ret void
+
+struct MyPayload {
+  float4 color;
+  uint2 pos;
+};
+
+struct MyAttributes {
+  float2 bary;
+  uint id;
+};
+
+struct MyParam {
+  float2 coord;
+  float4 output;
+};
+
+[shader("closesthit")]
+void closesthit1( inout MyPayload payload : SV_RayPayload,
+                  in MyAttributes attr : SV_IntersectionAttributes )
+{
+  MyParam param = {attr.bary, {0,0,0,0}};
+  CallShader(attr.id, param);
+  payload.color += param.output;
+}

+ 19 - 0
tools/clang/test/CodeGenHLSL/quick-test/raytracing_intersection.hlsl

@@ -0,0 +1,19 @@
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// CHECK: define void [[intersection1:@"\\01\?intersection1@[^\"]+"]]() #0 {
+// CHECK:   [[CurrentRayT:%[^ ]+]] = call float @dx.op.currentRayT.f32(i32 154)
+// CHECK:   call i1 @dx.op.reportHit.struct.MyAttributes(i32 158, float [[CurrentRayT]], i32 0, %struct.MyAttributes* nonnull {{.*}})
+// CHECK:   ret void
+
+struct MyAttributes {
+  float2 bary;
+  uint id;
+};
+
+[shader("intersection")]
+void intersection1()
+{
+  float hitT = CurrentRayT();
+  MyAttributes attr = (MyAttributes)0;
+  bool bReported = ReportHit(hitT, 0, attr);
+}

+ 17 - 0
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss.hlsl

@@ -0,0 +1,17 @@
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// CHECK: define void [[miss1:@"\\01\?miss1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload) #0 {
+// CHECK:   %0 = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
+// CHECK:   store <4 x float> <float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %0, align 4
+// CHECK:   ret void
+
+struct MyPayload {
+  float4 color;
+  uint2 pos;
+};
+
+[shader("miss")]
+void miss1(inout MyPayload payload : SV_RayPayload)
+{
+  payload.color = float4(1.0, 0.0, 1.0, 1.0);
+}

+ 21 - 21
tools/clang/test/CodeGenHLSL/quick-test/ray_trace2.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_payload_struct.hlsl

@@ -1,22 +1,22 @@
-// RUN: %dxc -E main -T lib_6_2 %s | FileCheck %s
-
-//CHECK: User define type intrinsic arg must be struct
-
-RayTracingAccelerationStructure Acc;
-
-uint RayFlags;
-uint InstanceInclusionMask;
-uint RayContributionToHitGroupIndex;
-uint MultiplierForGeometryContributionToHitGroupIndex;
-uint MissShaderIndex;
-
-RayDesc Ray;
-
-
-float4 emit(inout float2 f2 )  {
-  TraceRay(Acc,RayFlags,InstanceInclusionMask,
-           RayContributionToHitGroupIndex,
-           MultiplierForGeometryContributionToHitGroupIndex,MissShaderIndex , Ray, f2);
-
-   return 2.6;
+// RUN: %dxc -E main -T lib_6_2 %s | FileCheck %s
+
+//CHECK: User define type intrinsic arg must be struct
+
+RayTracingAccelerationStructure Acc;
+
+uint RayFlags;
+uint InstanceInclusionMask;
+uint RayContributionToHitGroupIndex;
+uint MultiplierForGeometryContributionToHitGroupIndex;
+uint MissShaderIndex;
+
+RayDesc Ray;
+
+
+float4 emit(inout float2 f2 )  {
+  TraceRay(Acc,RayFlags,InstanceInclusionMask,
+           RayContributionToHitGroupIndex,
+           MultiplierForGeometryContributionToHitGroupIndex,MissShaderIndex , Ray, f2);
+
+   return 2.6;
 }

+ 55 - 0
tools/clang/test/CodeGenHLSL/quick-test/raytracing_raygeneration.hlsl

@@ -0,0 +1,55 @@
+// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+
+// CHECK: ; RTAS                              texture     i32         ras      T0             t5     1
+
+// CHECK:@"\01?RTAS@@3URaytracingAccelerationStructure@@A" = external global %struct.RaytracingAccelerationStructure, align 4
+
+// CHECK: define void [[raygen1:@"\\01\?raygen1@[^\"]+"]]() #0 {
+// CHECK:   %[[i_0:[0-9]+]] = load %struct.RaytracingAccelerationStructure, %struct.RaytracingAccelerationStructure* @"\01?RTAS@@3URaytracingAccelerationStructure@@A", align 4
+// CHECK:   call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 0)
+// CHECK:   call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 1)
+// CHECK:   call i32 @dx.op.rayDispatchDimension.i32(i32 146, i8 0)
+// CHECK:   %[[i_8:[0-9]+]] = call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.RaytracingAccelerationStructure(i32 160, %struct.RaytracingAccelerationStructure %[[i_0]])
+// CHECK:   call void @dx.op.traceRay.struct.MyPayload(i32 157, %dx.types.Handle %[[i_8]], i32 0, i32 0, i32 0, i32 1, i32 0, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.250000e-01, float {{.*}}, float {{.*}}, float {{.*}}, float 1.280000e+02, %struct.MyPayload* nonnull {{.*}})
+// CHECK:   ret void
+
+////////////////////////////////////////////////////////////////////////////
+// Prototype header contents to be removed on implementation of features:
+#define HIT_KIND_TRIANGLE_FRONT_FACE              0xFE
+#define HIT_KIND_TRIANGLE_BACK_FACE               0xFF
+
+typedef uint RAY_FLAG;
+#define RAY_FLAG_NONE                             0x00
+#define RAY_FLAG_FORCE_OPAQUE                     0x01
+#define RAY_FLAG_FORCE_NON_OPAQUE                 0x02
+#define RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH  0x04
+#define RAY_FLAG_SKIP_CLOSEST_HIT_SHADER          0x08
+#define RAY_FLAG_CULL_BACK_FACING_TRIANGLES       0x10
+#define RAY_FLAG_CULL_FRONT_FACING_TRIANGLES      0x20
+#define RAY_FLAG_CULL_OPAQUE                      0x40
+#define RAY_FLAG_CULL_NON_OPAQUE                  0x80
+
+struct BuiltInTriangleIntersectionAttributes
+{
+    float2 barycentrics;
+};
+
+////////////////////////////////////////////////////////////////////////////
+
+struct MyPayload {
+  float4 color;
+  uint2 pos;
+};
+
+RaytracingAccelerationStructure RTAS : register(t5);
+
+[shader("raygeneration")]
+void raygen1()
+{
+  MyPayload p = (MyPayload)0;
+  p.pos = RayDispatchIndex();
+  float3 origin = {0, 0, 0};
+  float3 dir = normalize(float3(p.pos / (float)RayDispatchDimension(), 1));
+  RayDesc ray = { origin, 0.125, dir, 128.0};
+  TraceRay(RTAS, RAY_FLAG_NONE, 0, 0, 1, 0, ray, p);
+}

+ 11 - 11
tools/clang/test/CodeGenHLSL/quick-test/ray_trace3.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_reporthit.hlsl

@@ -1,12 +1,12 @@
-// RUN: %dxc -T lib_6_2 %s | FileCheck %s
-
-// CHECK: call i1 @dx.op.reportHit.struct.Attr(i32 158
-
-struct Attr {
-   float2 t;
-   int3 t2;
-};
-
-float emit(float THit : t, uint HitKind : h, Attr a : A) {
-  return ReportHit(THit, HitKind, a);
+// RUN: %dxc -T lib_6_2 %s | FileCheck %s
+
+// CHECK: call i1 @dx.op.reportHit.struct.Attr(i32 158
+
+struct Attr {
+   float2 t;
+   int3 t2;
+};
+
+float emit(float THit : t, uint HitKind : h, Attr a : A) {
+  return ReportHit(THit, HitKind, a);
 }

+ 52 - 52
tools/clang/test/CodeGenHLSL/quick-test/ray_trace7.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_sgv_intrin.hlsl

@@ -1,53 +1,53 @@
-// RUN: %dxc -T lib_6_2 %s | FileCheck %s
-
-// CHECK: call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 0)
-// CHECK: call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 1)
-
-// CHECK: call i32 @dx.op.rayDispatchDimension.i32(i32 146, i8 0)
-// CHECK: call i32 @dx.op.rayDispatchDimension.i32(i32 146, i8 1)
-
-// CHECK: call float @dx.op.worldRayOrigin.f32(i32 147, i8 0)
-// CHECK: call float @dx.op.worldRayOrigin.f32(i32 147, i8 1)
-// CHECK: call float @dx.op.worldRayOrigin.f32(i32 147, i8 2)
-
-// CHECK: call float @dx.op.worldRayDirection.f32(i32 148, i8 0)
-// CHECK: call float @dx.op.worldRayDirection.f32(i32 148, i8 1)
-// CHECK: call float @dx.op.worldRayDirection.f32(i32 148, i8 2)
-
-// CHECK: call float @dx.op.objectRayOrigin.f32(i32 149, i8 0)
-// CHECK: call float @dx.op.objectRayOrigin.f32(i32 149, i8 1)
-// CHECK: call float @dx.op.objectRayOrigin.f32(i32 149, i8 2)
-
-// CHECK: call float @dx.op.objectRayDirection.f32(i32 150, i8 0)
-// CHECK: call float @dx.op.objectRayDirection.f32(i32 150, i8 1)
-// CHECK: call float @dx.op.objectRayDirection.f32(i32 150, i8 2)
-
-// CHECK: call float @dx.op.rayTMin.f32(i32 153)
-// CHECK: call float @dx.op.currentRayT.f32(i32 154)
-// CHECK: call i32 @dx.op.primitiveID.i32(i32 108)
-// CHECK: call i32 @dx.op.instanceID.i32(i32 141)
-// CHECK: call i32 @dx.op.instanceIndex.i32(i32 142)
-// CHECK: call i32 @dx.op.hitKind.i32(i32 143)
-// CHECK: call i32 @dx.op.rayFlag.i32(i32 144)
-
-float4 emit(uint shader)  {
-  uint2 a = RayDispatchIndex();
-  a += RayDispatchDimension();
-  float3 b = WorldRayOrigin();
-  b += WorldRayDirection();
-  b += ObjectRayOrigin();
-  b += ObjectRayDirection();
-
-  float4 r = float4(b, a.x+a.y);
-
-  r.w += RayTMin();
-  r.w += CurrentRayT();
-  r.w += PrimitiveID();
-  r.w += InstanceID();
-  r.w += InstanceIndex();
-  r.w += HitKind();
-  r.w += RayFlag();
-  
-
-   return r;
+// RUN: %dxc -T lib_6_2 %s | FileCheck %s
+
+// CHECK: call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 0)
+// CHECK: call i32 @dx.op.rayDispatchIndex.i32(i32 145, i8 1)
+
+// CHECK: call i32 @dx.op.rayDispatchDimension.i32(i32 146, i8 0)
+// CHECK: call i32 @dx.op.rayDispatchDimension.i32(i32 146, i8 1)
+
+// CHECK: call float @dx.op.worldRayOrigin.f32(i32 147, i8 0)
+// CHECK: call float @dx.op.worldRayOrigin.f32(i32 147, i8 1)
+// CHECK: call float @dx.op.worldRayOrigin.f32(i32 147, i8 2)
+
+// CHECK: call float @dx.op.worldRayDirection.f32(i32 148, i8 0)
+// CHECK: call float @dx.op.worldRayDirection.f32(i32 148, i8 1)
+// CHECK: call float @dx.op.worldRayDirection.f32(i32 148, i8 2)
+
+// CHECK: call float @dx.op.objectRayOrigin.f32(i32 149, i8 0)
+// CHECK: call float @dx.op.objectRayOrigin.f32(i32 149, i8 1)
+// CHECK: call float @dx.op.objectRayOrigin.f32(i32 149, i8 2)
+
+// CHECK: call float @dx.op.objectRayDirection.f32(i32 150, i8 0)
+// CHECK: call float @dx.op.objectRayDirection.f32(i32 150, i8 1)
+// CHECK: call float @dx.op.objectRayDirection.f32(i32 150, i8 2)
+
+// CHECK: call float @dx.op.rayTMin.f32(i32 153)
+// CHECK: call float @dx.op.currentRayT.f32(i32 154)
+// CHECK: call i32 @dx.op.primitiveID.i32(i32 108)
+// CHECK: call i32 @dx.op.instanceID.i32(i32 141)
+// CHECK: call i32 @dx.op.instanceIndex.i32(i32 142)
+// CHECK: call i32 @dx.op.hitKind.i32(i32 143)
+// CHECK: call i32 @dx.op.rayFlag.i32(i32 144)
+
+float4 emit(uint shader)  {
+  uint2 a = RayDispatchIndex();
+  a += RayDispatchDimension();
+  float3 b = WorldRayOrigin();
+  b += WorldRayDirection();
+  b += ObjectRayOrigin();
+  b += ObjectRayDirection();
+
+  float4 r = float4(b, a.x+a.y);
+
+  r.w += RayTMin();
+  r.w += CurrentRayT();
+  r.w += PrimitiveID();
+  r.w += InstanceID();
+  r.w += InstanceIndex();
+  r.w += HitKind();
+  r.w += RayFlag();
+  
+
+   return r;
 }

+ 33 - 33
tools/clang/test/CodeGenHLSL/quick-test/ray_trace8.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_sgv_transforms.hlsl

@@ -1,34 +1,34 @@
-// RUN: %dxc -T lib_6_2 %s | FileCheck %s
-
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 0)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 1)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 2)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 3)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 0)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 1)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 2)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 3)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 0)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 1)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 2)
-// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 3)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 0)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 1)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 2)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 3)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 0)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 1)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 2)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 3)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 0)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 1)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 2)
-// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 3)
-
-float3x4 emit(uint shader)  {
-  float3x4 o2w = ObjectToWorld();
-  float3x4 w2o = WorldToObject();
-
-
-   return o2w + w2o;
+// RUN: %dxc -T lib_6_2 %s | FileCheck %s
+
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 0)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 1)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 2)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 3)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 0)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 1)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 2)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 1, i8 3)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 0)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 1)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 2)
+// CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 2, i8 3)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 0)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 1)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 2)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 0, i8 3)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 0)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 1)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 2)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 1, i8 3)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 0)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 1)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 2)
+// CHECK: call float @dx.op.worldToObject.f32(i32 152, i32 2, i8 3)
+
+float3x4 emit(uint shader)  {
+  float3x4 o2w = ObjectToWorld();
+  float3x4 w2o = WorldToObject();
+
+
+   return o2w + w2o;
 }

+ 24 - 24
tools/clang/test/CodeGenHLSL/quick-test/ray_trace1.hlsl → tools/clang/test/CodeGenHLSL/quick-test/raytracing_traceray.hlsl

@@ -1,25 +1,25 @@
-// RUN: %dxc -T lib_6_2 %s | FileCheck %s
-
-// CHECK: call void @dx.op.traceRay.struct.Payload(i32 157,
-
-struct Payload {
-   float2 t;
-   int3 t2;
-};
-
-RaytracingAccelerationStructure Acc;
-
-uint RayFlags;
-uint InstanceInclusionMask;
-uint RayContributionToHitGroupIndex;
-uint MultiplierForGeometryContributionToHitGroupIndex;
-uint MissShaderIndex;
-
-
-float4 emit(inout float2 f2, RayDesc Ray:R, inout Payload p )  {
-  TraceRay(Acc,RayFlags,InstanceInclusionMask,
-           RayContributionToHitGroupIndex,
-           MultiplierForGeometryContributionToHitGroupIndex,MissShaderIndex, Ray, p);
-
-   return 2.6;
+// RUN: %dxc -T lib_6_2 %s | FileCheck %s
+
+// CHECK: call void @dx.op.traceRay.struct.Payload(i32 157,
+
+struct Payload {
+   float2 t;
+   int3 t2;
+};
+
+RaytracingAccelerationStructure Acc;
+
+uint RayFlags;
+uint InstanceInclusionMask;
+uint RayContributionToHitGroupIndex;
+uint MultiplierForGeometryContributionToHitGroupIndex;
+uint MissShaderIndex;
+
+
+float4 emit(inout float2 f2, RayDesc Ray:R, inout Payload p )  {
+  TraceRay(Acc,RayFlags,InstanceInclusionMask,
+           RayContributionToHitGroupIndex,
+           MultiplierForGeometryContributionToHitGroupIndex,MissShaderIndex, Ray, p);
+
+   return 2.6;
 }