mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
aux/vk: Refactor out optional extension handling
This commit is contained in:
parent
57d24ecdbb
commit
bf27691280
|
@ -1129,14 +1129,6 @@ vk_check_extension(struct vk_bundle *vk, VkExtensionProperties *props, uint32_t
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < num_props; i++) {
|
for (uint32_t i = 0; i < num_props; i++) {
|
||||||
if (strcmp(props[i].extensionName, ext) == 0) {
|
if (strcmp(props[i].extensionName, ext) == 0) {
|
||||||
|
|
||||||
if (strcmp(ext, VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME) == 0) {
|
|
||||||
vk->has_GOOGLE_display_timing = true;
|
|
||||||
}
|
|
||||||
if (strcmp(ext, VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME) == 0) {
|
|
||||||
vk->has_EXT_global_priority = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1144,6 +1136,25 @@ vk_check_extension(struct vk_bundle *vk, VkExtensionProperties *props, uint32_t
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fill_in_has_extensions(struct vk_bundle *vk, const char **device_extensions, uint32_t num_device_extensions)
|
||||||
|
{
|
||||||
|
// Reset before filling out.
|
||||||
|
vk->has_GOOGLE_display_timing = false;
|
||||||
|
vk->has_EXT_global_priority = false;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < num_device_extensions; i++) {
|
||||||
|
const char *ext = device_extensions[i];
|
||||||
|
|
||||||
|
if (strcmp(ext, VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME) == 0) {
|
||||||
|
vk->has_GOOGLE_display_timing = true;
|
||||||
|
}
|
||||||
|
if (strcmp(ext, VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME) == 0) {
|
||||||
|
vk->has_EXT_global_priority = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static VkResult
|
static VkResult
|
||||||
vk_get_device_ext_props(struct vk_bundle *vk,
|
vk_get_device_ext_props(struct vk_bundle *vk,
|
||||||
VkPhysicalDevice physical_device,
|
VkPhysicalDevice physical_device,
|
||||||
|
@ -1207,6 +1218,9 @@ vk_build_device_extensions(struct vk_bundle *vk,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fill this out here.
|
||||||
|
fill_in_has_extensions(vk, device_extensions, num_device_extensions);
|
||||||
|
|
||||||
free(props);
|
free(props);
|
||||||
|
|
||||||
*out_device_extensions = device_extensions;
|
*out_device_extensions = device_extensions;
|
||||||
|
|
Loading…
Reference in a new issue