|
@@ -207,12 +207,18 @@ public:
|
|
DxilModule &DM = M.GetDxilModule();
|
|
DxilModule &DM = M.GetDxilModule();
|
|
// Remove store undef output.
|
|
// Remove store undef output.
|
|
hlsl::OP *hlslOP = M.GetDxilModule().GetOP();
|
|
hlsl::OP *hlslOP = M.GetDxilModule().GetOP();
|
|
- unsigned ValMajor = 0;
|
|
|
|
- unsigned ValMinor = 0;
|
|
|
|
- M.GetDxilModule().GetValidatorVersion(ValMajor, ValMinor);
|
|
|
|
- if (ValMajor == 1 && ValMinor <= 1) {
|
|
|
|
- patchValidation_1_1(M);
|
|
|
|
|
|
+
|
|
|
|
+ bool IsLib = DM.GetShaderModel()->IsLib();
|
|
|
|
+ // Skip patch for lib.
|
|
|
|
+ if (!IsLib) {
|
|
|
|
+ unsigned ValMajor = 0;
|
|
|
|
+ unsigned ValMinor = 0;
|
|
|
|
+ M.GetDxilModule().GetValidatorVersion(ValMajor, ValMinor);
|
|
|
|
+ if (ValMajor == 1 && ValMinor <= 1) {
|
|
|
|
+ patchValidation_1_1(M);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
for (iplist<Function>::iterator F : M.getFunctionList()) {
|
|
for (iplist<Function>::iterator F : M.getFunctionList()) {
|
|
if (!hlslOP->IsDxilOpFunc(F))
|
|
if (!hlslOP->IsDxilOpFunc(F))
|
|
continue;
|
|
continue;
|
|
@@ -252,7 +258,6 @@ public:
|
|
// patchconstant function.
|
|
// patchconstant function.
|
|
Function *EntryFunc = DM.GetEntryFunction();
|
|
Function *EntryFunc = DM.GetEntryFunction();
|
|
Function *PatchConstantFunc = DM.GetPatchConstantFunction();
|
|
Function *PatchConstantFunc = DM.GetPatchConstantFunction();
|
|
- bool IsLib = DM.GetShaderModel()->IsLib();
|
|
|
|
|
|
|
|
std::vector<Function *> deadList;
|
|
std::vector<Function *> deadList;
|
|
for (iplist<Function>::iterator F : M.getFunctionList()) {
|
|
for (iplist<Function>::iterator F : M.getFunctionList()) {
|
|
@@ -345,9 +350,13 @@ public:
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- DM.CollectShaderFlags(); // Update flags to reflect any changes.
|
|
|
|
- // Update Validator Version
|
|
|
|
- DM.UpgradeToMinValidatorVersion();
|
|
|
|
|
|
+ // Skip shader flag for library.
|
|
|
|
+ if (!IsLib) {
|
|
|
|
+ DM.CollectShaderFlags(); // Update flags to reflect any changes.
|
|
|
|
+ // Update Validator Version
|
|
|
|
+ DM.UpgradeToMinValidatorVersion();
|
|
|
|
+ }
|
|
|
|
+
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|