Module: vkd3d Branch: master Commit: c1de65a99ba851f97cb5f345b66a2bba1fc98fc2 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/c1de65a99ba851f97cb5f345b66a2b...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Mon Oct 2 14:08:44 2023 +0200
tests: Fail if dxcompiler is not available at runtime.
---
tests/shader_runner.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index cae0bf02..423f42bd 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -1457,23 +1457,20 @@ static IDxcCompiler3 *dxcompiler_create() HRESULT hr; void *dll;
- if (!(dll = vkd3d_dlopen(SONAME_LIBDXCOMPILER))) - { - trace("Failed to load dxcompiler library, %s.\n", vkd3d_dlerror()); + dll = vkd3d_dlopen(SONAME_LIBDXCOMPILER); + ok(dll, "Failed to load dxcompiler library, %s.\n", vkd3d_dlerror()); + if (!dll) return NULL; - }
- if (!(create_instance = (DxcCreateInstanceProc)vkd3d_dlsym(dll, "DxcCreateInstance"))) - { - trace("Failed to get DxcCreateInstance() pointer.\n"); + create_instance = (DxcCreateInstanceProc)vkd3d_dlsym(dll, "DxcCreateInstance"); + ok(create_instance, "Failed to get DxcCreateInstance() pointer.\n"); + if (!create_instance) return NULL; - }
- if (FAILED(hr = create_instance(&CLSID_DxcCompiler, &IID_IDxcCompiler3, (void **)&compiler))) - { - trace("Failed to create instance, hr %#x.\n", hr); + hr = create_instance(&CLSID_DxcCompiler, &IID_IDxcCompiler3, (void **)&compiler); + ok(SUCCEEDED(hr), "Failed to create instance, hr %#x.\n", hr); + if (FAILED(hr)) return NULL; - }
return compiler; }