Mesa (main): zink: add better TODO note for surface swizzles
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 21:37:25 UTC 2021
Module: Mesa
Branch: main
Commit: ea18b0930bc02e47e07bf3a648e1b91723c95735
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ea18b0930bc02e47e07bf3a648e1b91723c95735
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Tue Apr 6 10:29:28 2021 -0400
zink: add better TODO note for surface swizzles
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12529>
---
src/gallium/drivers/zink/zink_surface.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c
index b3fe21ad8c1..7117f5f540e 100644
--- a/src/gallium/drivers/zink/zink_surface.c
+++ b/src/gallium/drivers/zink/zink_surface.c
@@ -78,7 +78,14 @@ create_ivci(struct zink_screen *screen,
ivci.format = zink_get_format(screen, templ->format);
assert(ivci.format != VK_FORMAT_UNDEFINED);
- // TODO: format swizzles
+ /* TODO: it's currently illegal to use non-identity swizzles for framebuffer attachments,
+ * but if that ever changes, this will be useful
+ const struct util_format_description *desc = util_format_description(templ->format);
+ ivci.components.r = zink_component_mapping(zink_clamp_void_swizzle(desc, PIPE_SWIZZLE_X));
+ ivci.components.g = zink_component_mapping(zink_clamp_void_swizzle(desc, PIPE_SWIZZLE_Y));
+ ivci.components.b = zink_component_mapping(zink_clamp_void_swizzle(desc, PIPE_SWIZZLE_Z));
+ ivci.components.a = zink_component_mapping(zink_clamp_void_swizzle(desc, PIPE_SWIZZLE_W));
+ */
ivci.components.r = VK_COMPONENT_SWIZZLE_R;
ivci.components.g = VK_COMPONENT_SWIZZLE_G;
ivci.components.b = VK_COMPONENT_SWIZZLE_B;
More information about the mesa-commit
mailing list