mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-06 01:30:35 +02:00
zink: use static array for detecting VK_TIME_DOMAIN_DEVICE_EXT
there's only a few possible values for this, so just use a static array
to avoid leaking
Fixes: 039078fe97 ("zink: slight refactor of load_device_extensions()")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13360>
This commit is contained in:
parent
061610a7dd
commit
11dd9e4ee4
1 changed files with 2 additions and 2 deletions
|
|
@ -1337,10 +1337,11 @@ static bool
|
|||
check_have_device_time(struct zink_screen *screen)
|
||||
{
|
||||
uint32_t num_domains = 0;
|
||||
VkTimeDomainEXT domains[8]; //current max is 4
|
||||
VKSCR(GetPhysicalDeviceCalibrateableTimeDomainsEXT)(screen->pdev, &num_domains, NULL);
|
||||
assert(num_domains > 0);
|
||||
assert(num_domains < ARRAY_SIZE(domains));
|
||||
|
||||
VkTimeDomainEXT *domains = malloc(sizeof(VkTimeDomainEXT) * num_domains);
|
||||
VKSCR(GetPhysicalDeviceCalibrateableTimeDomainsEXT)(screen->pdev, &num_domains, domains);
|
||||
|
||||
/* VK_TIME_DOMAIN_DEVICE_EXT is used for the ctx->get_timestamp hook and is the only one we really need */
|
||||
|
|
@ -1350,7 +1351,6 @@ check_have_device_time(struct zink_screen *screen)
|
|||
}
|
||||
}
|
||||
|
||||
free(domains);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue