@@ -616,6 +616,7 @@ class DxcCompiler : public IDxcCompiler3,
616616 // validator can be used as a fallback.
617617 bool produceFullContainer = false ;
618618 bool needsValidation = false ;
619+ bool validateRootSigContainer = false ;
619620
620621 if (isPreprocessing) {
621622 // These settings are back-compatible with fxc.
@@ -675,6 +676,12 @@ class DxcCompiler : public IDxcCompiler3,
675676 dxcutil::GetValidatorVersion (&compiler.getCodeGenOpts ().HLSLValidatorMajorVer ,
676677 &compiler.getCodeGenOpts ().HLSLValidatorMinorVer );
677678 }
679+
680+ // Root signature-only container validation is only supported on 1.5 and above.
681+ validateRootSigContainer = DXIL::CompareVersions (
682+ compiler.getCodeGenOpts ().HLSLValidatorMajorVer ,
683+ compiler.getCodeGenOpts ().HLSLValidatorMinorVer ,
684+ 1 , 5 ) >= 0 ;
678685 }
679686
680687 if (opts.AstDump ) {
@@ -716,7 +723,7 @@ class DxcCompiler : public IDxcCompiler3,
716723
717724 pOutputBlob.Release ();
718725 IFT (pContainerStream.QueryInterface (&pOutputBlob));
719- if (!opts.DisableValidation ) {
726+ if (validateRootSigContainer && !opts.DisableValidation ) {
720727 CComPtr<IDxcBlobEncoding> pValErrors;
721728 // Validation failure communicated through diagnostic error
722729 dxcutil::ValidateRootSignatureInContainer (
@@ -841,7 +848,7 @@ class DxcCompiler : public IDxcCompiler3,
841848 if (pRootSigStream && pRootSigStream->GetPtrSize ()) {
842849 CComPtr<IDxcBlob> pRootSignature;
843850 IFT (pRootSigStream->QueryInterface (&pRootSignature));
844- if (needsValidation) {
851+ if (validateRootSigContainer && needsValidation) {
845852 CComPtr<IDxcBlobEncoding> pValErrors;
846853 // Validation failure communicated through diagnostic error
847854 dxcutil::ValidateRootSignatureInContainer (pRootSignature, &compiler.getDiagnostics ());
0 commit comments