tests: Fail if dxcompiler is not available at runtime.

This commit is contained in:
Giovanni Mascellani 2023-10-02 14:08:44 +02:00 committed by Alexandre Julliard
parent 1ee0cbb627
commit c1de65a99b
Notes: Alexandre Julliard 2023-10-16 22:59:19 +02:00
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/390

View File

@ -1457,23 +1457,20 @@ static IDxcCompiler3 *dxcompiler_create()
HRESULT hr; HRESULT hr;
void *dll; void *dll;
if (!(dll = vkd3d_dlopen(SONAME_LIBDXCOMPILER))) dll = vkd3d_dlopen(SONAME_LIBDXCOMPILER);
{ ok(dll, "Failed to load dxcompiler library, %s.\n", vkd3d_dlerror());
trace("Failed to load dxcompiler library, %s.\n", vkd3d_dlerror()); if (!dll)
return NULL; return NULL;
}
if (!(create_instance = (DxcCreateInstanceProc)vkd3d_dlsym(dll, "DxcCreateInstance"))) create_instance = (DxcCreateInstanceProc)vkd3d_dlsym(dll, "DxcCreateInstance");
{ ok(create_instance, "Failed to get DxcCreateInstance() pointer.\n");
trace("Failed to get DxcCreateInstance() pointer.\n"); if (!create_instance)
return NULL; return NULL;
}
if (FAILED(hr = create_instance(&CLSID_DxcCompiler, &IID_IDxcCompiler3, (void **)&compiler))) hr = create_instance(&CLSID_DxcCompiler, &IID_IDxcCompiler3, (void **)&compiler);
{ ok(SUCCEEDED(hr), "Failed to create instance, hr %#x.\n", hr);
trace("Failed to create instance, hr %#x.\n", hr); if (FAILED(hr))
return NULL; return NULL;
}
return compiler; return compiler;
} }