File tree Expand file tree Collapse file tree
tools/clang/tools/dxcompiler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ struct RewriterOpts {
115115};
116116
117117enum 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
Original file line number Diff line number Diff line change @@ -52,19 +52,20 @@ namespace {
5252bool 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
You can’t perform that action at this time.
0 commit comments