Mesa (main): zink: fix xfb array inlining

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 15 17:48:35 UTC 2022


Module: Mesa
Branch: main
Commit: 52452905658e7282a8707cdb230fe0b51dac4389
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=52452905658e7282a8707cdb230fe0b51dac4389

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Jul  8 09:14:25 2022 -0400

zink: fix xfb array inlining

get_slot_components() returns the total number of output components
for arrays for initial evaluation phase, but during the packed->inlined
conversion the arrayed size must be normalized to the slot's component count
in order to effectively catch and inline the array

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17404>

---

 src/gallium/drivers/zink/zink_compiler.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 7284b9003d6..1ae03ab3c07 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -923,6 +923,8 @@ update_so_info(struct zink_shader *zs, const struct pipe_stream_output_info *so_
 
             /* if all the components the variable exports to this slot aren't captured, skip consolidation */
             unsigned num_components = get_slot_components(var, slot, var->data.location);
+            if (glsl_type_is_array(var->type) && !glsl_type_is_struct_or_ifc(glsl_without_array(var->type)))
+               num_components /= glsl_array_size(var->type);
             if (num_components != packed_components[slot])
                goto out;
 



More information about the mesa-commit mailing list