Jelajahi Sumber

Fix disable validation case downgrading Dxil as if valver is 1.0

- Fixed two cases where we would treat disabled validation the same
  as valver 1.0, which isn't what we want.
Tex Riddell 7 tahun lalu
induk
melakukan
f186691f68
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 1 1
      lib/HLSL/DxilPreparePasses.cpp
  2. 1 1
      lib/HLSL/DxilShaderFlags.cpp

+ 1 - 1
lib/HLSL/DxilPreparePasses.cpp

@@ -525,7 +525,7 @@ void DxilEmitMetadata::patchIsFrontfaceTy(Module &M) {
     return;
   unsigned ValMajor, ValMinor;
   DM.GetValidatorVersion(ValMajor, ValMinor);
-  bool bForceUint = ValMajor >= 1 && ValMinor >= 2;
+  bool bForceUint = ValMajor == 0 || (ValMajor >= 1 && ValMinor >= 2);
   if (pSM->IsPS()) {
     patchIsFrontface(DM.GetInputSignature(), bForceUint);
   } else if (pSM->IsGS()) {

+ 1 - 1
lib/HLSL/DxilShaderFlags.cpp

@@ -224,7 +224,7 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
   // Try to maintain compatibility with a v1.0 validator if that's what we have.
   uint32_t valMajor, valMinor;
   M->GetValidatorVersion(valMajor, valMinor);
-  bool hasMulticomponentUAVLoadsBackCompat = valMajor <= 1 && valMinor == 0;
+  bool hasMulticomponentUAVLoadsBackCompat = valMajor == 1 && valMinor == 0;
 
   Type *int16Ty = Type::getInt16Ty(F->getContext());
   Type *int64Ty = Type::getInt64Ty(F->getContext());