mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Load libvulkan dynamically in shader_runner_vulkan.c.
We would like to allow overriding the soname of libvulkan, in which case the tests and demos should respect that override. Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bcad6d6997
commit
beffe5f367
@ -309,7 +309,7 @@ TESTS = $(vkd3d_tests) $(vkd3d_cross_tests) $(vkd3d_shader_tests)
|
||||
tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@ @VULKAN_LIBS@
|
||||
tests_d3d12_invalid_usage_LDADD = $(LDADD) @VULKAN_LIBS@
|
||||
tests_hlsl_d3d12_LDADD = $(LDADD) @VULKAN_LIBS@
|
||||
tests_shader_runner_LDADD = $(LDADD) @VULKAN_LIBS@
|
||||
tests_shader_runner_LDADD = $(LDADD) @VULKAN_LIBS@ @DL_LIBS@
|
||||
tests_shader_runner_SOURCES = \
|
||||
tests/shader_runner.c \
|
||||
tests/shader_runner_d3d12.c \
|
||||
|
@ -18,6 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define VK_NO_PROTOTYPES
|
||||
#include "config.h"
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "vkd3d_shader.h"
|
||||
@ -45,6 +46,8 @@ static struct vulkan_resource *vulkan_resource(struct resource *r)
|
||||
|
||||
#define DECLARE_VK_PFN(name) PFN_##name name;
|
||||
|
||||
DECLARE_VK_PFN(vkGetInstanceProcAddr)
|
||||
|
||||
struct vulkan_shader_runner
|
||||
{
|
||||
struct shader_runner r;
|
||||
@ -984,8 +987,16 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
|
||||
VkFormatProperties format_props;
|
||||
uint32_t count, graphics_index;
|
||||
VkDevice device;
|
||||
void *libvulkan;
|
||||
VkResult vr;
|
||||
|
||||
if (!(libvulkan = vkd3d_dlopen(SONAME_LIBVULKAN)))
|
||||
{
|
||||
skip("Failed to load %s: %s.\n", SONAME_LIBVULKAN, vkd3d_dlerror());
|
||||
return false;
|
||||
}
|
||||
vkGetInstanceProcAddr = vkd3d_dlsym(libvulkan, "vkGetInstanceProcAddr");
|
||||
|
||||
runner->vkCreateInstance = (void *)vkGetInstanceProcAddr(NULL, "vkCreateInstance");
|
||||
|
||||
if ((vr = VK_CALL(vkCreateInstance(&instance_desc, NULL, &runner->instance))) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user