zink: fix external_only reporting for dmabuf formats

this is based on format features

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31467>
(cherry picked from commit f3c206d61e)
This commit is contained in:
Mike Blumenkrantz 2024-10-03 08:00:51 -04:00 committed by Eric Engestrom
parent 1df31a9b81
commit bd7af2d8df
2 changed files with 3 additions and 4 deletions

View file

@ -2484,7 +2484,7 @@
"description": "zink: fix external_only reporting for dmabuf formats",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -2590,10 +2590,9 @@ zink_query_dmabuf_modifiers(struct pipe_screen *pscreen, enum pipe_format format
struct zink_screen *screen = zink_screen(pscreen);
*count = screen->modifier_props[format].drmFormatModifierCount;
for (int i = 0; i < MIN2(max, *count); i++) {
if (external_only)
external_only[i] = 0;
modifiers[i] = screen->modifier_props[format].pDrmFormatModifierProperties[i].drmFormatModifier;
if (external_only)
external_only[i] = !(screen->modifier_props[format].pDrmFormatModifierProperties[i].drmFormatModifierTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT);
}
}