zink: add supported present modes to kopper displaytarget
for use later Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16193>
This commit is contained in:
committed by
Marge Bot
parent
d89b95b247
commit
de3890daa5
@@ -89,12 +89,28 @@ kopper_CreateSurface(struct zink_screen *screen, struct kopper_displaytarget *cd
|
||||
|
||||
VkBool32 supported;
|
||||
error = VKSCR(GetPhysicalDeviceSurfaceSupportKHR)(screen->pdev, screen->gfx_queue, surface, &supported);
|
||||
if (!zink_screen_handle_vkresult(screen, error) || !supported) {
|
||||
VKSCR(DestroySurfaceKHR)(screen->instance, surface, NULL);
|
||||
return VK_NULL_HANDLE;
|
||||
if (!zink_screen_handle_vkresult(screen, error) || !supported)
|
||||
goto fail;
|
||||
|
||||
unsigned count = 10;
|
||||
VkPresentModeKHR modes[10];
|
||||
error = VKSCR(GetPhysicalDeviceSurfacePresentModesKHR)(screen->pdev, surface, &count, modes);
|
||||
if (!zink_screen_handle_vkresult(screen, error))
|
||||
goto fail;
|
||||
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
/* VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR and VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR
|
||||
* are not handled
|
||||
*/
|
||||
assert(modes[i] <= VK_PRESENT_MODE_FIFO_RELAXED_KHR);
|
||||
if (modes[i] <= VK_PRESENT_MODE_FIFO_RELAXED_KHR)
|
||||
cdt->present_modes |= BITFIELD_BIT(modes[i]);
|
||||
}
|
||||
|
||||
return surface;
|
||||
fail:
|
||||
VKSCR(DestroySurfaceKHR)(screen->instance, surface, NULL);
|
||||
return VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -59,6 +59,7 @@ struct kopper_displaytarget
|
||||
void *loader_private;
|
||||
|
||||
VkSurfaceKHR surface;
|
||||
uint32_t present_modes; //VkPresentModeKHR bitmask
|
||||
struct kopper_swapchain *swapchain;
|
||||
struct kopper_swapchain *old_swapchain;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user