Browse Source

Move some of the raytracing diags to Sema (#5131)

This change moves some of the raytracing entry signature diagnostics up
into Sema. This is fallout from some work that I'm doing to cleanup and
reduce complexity in HLSL's CodeGen code, but it is also generally just
a win.

By catching these errors in Sema we stop compilation earlier and don't
need to make our Code Generation code resilient against invalid ASTs or
partial IR generation.
Chris B 2 years ago
parent
commit
f90af4e15e
37 changed files with 328 additions and 486 deletions
  1. 4 0
      include/dxc/DXIL/DxilShaderModel.h
  2. 22 0
      lib/DXIL/DxilShaderModel.cpp
  3. 10 0
      tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
  4. 2 0
      tools/clang/include/clang/Sema/SemaHLSL.h
  5. 24 90
      tools/clang/lib/CodeGen/CGHLSLMS.cpp
  6. 73 0
      tools/clang/lib/Sema/SemaDXR.cpp
  7. 4 0
      tools/clang/lib/Sema/SemaDecl.cpp
  8. 183 0
      tools/clang/test/HLSL/raytracing-entry-diags.hlsl
  9. 1 33
      tools/clang/test/HLSLFileCheck/hlsl/payload_qualifier/general.hlsl
  10. 0 16
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/builtin-ray-types-anyhit.hlsl
  11. 0 16
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/builtin-ray-types-callable.hlsl
  12. 0 17
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/builtin-ray-types-miss.hlsl
  13. 0 17
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_in_payload.hlsl
  14. 0 16
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_inout_attr.hlsl
  15. 0 12
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_no_attr.hlsl
  16. 0 8
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_no_payload.hlsl
  17. 0 17
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_out.hlsl
  18. 0 23
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_param.hlsl
  19. 0 12
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_2param.hlsl
  20. 0 7
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_in.hlsl
  21. 0 11
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_out.hlsl
  22. 0 15
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_ret.hlsl
  23. 0 15
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_udt.hlsl
  24. 0 16
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_in_payload.hlsl
  25. 0 16
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_inout_attr.hlsl
  26. 0 11
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_no_attr.hlsl
  27. 0 7
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_no_payload.hlsl
  28. 0 17
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_out.hlsl
  29. 0 23
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_param.hlsl
  30. 0 10
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_intersection_param.hlsl
  31. 0 12
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_extra.hlsl
  32. 0 11
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_in.hlsl
  33. 0 6
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_no_payload.hlsl
  34. 0 11
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_out.hlsl
  35. 0 11
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_udt.hlsl
  36. 0 10
      tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_raygen_param.hlsl
  37. 5 0
      tools/clang/unittests/HLSL/VerifierTest.cpp

+ 4 - 0
include/dxc/DXIL/DxilShaderModel.h

@@ -12,6 +12,9 @@
 #pragma once
 
 #include "dxc/DXIL/DxilConstants.h"
+
+#include "llvm/ADT/StringRef.h"
+
 #include <string>
 
 
@@ -78,6 +81,7 @@ public:
   static const ShaderModel *Get(Kind Kind, unsigned Major, unsigned Minor);
   static const ShaderModel *GetByName(const char *pszName);
   static const char *GetKindName(Kind kind);
+  static DXIL::ShaderKind KindFromFullName(llvm::StringRef Name);
 
   bool operator==(const ShaderModel &other) const;
   bool operator!=(const ShaderModel &other) const { return !(*this == other); }

+ 22 - 0
lib/DXIL/DxilShaderModel.cpp

@@ -12,6 +12,9 @@
 #include "dxc/DXIL/DxilShaderModel.h"
 #include "dxc/DXIL/DxilSemantic.h"
 #include "dxc/Support/Global.h"
+
+#include "llvm/ADT/StringSwitch.h"
+
 #include <algorithm>
 
 
@@ -371,6 +374,25 @@ const ShaderModel *ShaderModel::GetInvalid() {
   return &ms_ShaderModels[kNumShaderModels - 1];
 }
 
+DXIL::ShaderKind ShaderModel::KindFromFullName(llvm::StringRef Name) {
+  return llvm::StringSwitch<DXIL::ShaderKind>(Name)
+      .Case("pixel", DXIL::ShaderKind::Pixel)
+      .Case("vertex", DXIL::ShaderKind::Vertex)
+      .Case("geometry", DXIL::ShaderKind::Geometry)
+      .Case("hull", DXIL::ShaderKind::Hull)
+      .Case("domain", DXIL::ShaderKind::Domain)
+      .Case("compute", DXIL::ShaderKind::Compute)
+      .Case("raygeneration", DXIL::ShaderKind::RayGeneration)
+      .Case("intersection", DXIL::ShaderKind::Intersection)
+      .Case("anyhit", DXIL::ShaderKind::AnyHit)
+      .Case("closesthit", DXIL::ShaderKind::ClosestHit)
+      .Case("miss", DXIL::ShaderKind::Miss)
+      .Case("callable", DXIL::ShaderKind::Callable)
+      .Case("mesh", DXIL::ShaderKind::Mesh)
+      .Case("amplification", DXIL::ShaderKind::Amplification)
+      .Default(DXIL::ShaderKind::Invalid);
+}
+
 typedef ShaderModel SM;
 typedef Semantic SE;
 const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {

+ 10 - 0
tools/clang/include/clang/Basic/DiagnosticSemaKinds.td

@@ -7591,6 +7591,16 @@ def err_not_all_payload_fields_qualified : Error<
   "payload type '%0' requires that all fields carry payload access qualifiers.">;
 def err_payload_requires_attribute : Error<
   "type '%0' used as payload requires that it is annotated with the [raypayload] attribute">;
+def err_payload_requires_inout : Error<
+  "%select{payload|callable}0 parameter %1 must be 'inout'">;
+def err_attributes_requiers_in : Error<
+  "intersection attributes parameter %0 must be 'in'">;
+def err_payload_attrs_must_be_udt : Error<
+  "%select{payload|attributes|callable}0 parameter %1 must be a user-defined type composed of only numeric types">;
+def err_raytracing_must_return_void : Error<
+  "return type for ray tracing shaders must be void">;
+def err_raytracing_entry_param_count : Error<
+  "incorrect number of entry parameters for raytracing stage '%0': %1 parameter(s) provided, expected %select{no parameters|one payload parameter|two parameters for payload and attributes|one argument parameter}2">;
 def err_payload_fields_not_qualified : Error<
   "payload field '%0' has no payload access qualifiers.">;
 def err_payload_fields_is_payload_and_overqualified : Error<

+ 2 - 0
tools/clang/include/clang/Sema/SemaHLSL.h

@@ -96,6 +96,8 @@ void DiagnoseRaytracingPayloadAccess(
   clang::Sema &S,
   clang::TranslationUnitDecl* TU);
 
+void DiagnoseRaytracingEntry(clang::Sema &S, clang::FunctionDecl *FD);
+
 /// <summary>Finds the best viable function on this overload set, if it exists.</summary>
 clang::OverloadingResult GetBestViableFunction(
   clang::Sema &S,

+ 24 - 90
tools/clang/lib/CodeGen/CGHLSLMS.cpp

@@ -1820,10 +1820,6 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) {
     CheckParameterAnnotation(retTySemanticLoc, retTyAnnotation,
                              /*isPatchConstantFunction*/ false);
   }
-  if (isRay && !retTy->isVoidType()) {
-    Diags.Report(FD->getLocation(), Diags.getCustomDiagID(
-      DiagnosticsEngine::Error, "return type for ray tracing shaders must be void"));
-  }
 
   ConstructFieldAttributedAnnotation(retTyAnnotation, retTy, bDefaultRowMajor);
   if (FD->hasAttr<HLSLPreciseAttr>())
@@ -2174,98 +2170,36 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) {
       switch (funcProps->shaderKind) {
       case DXIL::ShaderKind::RayGeneration:
       case DXIL::ShaderKind::Intersection:
-        // RayGeneration and Intersection shaders are not allowed to have any input parameters
-        Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-          DiagnosticsEngine::Error, "parameters are not allowed for %0 shader"))
-            << (funcProps->shaderKind == DXIL::ShaderKind::RayGeneration ?
-                "raygeneration" : "intersection");
-        rayShaderHaveErrors = true;
         break;
       case DXIL::ShaderKind::AnyHit:
-      case DXIL::ShaderKind::ClosestHit:
-        if (0 == ArgNo && dxilInputQ != DxilParamInputQual::Inout) {
-          Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-            DiagnosticsEngine::Error,
-            "ray payload parameter must be inout"));
-          rayShaderHaveErrors = true;
-        } else if (1 == ArgNo && dxilInputQ != DxilParamInputQual::In) {
-          Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-            DiagnosticsEngine::Error,
-            "intersection attributes parameter must be in"));
-          rayShaderHaveErrors = true;
-        } else if (ArgNo > 1) {
-          Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-            DiagnosticsEngine::Error,
-            "too many parameters, expected payload and attributes parameters only."));
-          rayShaderHaveErrors = true;
-        }
-        if (ArgNo < 2) {
-          if (!IsHLSLCopyableAnnotatableRecord(parmDecl->getType())) {
-            Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-              DiagnosticsEngine::Error,
-              "payload and attribute structures must be user defined types with only numeric contents."));
-            rayShaderHaveErrors = true;
-          } else {
-            DataLayout DL(&this->TheModule);
-            unsigned size = DL.getTypeAllocSize(F->getFunctionType()->getFunctionParamType(ArgNo)->getPointerElementType());
-            if (0 == ArgNo)
-              funcProps->ShaderProps.Ray.payloadSizeInBytes = size;
-            else
-              funcProps->ShaderProps.Ray.attributeSizeInBytes = size;
-          }
-        }
+      case DXIL::ShaderKind::ClosestHit: {
+        DataLayout DL(&this->TheModule);
+        unsigned size = DL.getTypeAllocSize(F->getFunctionType()
+                                                ->getFunctionParamType(ArgNo)
+                                                ->getPointerElementType());
+        if (0 == ArgNo)
+          funcProps->ShaderProps.Ray.payloadSizeInBytes = size;
+        else
+          funcProps->ShaderProps.Ray.attributeSizeInBytes = size;
         break;
-      case DXIL::ShaderKind::Miss:
-        if (ArgNo > 0) {
-          Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-            DiagnosticsEngine::Error,
-            "only one parameter (ray payload) allowed for miss shader"));
-          rayShaderHaveErrors = true;
-        } else if (dxilInputQ != DxilParamInputQual::Inout) {
-          Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-            DiagnosticsEngine::Error,
-            "ray payload parameter must be declared inout"));
-          rayShaderHaveErrors = true;
-        }
-        if (ArgNo < 1) {
-          if (!IsHLSLCopyableAnnotatableRecord(parmDecl->getType())) {
-            Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-              DiagnosticsEngine::Error,
-              "ray payload parameter must be a user defined type with only numeric contents."));
-            rayShaderHaveErrors = true;
-          } else {
-            DataLayout DL(&this->TheModule);
-            unsigned size = DL.getTypeAllocSize(F->getFunctionType()->getFunctionParamType(ArgNo)->getPointerElementType());
-            funcProps->ShaderProps.Ray.payloadSizeInBytes = size;
-          }
-        }
+      }
+      case DXIL::ShaderKind::Miss: {
+        DataLayout DL(&this->TheModule);
+        unsigned size = DL.getTypeAllocSize(F->getFunctionType()
+                                                ->getFunctionParamType(ArgNo)
+                                                ->getPointerElementType());
+        funcProps->ShaderProps.Ray.payloadSizeInBytes = size;
         break;
-      case DXIL::ShaderKind::Callable:
-        if (ArgNo > 0) {
-          Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-            DiagnosticsEngine::Error,
-            "only one parameter allowed for callable shader"));
-          rayShaderHaveErrors = true;
-        } else if (dxilInputQ != DxilParamInputQual::Inout) {
-          Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-            DiagnosticsEngine::Error,
-            "callable parameter must be declared inout"));
-          rayShaderHaveErrors = true;
-        }
-        if (ArgNo < 1) {
-          if (!IsHLSLCopyableAnnotatableRecord(parmDecl->getType())) {
-            Diags.Report(parmDecl->getLocation(), Diags.getCustomDiagID(
-              DiagnosticsEngine::Error,
-              "callable parameter must be a user defined type with only numeric contents."));
-            rayShaderHaveErrors = true;
-          } else {
-            DataLayout DL(&this->TheModule);
-            unsigned size = DL.getTypeAllocSize(F->getFunctionType()->getFunctionParamType(ArgNo)->getPointerElementType());
-            funcProps->ShaderProps.Ray.paramSizeInBytes = size;
-          }
-        }
+      }
+      case DXIL::ShaderKind::Callable: {
+        DataLayout DL(&this->TheModule);
+        unsigned size = DL.getTypeAllocSize(F->getFunctionType()
+                                                ->getFunctionParamType(ArgNo)
+                                                ->getPointerElementType());
+        funcProps->ShaderProps.Ray.paramSizeInBytes = size;
         break;
       }
+      }
     }
 
     paramAnnotation.SetParamInputQual(dxilInputQ);

+ 73 - 0
tools/clang/lib/Sema/SemaDXR.cpp

@@ -27,6 +27,7 @@
 #include "llvm/ADT/BitVector.h"
 
 #include "dxc/DXIL/DxilConstants.h"
+#include "dxc/DXIL/DxilShaderModel.h"
 
 using namespace clang;
 using namespace sema;
@@ -1137,4 +1138,76 @@ void DiagnoseRaytracingPayloadAccess(clang::Sema &S,
   visitor.diagnose(TU);
 }
 
+void DiagnoseRaytracingEntry(Sema &S, FunctionDecl *FD) {
+  auto Attr = FD->getAttr<HLSLShaderAttr>();
+  if (!Attr)
+    return;
+
+  DXIL::ShaderKind Stage = ShaderModel::KindFromFullName(Attr->getStage());
+  if (Stage <= DXIL::ShaderKind::Library || Stage >= DXIL::ShaderKind::Mesh)
+    return;
+
+  if (!FD->getReturnType()->isVoidType())
+    S.Diag(FD->getLocation(), diag::err_raytracing_must_return_void);
+
+  if (Stage == DXIL::ShaderKind::Callable) {
+    if (FD->getNumParams() != 1)
+      S.Diag(FD->getLocation(), diag::err_raytracing_entry_param_count)
+          << Attr->getStage() << FD->getNumParams()
+          << /*Special message for callable.*/ 3;
+    else {
+      ParmVarDecl *Param = FD->getParamDecl(0);
+      if (!(Param->getAttr<HLSLInOutAttr>() ||
+            (Param->getAttr<HLSLOutAttr>() && Param->getAttr<HLSLInAttr>())))
+        S.Diag(Param->getLocation(), diag::err_payload_requires_inout)
+            << /*payload|callable*/ 1 << Param;
+      QualType Ty = Param->getType().getNonReferenceType();
+
+      if (!(hlsl::IsHLSLCopyableAnnotatableRecord(Ty)))
+        S.Diag(Param->getLocation(), diag::err_payload_attrs_must_be_udt)
+            << /*payload|attributes|callable*/ 2 << Param;
+    }
+    return;
+  }
+
+  unsigned ExpectedParams = 0;
+  if (Stage == DXIL::ShaderKind::Miss)
+    ExpectedParams = 1;
+  else if (Stage >= DXIL::ShaderKind::AnyHit)
+    ExpectedParams = 2;
+
+  if (ExpectedParams != FD->getNumParams())
+    S.Diag(FD->getLocation(), diag::err_raytracing_entry_param_count)
+        << Attr->getStage() << FD->getNumParams() << ExpectedParams;
+
+  if (FD->getNumParams() == 0)
+    return;
+
+  if (Stage < DXIL::ShaderKind::AnyHit || Stage > DXIL::ShaderKind::Miss)
+    return;
+
+  ParmVarDecl *Param = FD->getParamDecl(0);
+  if (!(Param->getAttr<HLSLInOutAttr>() ||
+        (Param->getAttr<HLSLOutAttr>() && Param->getAttr<HLSLInAttr>())))
+    S.Diag(Param->getLocation(), diag::err_payload_requires_inout)
+        << /*payload|callable*/ 0 << Param;
+
+  if (FD->getNumParams() > 1) {
+    Param = FD->getParamDecl(1);
+    if (Param->getAttr<HLSLInOutAttr>() || Param->getAttr<HLSLOutAttr>())
+      S.Diag(Param->getLocation(), diag::err_attributes_requiers_in) << Param;
+  }
+
+  for (unsigned Idx = 0; Idx < ExpectedParams && Idx < FD->getNumParams();
+       ++Idx) {
+    Param = FD->getParamDecl(Idx);
+
+    QualType Ty = Param->getType().getNonReferenceType();
+
+    if (!(hlsl::IsHLSLCopyableAnnotatableRecord(Ty)))
+      S.Diag(Param->getLocation(), diag::err_payload_attrs_must_be_udt)
+          << /*payload|attributes|callable*/ Idx << Param;
+  }
+}
+
 } // namespace hlsl

+ 4 - 0
tools/clang/lib/Sema/SemaDecl.cpp

@@ -8108,6 +8108,10 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
     AddToScope = false;
   }
 
+  if (getLangOpts().HLSL) {
+    hlsl::DiagnoseRaytracingEntry(*this, NewFD);
+  }
+
   return NewFD;
 }
 

+ 183 - 0
tools/clang/test/HLSL/raytracing-entry-diags.hlsl

@@ -0,0 +1,183 @@
+// RUN: %clang_cc1 -fsyntax-only -ffreestanding -verify %s
+
+
+[shader("anyhit")]
+void anyhit_param0( inout RayDesc D1, RayDesc D2 ) { }
+
+[shader("anyhit")]
+void anyhit_param1( inout BuiltInTriangleIntersectionAttributes A1, BuiltInTriangleIntersectionAttributes A2 ) { }
+
+// expected-error@+3{{payload parameter 'A1' must be a user-defined type composed of only numeric types}}
+// expected-error@+2{{attributes parameter 'A2' must be a user-defined type composed of only numeric types}}
+[shader("anyhit")]
+void anyhit_param2( inout Texture2D A1, float4 A2 ) { }
+
+// expected-error@+2{{payload parameter 'D1' must be 'inout'}}
+[shader("anyhit")]
+void anyhit_param3( RayDesc D1, RayDesc D2 ) { }
+
+// expected-error@+2{{payload parameter 'D1' must be 'inout'}}
+[shader("anyhit")]
+void anyhit_param4( in RayDesc D1, RayDesc D2 ) { }
+
+// expected-error@+2{{payload parameter 'D1' must be 'inout'}}
+[shader("anyhit")]
+void anyhit_param5( out RayDesc D1, RayDesc D2 ) { }
+
+[shader("anyhit")]
+void anyhit_param6( in out RayDesc D1, RayDesc D2 ) { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'anyhit': 0 parameter(s) provided, expected two parameters for payload and attributes}}
+[shader("anyhit")]
+void anyhit_param7() { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'anyhit': 1 parameter(s) provided, expected two parameters for payload and attributes}}
+[shader("anyhit")]
+void anyhit_param8( inout RayDesc D1) { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'anyhit': 3 parameter(s) provided, expected two parameters for payload and attributes}}
+[shader("anyhit")]
+void anyhit_param9( inout RayDesc D1, RayDesc D2, float f) { }
+
+[shader("anyhit")]
+float anyhit_param10( in out RayDesc D1, RayDesc D2 ) { } // expected-error{{return type for ray tracing shaders must be void}}
+
+// expected-error@+2{{intersection attributes parameter 'D2' must be 'in'}}
+[shader("anyhit")]
+void anyhit_param11( inout RayDesc D1, out RayDesc D2 ) { }
+
+// expected-error@+2{{intersection attributes parameter 'D2' must be 'in'}}
+[shader("anyhit")]
+void anyhit_param12( inout RayDesc D1, inout RayDesc D2 ) { }
+
+// expected-error@+2{{payload parameter 'payload' must be 'inout'}}
+[shader("closesthit")]
+void closesthit_payload0( RayDesc payload, RayDesc attr ) {}
+
+// expected-error@+2{{payload parameter 'payload' must be 'inout'}}
+[shader("closesthit")]
+void closesthit_payload1( in RayDesc payload, RayDesc attr ) {}
+
+// expected-error@+2{{payload parameter 'payload' must be 'inout'}}
+[shader("closesthit")]
+void closesthit_payload2( out RayDesc payload, RayDesc attr ) {}
+
+[shader("closesthit")]
+void closesthit_payload3( inout RayDesc payload, RayDesc attr ) {}
+
+[shader("closesthit")]
+void closesthit_payload4( in out RayDesc payload, RayDesc attr ) {}
+
+// expected-error@+3{{payload parameter 'f1' must be a user-defined type composed of only numeric types}}
+// expected-error@+2{{attributes parameter 'f2' must be a user-defined type composed of only numeric types}}
+[shader("closesthit")]
+void closesthit_payload5( inout float f1, float f2 ) { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'closesthit': 0 parameter(s) provided, expected two parameters for payload and attributes}}
+[shader("closesthit")]
+void closesthit_payload6() { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'closesthit': 1 parameter(s) provided, expected two parameters for payload and attributes}}
+[shader("closesthit")]
+void closesthit_payload7( inout RayDesc D1) { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'closesthit': 3 parameter(s) provided, expected two parameters for payload and attributes}}
+[shader("closesthit")]
+void closesthit_payload8( inout RayDesc D1, RayDesc attr, float f) { }
+
+[shader("closesthit")]
+float closesthit_payload9( inout RayDesc payload, RayDesc attr ) {} // expected-error{{return type for ray tracing shaders must be void}}
+
+// expected-error@+2{{intersection attributes parameter 'attr' must be 'in'}}
+[shader("closesthit")]
+void closesthit_payload10( inout RayDesc payload, out RayDesc attr ) {}
+
+// expected-error@+2{{intersection attributes parameter 'attr' must be 'in'}}
+[shader("closesthit")]
+void closesthit_payload11( inout RayDesc payload, inout RayDesc attr ) {}
+
+// expected-error@+2{{payload parameter 'payload' must be 'inout'}}
+[shader("miss")]
+void miss_payload0( RayDesc payload){}
+
+// expected-error@+2{{payload parameter 'payload' must be 'inout'}}
+[shader("miss")]
+void miss_payload1( in RayDesc payload){}
+
+// expected-error@+2{{payload parameter 'payload' must be 'inout'}}
+[shader("miss")]
+void miss_payload2( out RayDesc payload){}
+
+[shader("miss")]
+void miss_payload3( inout RayDesc payload){}
+
+[shader("miss")]
+void miss_payload4( in out RayDesc payload){}
+
+// expected-error@+2{{payload parameter 'f1' must be a user-defined type composed of only numeric types}}
+[shader("miss")]
+void miss_payload5( inout float f1 ) { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'miss': 0 parameter(s) provided, expected one payload parameter}}
+[shader("miss")]
+void miss_payload6( ) { }
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'miss': 3 parameter(s) provided, expected one payload parameter}}
+[shader("miss")]
+void miss_payload7(inout RayDesc payload, float f1, float f2 ) { }
+
+[shader("miss")]
+float miss_payload8( inout RayDesc payload) { } // expected-error{{return type for ray tracing shaders must be void}}
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'intersection': 1 parameter(s) provided, expected no parameters}}
+[shader("intersection")]
+float intersection_param(float4 extra) // expected-error{{return type for ray tracing shaders must be void}}
+{
+  return extra.x;
+}
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'raygeneration': 1 parameter(s) provided, expected no parameters}}
+[shader("raygeneration")]
+float raygen_param(float4 extra) // expected-error{{return type for ray tracing shaders must be void}}
+{
+  return extra.x;
+}
+
+struct MyPayload {
+  float4 color;
+  uint2 pos;
+};
+
+// expected-error@+2{{payload parameter 'payload' must be a user-defined type composed of only numeric types}}
+[shader("miss")]
+void miss_udt( inout PointStream<MyPayload> payload ) {}
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'callable': 0 parameter(s) provided, expected one argument parameter}}
+[shader("callable")]
+void callable0() {}
+
+// expected-error@+2{{callable parameter 'V' must be a user-defined type composed of only numeric types}}
+[shader("callable")]
+void callable1(inout float4 V) {}
+
+[shader("callable")]
+void callable2(MyPayload payload) {} // expected-error{{callable parameter 'payload' must be 'inout'}}
+
+[shader("callable")]
+void callable3(in MyPayload payload) {} // expected-error{{callable parameter 'payload' must be 'inout'}}
+
+[shader("callable")]
+void callable4(out MyPayload payload) {} // expected-error{{callable parameter 'payload' must be 'inout'}}
+
+[shader("callable")]
+void callable5(in out MyPayload payload) {}
+
+[shader("callable")]
+void callable6(inout MyPayload payload) {}
+
+// expected-error@+2{{incorrect number of entry parameters for raytracing stage 'callable': 2 parameter(s) provided, expected one argument parameter}}
+[shader("callable")]
+void callable7(inout MyPayload payload, float F) {}
+
+[shader("callable")]
+float callable8(inout MyPayload payload) {} // expected-error{{return type for ray tracing shaders must be void}}

+ 1 - 33
tools/clang/test/HLSLFileCheck/hlsl/payload_qualifier/general.hlsl

@@ -1,17 +1,8 @@
-// RUN: %dxc -T lib_6_x -D TEST_NUM=0 %s | FileCheck -check-prefix=CHK0 %s
-// RUN: %dxc -T lib_6_x -D TEST_NUM=1 %s | FileCheck -check-prefix=CHK1 %s
-// RUN: %dxc -T lib_6_x -D TEST_NUM=2 %s | FileCheck -check-prefix=CHK2 %s
-// RUN: %dxc -T lib_6_x -D TEST_NUM=3 %s | FileCheck -check-prefix=CHK3 %s
 // RUN: %dxc -T lib_6_5 -D TEST_NUM=4 %s -enable-payload-qualifiers | FileCheck -input-file=stderr -check-prefix=CHK4 %s
 // RUN: %dxc -T lib_6_6 -D TEST_NUM=4 %s | FileCheck -input-file=stderr -check-prefix=CHK5 %s
 // RUN: %dxc -T lib_6_6 -D TEST_NUM=4 %s -enable-payload-qualifiers | FileCheck -check-prefix=CHK6 %s
 // RUN: %dxc -T lib_6_6 -D TEST_NUM=5 %s -enable-payload-qualifiers | FileCheck -check-prefix=CHK7 %s
 
-// CHK0: error: shader must include inout payload structure parameter.
-// CHK1: error: ray payload parameter must be declared inout
-// CHK2: error: ray payload parameter must be a user defined type with only numeric contents.
-// CHK3: error: ray payload parameter must be a user defined type with only numeric contents.
-
 // check if we get DXIL and the payload type is there 
 // CHK4: Invalid target for payload access qualifiers. Only lib_6_6 and beyond are supported.
 // CHK5: warning: payload access qualifieres are only supported for target lib_6_6 and beyond. You can opt-in for lib_6_6 with the -enable-payload-qualifiers flag. Qualifiers will be dropped.
@@ -37,29 +28,6 @@ struct Payload {
 };
 #endif
 
-// test if compilation fails if payload is not present
-#if TEST_NUM == 0
-[shader("miss")]
-void Miss(){}
-#endif
-
-// test if compilation fails if payload is not inout
-#if TEST_NUM == 1
-[shader("miss")]
-void Miss2( in Payload payload){}
-#endif
-
-// test if compilation fails if payload is not a user defined type
-#if TEST_NUM == 2
-[shader("miss")]
-void Miss3(inout int payload){}
-#endif
-
-#if TEST_NUM == 3
-[shader("miss")]
-void Miss3(inout matrix<float, 2, 2> payload){}
-#endif
-
 // test if compilation fails because not all payload filds are qualified for lib_6_6
 // test if compilation succeeds for lib_6_5 where payload access qualifiers are not required
 #if TEST_NUM == 4
@@ -73,4 +41,4 @@ void Miss4(inout Payload payload){
 void Miss5(inout Payload payload){
     payload.b = 42;
 }
-#endif
+#endif

+ 0 - 16
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/builtin-ray-types-anyhit.hlsl

@@ -1,16 +0,0 @@
-// RUN: %dxc -T lib_6_4 %s 2>&1 | FileCheck %s
-
-// CHECK-NOT: error
-[shader("anyhit")]
-void anyhit_param0( inout RayDesc D1, RayDesc D2 ) { }
-
-[shader("anyhit")]
-void anyhit_param1( inout BuiltInTriangleIntersectionAttributes A1, BuiltInTriangleIntersectionAttributes A2 ) { }
-
-// CHECK: builtin-ray-types-anyhit.hlsl:15:37: error: payload and attribute structures must be user defined types with only numeric contents.
-// CHECK: builtin-ray-types-anyhit.hlsl:15:48: error: payload and attribute structures must be user defined types with only numeric contents.
-// CHECK: builtin-ray-types-anyhit.hlsl:15:6: error: shader must include inout payload structure parameter.
-// CHECK: builtin-ray-types-anyhit.hlsl:15:6: error: shader must include attributes structure parameter.
-[shader("anyhit")]
-void anyhit_param2( inout Texture2D A1, float4 A2 ) { }
-// CHECK-NOT: error

+ 0 - 16
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/builtin-ray-types-callable.hlsl

@@ -1,16 +0,0 @@
-// RUN: %dxc -T lib_6_4 %s 2>&1 | FileCheck %s
-
-// CHECK-NOT: error
-
-[shader("callable")]
-void callable0( inout RayDesc param ) {}
-
-[shader("callable")]
-void callable1( inout BuiltInTriangleIntersectionAttributes param ) {}
-
-// CHECK: builtin-ray-types-callable.hlsl:14:33: error: callable parameter must be a user defined type with only numeric contents.
-// CHECK: builtin-ray-types-callable.hlsl:14:6: error: shader must include inout parameter structure.
-[shader("callable")]
-void callable2( inout Texture2D param ) {}
-
-// CHECK-NOT: error

+ 0 - 17
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/builtin-ray-types-miss.hlsl

@@ -1,17 +0,0 @@
-// RUN: %dxc -T lib_6_4 %s 2>&1 | FileCheck %s
-
-// CHECK-NOT: error
-
-[shader("miss")]
-void miss0(inout RayDesc PL) { }
-
-[shader("miss")]
-void miss1(inout BuiltInTriangleIntersectionAttributes PL) { }
-
-// CHECK: builtin-ray-types-miss.hlsl:15:28: error: ray payload parameter must be a user defined type with only numeric contents.
-// CHECK: builtin-ray-types-miss.hlsl:15:6: error: shader must include inout payload structure parameter.
-
-[shader("miss")]
-void miss2(inout Texture2D PL) { }
-
-// CHECK-NOT: error

+ 0 - 17
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_in_payload.hlsl

@@ -1,17 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: ray payload parameter must be inout
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-[shader("anyhit")]
-void anyhit_in_payload( in MyPayload payload, MyAttributes attr ) {}
-

+ 0 - 16
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_inout_attr.hlsl

@@ -1,16 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: intersection attributes parameter must be in
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-[shader("anyhit")]
-void anyhit_inout_attr( inout MyPayload payload, inout MyAttributes attr ) {}

+ 0 - 12
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_no_attr.hlsl

@@ -1,12 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: shader must include attributes structure parameter
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-[shader("anyhit")]
-void anyhit_no_attr( inout MyPayload payload ) {}
-

+ 0 - 8
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_no_payload.hlsl

@@ -1,8 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: shader must include inout payload structure parameter
-// CHECK: error: shader must include attributes structure parameter
-
-[shader("anyhit")]
-void anyhit_no_payload() {}
-

+ 0 - 17
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_out.hlsl

@@ -1,17 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: ray payload parameter must be inout
-// CHECK: error: intersection attributes parameter must be in
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-[shader("anyhit")]
-void anyhit_out( out MyPayload payload, out MyAttributes attr ) {}

+ 0 - 23
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_anyhit_param.hlsl

@@ -1,23 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-// Fine.
-[shader("anyhit")]
-void anyhit_nop( inout MyPayload payload, MyAttributes attr ) {}
-
-// CHECK: error: return type for ray tracing shaders must be void
-// CHECK: error: ray payload parameter must be inout
-// CHECK: error: payload and attribute structures must be user defined types with only numeric contents.
-// CHECK: error: payload and attribute structures must be user defined types with only numeric contents.
-
-[shader("anyhit")]
-float anyhit_param( in float4 extra, Texture2D tex0 ) { return extra.x; }

+ 0 - 12
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_2param.hlsl

@@ -1,12 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: only one parameter allowed for callable shader
-
-struct MyParam {
-  float2 coord;
-  float4 output;
-};
-
-[shader("callable")]
-void callable_2param( inout MyParam param,
-                      inout MyParam param2 ) {}

+ 0 - 7
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_in.hlsl

@@ -1,7 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: callable parameter must be declared inout
-// CHECK: error: callable parameter must be a user defined type with only numeric contents.
-
-[shader("callable")]
-void callable_in( in float4x4 param ) {}

+ 0 - 11
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_out.hlsl

@@ -1,11 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: callable parameter must be declared inout
-
-struct MyParam {
-  float2 coord;
-  float4 output;
-};
-
-[shader("callable")]
-void callable_out( out MyParam param ) { param = (MyParam)0; }

+ 0 - 15
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_ret.hlsl

@@ -1,15 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-struct MyParam {
-  float2 coord;
-  float4 output;
-};
-
-// Fine.
-[shader("callable")]
-void callable_nop( inout MyParam param ) {}
-
-// CHECK: error: return type for ray tracing shaders must be void
-
-[shader("callable")]
-float callable_ret( inout MyParam param ) { return 1.0; }

+ 0 - 15
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_callable_udt.hlsl

@@ -1,15 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: callable parameter must be a user defined type with only numeric contents.
-
-struct Foo {
-  float4 vec;
-  RWByteAddressBuffer buf;
-};
-
-struct MyParams {
-  Foo foo;
-};
-
-[shader("callable")]
-void callable_udt( inout MyParams param ) {}

+ 0 - 16
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_in_payload.hlsl

@@ -1,16 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: ray payload parameter must be inout
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-[shader("closesthit")]
-void closesthit_in_payload( in MyPayload payload, MyAttributes attr ) {}

+ 0 - 16
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_inout_attr.hlsl

@@ -1,16 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: intersection attributes parameter must be in
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-[shader("closesthit")]
-void closesthit_inout_attr( inout MyPayload payload, inout MyAttributes attr ) {}

+ 0 - 11
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_no_attr.hlsl

@@ -1,11 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: shader must include attributes structure parameter
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-[shader("closesthit")]
-void closesthit_no_attr( inout MyPayload payload ) {}

+ 0 - 7
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_no_payload.hlsl

@@ -1,7 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: shader must include inout payload structure parameter
-// CHECK: error: shader must include attributes structure parameter
-
-[shader("closesthit")]
-void closesthit_no_payload() {}

+ 0 - 17
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_out.hlsl

@@ -1,17 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: ray payload parameter must be inout
-// CHECK: error: intersection attributes parameter must be in
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-[shader("closesthit")]
-void closesthit_out( out MyPayload payload, out MyAttributes attr ) {}

+ 0 - 23
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_closesthit_param.hlsl

@@ -1,23 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-struct MyAttributes {
-  float2 bary;
-  uint id;
-};
-
-// Fine.
-[shader("closesthit")]
-void closesthit_nop( inout MyPayload payload, in MyAttributes attr ) {}
-
-// CHECK: error: return type for ray tracing shaders must be void
-// CHECK: error: ray payload parameter must be inout
-// CHECK: error: payload and attribute structures must be user defined types with only numeric contents.
-// CHECK: error: payload and attribute structures must be user defined types with only numeric contents.
-
-[shader("closesthit")]
-float closesthit_param( in bool extra, RWByteAddressBuffer buf ) { return extra.x; }

+ 0 - 10
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_intersection_param.hlsl

@@ -1,10 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: return type for ray tracing shaders must be void
-// CHECK: error: parameters are not allowed for intersection shader
-
-[shader("intersection")]
-float intersection_param(float4 extra)
-{
-  return extra.x;
-}

+ 0 - 12
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_extra.hlsl

@@ -1,12 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: only one parameter (ray payload) allowed for miss shader
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-[shader("miss")]
-void miss_extra( inout MyPayload payload : SV_RayPayload,
-                 float extra) {}

+ 0 - 11
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_in.hlsl

@@ -1,11 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: ray payload parameter must be declared inout
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-[shader("miss")]
-void miss_in( in MyPayload payload : SV_RayPayload ) {}

+ 0 - 6
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_no_payload.hlsl

@@ -1,6 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: shader must include inout payload structure parameter
-
-[shader("miss")]
-void miss_no_payload() {}

+ 0 - 11
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_out.hlsl

@@ -1,11 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: ray payload parameter must be declared inout
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-[shader("miss")]
-void miss_out( out MyPayload payload : SV_RayPayload ) { payload = (MyPayload)0; }

+ 0 - 11
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_miss_udt.hlsl

@@ -1,11 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: ray payload parameter must be a user defined type with only numeric contents.
-
-struct MyPayload {
-  float4 color;
-  uint2 pos;
-};
-
-[shader("miss")]
-void miss_udt( inout PointStream<MyPayload> payload ) {}

+ 0 - 10
tools/clang/test/HLSLFileCheck/shader_targets/raytracing/raytracing_raygen_param.hlsl

@@ -1,10 +0,0 @@
-// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
-
-// CHECK: error: return type for ray tracing shaders must be void
-// CHECK: error: parameters are not allowed for raygeneration shader
-
-[shader("raygeneration")]
-float raygen_param(float4 extra)
-{
-  return extra.x;
-}

+ 5 - 0
tools/clang/unittests/HLSL/VerifierTest.cpp

@@ -64,6 +64,7 @@ public:
   TEST_METHOD(RunOutParamDiags)
   TEST_METHOD(RunPackReg)
   TEST_METHOD(RunPragmaRegion)
+  TEST_METHOD(RunRayTracingEntryDiags)
   TEST_METHOD(RunRayTracings)
   TEST_METHOD(RunScalarAssignments)
   TEST_METHOD(RunScalarAssignmentsExactPrecision)
@@ -297,6 +298,10 @@ TEST_F(VerifierTest, RunPragmaRegion) {
   CheckVerifiesHLSL(L"pragma-region.hlsl");
 }
 
+TEST_F(VerifierTest, RunRayTracingEntryDiags) {
+  CheckVerifiesHLSL(L"raytracing-entry-diags.hlsl");
+}
+
 TEST_F(VerifierTest, RunRayTracings) {
   CheckVerifiesHLSL(L"raytracings.hlsl");
 }