Skip to content

Commit 722702d

Browse files
committed
initialize dxil dll in createdxccontainerbuilder
1 parent 75f968d commit 722702d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/clang/tools/dxcompiler/dxcapi.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ HRESULT CreateDxcContainerBuilder(REFIID riid, _Out_ LPVOID *ppv) {
6060
// Call dxil.dll's containerbuilder
6161
*ppv = nullptr;
6262
const char *warning;
63-
HRESULT hr = DxilLibCreateInstance(CLSID_DxcContainerBuilder,
64-
(IDxcContainerBuilder **)ppv);
63+
HRESULT hr = DxilLibInitialize();
64+
if (FAILED(hr)) {
65+
warning = "Unable to load dxil.dll.\n";
66+
}
67+
hr = DxilLibCreateInstance(CLSID_DxcContainerBuilder,
68+
(IDxcContainerBuilder **)ppv);
6569
if (FAILED(hr)) {
6670
warning = "Unable to create container builder from dxil.dll. Resulting "
6771
"container will not be signed.\n";

0 commit comments

Comments
 (0)