Skip to content

Commit

Permalink
Fix d3dcompiler_47.dll loading on 64 bit build.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jul 20, 2021
1 parent fe0d8a1 commit 1f19308
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions win_directx_helper/win_directx_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ bool ResolveD3DCompiler() {
return false;
}

#if defined _WIN32
const auto arch = L"x86";
#elif defined _WIN64 // _WIN32
#if defined _WIN64
const auto arch = L"x64";
#else // _WIN32 || _WIN64
#elif defined _WIN32 // _WIN64
const auto arch = L"x86";
#else // _WIN64 || _WIN32
#error "Invalid configuration."
#endif // _WIN32 || _WIN64
#endif // _WIN64 || _WIN32

#define DESKTOP_APP_STRINGIFY2(x) #x
#define DESKTOP_APP_STRINGIFY(x) DESKTOP_APP_STRINGIFY2(x)
Expand All @@ -171,7 +171,9 @@ bool ResolveD3DCompiler() {
if (FileSha256(path) == hash && ResolveD3DCompiler(path)) {
return true;
}
#endif // DESKTOP_APP_D3DCOMPILER_HASH
#elif defined DESKTOP_APP_SPECIAL_TARGET // DESKTOP_APP_D3DCOMPILER_HASH
#error "Special target build should have d3dcompiler hash."
#endif // !DESKTOP_APP_D3DCOMPILER_HASH && DESKTOP_APP_SPECIAL_TARGET

return ResolveD3DCompiler(L"d3dcompiler_47.dll");
}();
Expand Down

0 comments on commit 1f19308

Please sign in to comment.