Skip to content

Commit 89363f7

Browse files
committed
change default validation behavior
1 parent 34b6d0f commit 89363f7

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

include/dxc/Support/HLSLOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct RewriterOpts {
115115
};
116116

117117
enum class ValidatorSelection : int {
118-
Auto, // Try DXIL.dll; fallback to internal validator
118+
Auto, // Try internal validator; fallback to DXIL.dll
119119
Internal, // Force internal validator (even if DXIL.dll is present)
120120
External, // Use DXIL.dll, failing compilation if not available
121121
Invalid = -1 // Invalid

tools/clang/tools/dxcompiler/dxcutil.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,20 @@ namespace {
5252
bool CreateValidator(CComPtr<IDxcValidator> &pValidator,
5353
hlsl::options::ValidatorSelection SelectValidator =
5454
hlsl::options::ValidatorSelection::Auto) {
55+
bool bInternalValidator = false;
5556
bool bInternal =
5657
SelectValidator == hlsl::options::ValidatorSelection::Internal;
5758
bool bExternal =
5859
SelectValidator == hlsl::options::ValidatorSelection::External;
59-
if (!bInternal && DxilLibIsEnabled())
60-
DxilLibCreateInstance(CLSID_DxcValidator, &pValidator);
6160

62-
bool bInternalValidator = false;
63-
if (pValidator == nullptr) {
64-
IFTBOOL(!bExternal, DXC_E_VALIDATOR_MISSING);
61+
if (!bExternal)
6562
IFT(CreateDxcValidator(IID_PPV_ARGS(&pValidator)));
66-
bInternalValidator = true;
63+
64+
if (pValidator == nullptr && DxilLibIsEnabled()) {
65+
IFTBOOL(!bInternal, DXC_E_VALIDATOR_MISSING);
66+
DxilLibCreateInstance(CLSID_DxcValidator, &pValidator);
6767
}
68+
6869
return bInternalValidator;
6970
}
7071

0 commit comments

Comments
 (0)