diff options
author | Jesse Natalie <jenatali@microsoft.com> | 2020-12-04 15:39:55 -0800 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-12-16 16:25:54 +0000 |
commit | eb4353838d7b54f0811d171da9afad5416b04059 (patch) | |
tree | 5abfc7d4f142e835ba3267d440ea898922dea47a | |
parent | 0b60d6a24d405066c4077154095a76204c103cc1 (diff) |
d3d12: Don't require DXIL for WSL
Always use the experimental shader models feature, which allows
unsigned DXIL to be used, so we don't need a libdxil for WSL.
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
-rw-r--r-- | src/gallium/drivers/d3d12/d3d12_compiler.cpp | 16 | ||||
-rw-r--r-- | src/gallium/drivers/d3d12/d3d12_screen.cpp | 5 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp index f42ab1ecd68..4b09a51587a 100644 --- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp +++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp @@ -1174,19 +1174,25 @@ d3d12_validation_tools::d3d12_validation_tools() { load_dxil_dll(); DxcCreateInstanceProc dxil_create_func = (DxcCreateInstanceProc)util_dl_get_proc_address(dxil_module, "DxcCreateInstance"); - assert(dxil_create_func); - HRESULT hr = dxil_create_func(CLSID_DxcValidator, IID_PPV_ARGS(&validator)); - if (FAILED(hr)) { - debug_printf("D3D12: Unable to create validator\n"); + if (dxil_create_func) { + HRESULT hr = dxil_create_func(CLSID_DxcValidator, IID_PPV_ARGS(&validator)); + if (FAILED(hr)) { + debug_printf("D3D12: Unable to create validator\n"); + } } +#ifdef _WIN32 + else if (!(d3d12_debug & D3D12_DEBUG_EXPERIMENTAL)) { + debug_printf("D3D12: Unable to load DXIL.dll\n"); + } +#endif DxcCreateInstanceProc compiler_create_func = nullptr; if(dxc_compiler_module.load("dxcompiler.dll")) compiler_create_func = (DxcCreateInstanceProc)util_dl_get_proc_address(dxc_compiler_module, "DxcCreateInstance"); if (compiler_create_func) { - hr = compiler_create_func(CLSID_DxcLibrary, IID_PPV_ARGS(&library)); + HRESULT hr = compiler_create_func(CLSID_DxcLibrary, IID_PPV_ARGS(&library)); if (FAILED(hr)) { debug_printf("D3D12: Unable to create library instance: %x\n", hr); } diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index 4ec192e004d..e8d47810fab 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -702,7 +702,10 @@ create_device(IUnknown *adapter) return NULL; } - if (d3d12_debug & D3D12_DEBUG_EXPERIMENTAL) { +#ifdef _WIN32 + if (d3d12_debug & D3D12_DEBUG_EXPERIMENTAL) +#endif + { D3D12EnableExperimentalFeatures = (PFN_D3D12ENABLEEXPERIMENTALFEATURES)util_dl_get_proc_address(d3d12_mod, "D3D12EnableExperimentalFeatures"); D3D12EnableExperimentalFeatures(1, &D3D12ExperimentalShaderModels, NULL, NULL); } |