Pārlūkot izejas kodu

Remove prototype builtins, test builtin attr struct in closesthit.

Tex Riddell 7 gadi atpakaļ
vecāks
revīzija
052ff6c959

+ 4 - 9
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit.hlsl

@@ -1,6 +1,6 @@
 // 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: define void [[closesthit1:@"\\01\?closesthit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.BuiltInTriangleIntersectionAttributes* nocapture readonly %attr) #0 {
 // CHECK:   call void @dx.op.callShader.struct.MyParam(i32 159, i32 {{.*}}, %struct.MyParam* nonnull {{.*}})
 // CHECK:   %color = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
 // CHECK:   store <4 x float> {{.*}}, <4 x float>* %color, align 4
@@ -11,11 +11,6 @@ struct MyPayload {
   uint2 pos;
 };
 
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
 struct MyParam {
   float2 coord;
   float4 output;
@@ -23,9 +18,9 @@ struct MyParam {
 
 [shader("closesthit")]
 void closesthit1( inout MyPayload payload : SV_RayPayload,
-                  in MyAttributes attr : SV_IntersectionAttributes )
+                  in BuiltInTriangleIntersectionAttributes attr : SV_IntersectionAttributes )
 {
-  MyParam param = {attr.bary, {0,0,0,0}};
-  CallShader(attr.id, param);
+  MyParam param = {attr.barycentrics, {0,0,0,0}};
+  CallShader(7, param);
   payload.color += param.output;
 }

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

@@ -13,24 +13,6 @@
 // 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 MyPayload {
   float4 color;
   uint2 pos;