Mesa (main): zink: return early when getting resource modifer if no modifier is used
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 25 21:25:28 UTC 2021
Module: Mesa
Branch: main
Commit: bdbcf256a12e6a966d72f1dc890136ffd47a62d5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bdbcf256a12e6a966d72f1dc890136ffd47a62d5
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Tue Aug 24 21:56:25 2021 -0400
zink: return early when getting resource modifer if no modifier is used
Reviewed-by: Hoe Hao Cheng <haochengho12907 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12534>
---
src/gallium/drivers/zink/zink_resource.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 13dc331069c..6201406946f 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -803,6 +803,8 @@ zink_resource_get_param(struct pipe_screen *pscreen, struct pipe_context *pctx,
*value = DRM_FORMAT_MOD_INVALID;
if (!screen->info.have_EXT_image_drm_format_modifier)
return false;
+ if (!res->modifiers)
+ return false;
VkImageDrmFormatModifierPropertiesEXT prop;
prop.sType = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT;
prop.pNext = NULL;
More information about the mesa-commit
mailing list