zink/kopper: Set VK_COMPOSITE_ALPHA_OPAQUE_BIT when PresentOpaque is set
This is required for EGL_EXT_present_opaque to work correctly.
Fixes: 8ade5588e3 ("zink: add kopper api")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11007
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30133>
This commit is contained in:
parent
70b40fd2a0
commit
1f906f8715
4 changed files with 6 additions and 1 deletions
|
|
@ -97,6 +97,7 @@ struct kopper_loader_info {
|
|||
struct kopper_vk_surface_create_storage bos;
|
||||
int has_alpha;
|
||||
int initial_swap_interval;
|
||||
bool present_opaque;
|
||||
};
|
||||
|
||||
#define __DRI_KOPPER_LOADER "DRI_KopperLoader"
|
||||
|
|
|
|||
|
|
@ -2910,6 +2910,7 @@ kopperSetSurfaceCreateInfo(void *_draw, struct kopper_loader_info *out)
|
|||
wlsci->flags = 0;
|
||||
wlsci->display = dri2_dpy->wl_dpy;
|
||||
wlsci->surface = dri2_surf->wl_surface_wrapper;
|
||||
out->present_opaque = dri2_surf->base.PresentOpaque;
|
||||
}
|
||||
|
||||
static const __DRIkopperLoaderExtension kopper_loader_extension = {
|
||||
|
|
|
|||
|
|
@ -1454,6 +1454,7 @@ kopperSetSurfaceCreateInfo(void *_draw, struct kopper_loader_info *ci)
|
|||
xcb->connection = dri2_dpy->conn;
|
||||
xcb->window = dri2_surf->drawable;
|
||||
ci->has_alpha = dri2_surf->depth == 32;
|
||||
ci->present_opaque = dri2_surf->base.PresentOpaque;
|
||||
}
|
||||
|
||||
static const __DRIkopperLoaderExtension kopper_loader_extension = {
|
||||
|
|
|
|||
|
|
@ -283,7 +283,9 @@ kopper_CreateSwapchain(struct zink_screen *screen, struct kopper_displaytarget *
|
|||
cswap->scci.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||
cswap->scci.queueFamilyIndexCount = 0;
|
||||
cswap->scci.pQueueFamilyIndices = NULL;
|
||||
cswap->scci.compositeAlpha = has_alpha ? VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR : VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||
cswap->scci.compositeAlpha = has_alpha && !cdt->info.present_opaque
|
||||
? VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
|
||||
: VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||
cswap->scci.clipped = VK_TRUE;
|
||||
}
|
||||
cswap->scci.presentMode = cdt->present_mode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue