mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 00:00:12 +01:00
zink: use modifier feature flags during surface creation when necessary
cc: mesa-stable
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17773>
(cherry picked from commit 22eff86eaf)
This commit is contained in:
parent
46fc1b37b5
commit
5e00b2d8a7
2 changed files with 9 additions and 1 deletions
|
|
@ -787,7 +787,7 @@
|
|||
"description": "zink: use modifier feature flags during surface creation when necessary",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -147,6 +147,14 @@ create_surface(struct pipe_context *pctx,
|
|||
screen->format_props[templ->format].linearTilingFeatures;
|
||||
VkImageUsageFlags attachment = (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT);
|
||||
usage_info.usage = res->obj->vkusage & ~attachment;
|
||||
if (res->obj->modifier_aspect) {
|
||||
feats = res->obj->vkfeats;
|
||||
/* intersect format features for current modifier */
|
||||
for (unsigned i = 0; i < screen->modifier_props[templ->format].drmFormatModifierCount; i++) {
|
||||
if (res->obj->modifier == screen->modifier_props[templ->format].pDrmFormatModifierProperties[i].drmFormatModifier)
|
||||
feats &= screen->modifier_props[templ->format].pDrmFormatModifierProperties[i].drmFormatModifierTilingFeatures;
|
||||
}
|
||||
}
|
||||
if ((res->obj->vkusage & attachment) &&
|
||||
!(feats & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT))) {
|
||||
ivci->pNext = &usage_info;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue