mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
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> (cherry picked from commit1f906f8715)
This commit is contained in:
parent
fbd4b2be5b
commit
c8e8664235
5 changed files with 7 additions and 2 deletions
|
|
@ -214,7 +214,7 @@
|
||||||
"description": "zink/kopper: Set VK_COMPOSITE_ALPHA_OPAQUE_BIT when PresentOpaque is set",
|
"description": "zink/kopper: Set VK_COMPOSITE_ALPHA_OPAQUE_BIT when PresentOpaque is set",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "8ade5588e39d736bdeab9bdd8ffa7cbfb6a5191e",
|
"because_sha": "8ade5588e39d736bdeab9bdd8ffa7cbfb6a5191e",
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ struct kopper_loader_info {
|
||||||
struct kopper_vk_surface_create_storage bos;
|
struct kopper_vk_surface_create_storage bos;
|
||||||
int has_alpha;
|
int has_alpha;
|
||||||
int initial_swap_interval;
|
int initial_swap_interval;
|
||||||
|
bool present_opaque;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define __DRI_KOPPER_LOADER "DRI_KopperLoader"
|
#define __DRI_KOPPER_LOADER "DRI_KopperLoader"
|
||||||
|
|
|
||||||
|
|
@ -2760,6 +2760,7 @@ kopperSetSurfaceCreateInfo(void *_draw, struct kopper_loader_info *out)
|
||||||
wlsci->flags = 0;
|
wlsci->flags = 0;
|
||||||
wlsci->display = dri2_dpy->wl_dpy;
|
wlsci->display = dri2_dpy->wl_dpy;
|
||||||
wlsci->surface = dri2_surf->wl_surface_wrapper;
|
wlsci->surface = dri2_surf->wl_surface_wrapper;
|
||||||
|
out->present_opaque = dri2_surf->base.PresentOpaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const __DRIkopperLoaderExtension kopper_loader_extension = {
|
static const __DRIkopperLoaderExtension kopper_loader_extension = {
|
||||||
|
|
|
||||||
|
|
@ -1454,6 +1454,7 @@ kopperSetSurfaceCreateInfo(void *_draw, struct kopper_loader_info *ci)
|
||||||
xcb->connection = dri2_dpy->conn;
|
xcb->connection = dri2_dpy->conn;
|
||||||
xcb->window = dri2_surf->drawable;
|
xcb->window = dri2_surf->drawable;
|
||||||
ci->has_alpha = dri2_surf->depth == 32;
|
ci->has_alpha = dri2_surf->depth == 32;
|
||||||
|
ci->present_opaque = dri2_surf->base.PresentOpaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const __DRIkopperLoaderExtension kopper_loader_extension = {
|
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.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||||
cswap->scci.queueFamilyIndexCount = 0;
|
cswap->scci.queueFamilyIndexCount = 0;
|
||||||
cswap->scci.pQueueFamilyIndices = NULL;
|
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.clipped = VK_TRUE;
|
||||||
}
|
}
|
||||||
cswap->scci.presentMode = cdt->present_mode;
|
cswap->scci.presentMode = cdt->present_mode;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue