Fix vulkan windows; Make test succeed w/o driver
Fix an error in the windows vulkan_sdk library finding. Also don't fail the vulkan test only because no vulkan driver is installed (should fix the travis error).
This commit is contained in:
parent
02e5c58efc
commit
6dd9098cd7
|
@ -538,10 +538,13 @@ class VulkanDependency(ExternalDependency):
|
|||
inc_path = os.path.join(self.vulkan_sdk, inc_dir)
|
||||
header = os.path.join(inc_path, 'vulkan', 'vulkan.h')
|
||||
lib_path = os.path.join(self.vulkan_sdk, lib_dir)
|
||||
find_lib = self.compiler.find_library('vulkan', environment, lib_path)
|
||||
find_lib = self.compiler.find_library(lib_name, environment, lib_path)
|
||||
|
||||
if not (find_lib and os.path.isfile(header)):
|
||||
raise DependencyException('VULKAN_SDK point to invalid directory')
|
||||
if not find_lib:
|
||||
raise DependencyException('VULKAN_SDK point to invalid directory (no lib)')
|
||||
|
||||
if not os.path.isfile(header):
|
||||
raise DependencyException('VULKAN_SDK point to invalid directory (no include)')
|
||||
|
||||
self.type_name = 'vulkan_sdk'
|
||||
self.is_found = True
|
||||
|
|
|
@ -14,13 +14,13 @@ int main()
|
|||
NULL,
|
||||
};
|
||||
|
||||
// we don't actually require instance creation to succeed since
|
||||
// we cannot expect test environments to have a vulkan driver installed.
|
||||
// As long as this does not produce as segmentation fault or similar,
|
||||
// everything's alright.
|
||||
VkInstance instance;
|
||||
VkResult ret = vkCreateInstance(&instance_create_info, NULL, &instance);
|
||||
if(ret != VK_SUCCESS) {
|
||||
printf("Could not create vulkan instance: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
vkDestroyInstance(instance, NULL);
|
||||
if(vkCreateInstance(&instance_create_info, NULL, &instance) == VK_SUCCESS)
|
||||
vkDestroyInstance(instance, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue