CMake: fix clang-cl build
Fails to compile this reinterpret_cast with: error : cast from 'FARPROC' (aka 'long long (*)()') to 'pD3DCompile' (aka 'long (*)(const void *, unsigned long long, const char *, const _D3D_SHADER_MACRO *, ID3DInclude *, const char *, const char *, unsigned int, unsigned int, ID3D10Blob **, ID3D10Blob **)') converts to incompatible function type [-Werror,-Wcast-function-type] pD3DCompile d3dCompile = reinterpret_cast<pD3DCompile>( ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Casting the result of GetProcAddress to void* fixes this. Note that this is the same thing Dawn does. Change-Id: Ib185a4fe96c60163cb66cd9591679856ae95d7f2 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/83360 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
parent
30747f607d
commit
400c59ae0c
|
@ -110,8 +110,8 @@ Result HlslUsingFXC(const std::string& source,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pD3DCompile d3dCompile =
|
pD3DCompile d3dCompile = reinterpret_cast<pD3DCompile>(
|
||||||
reinterpret_cast<pD3DCompile>(GetProcAddress(fxcLib, "D3DCompile"));
|
reinterpret_cast<void*>(GetProcAddress(fxcLib, "D3DCompile")));
|
||||||
if (d3dCompile == nullptr) {
|
if (d3dCompile == nullptr) {
|
||||||
result.output = "Couldn't load D3DCompile from FXC";
|
result.output = "Couldn't load D3DCompile from FXC";
|
||||||
result.failed = true;
|
result.failed = true;
|
||||||
|
|
Loading…
Reference in New Issue