Mesa (main): midgard: Handle FB fetch from non-vec4 output variables.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 11 15:40:22 UTC 2022


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

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Mon May  9 15:24:46 2022 -0500

midgard: Handle FB fetch from non-vec4 output variables.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16309>

---

 src/panfrost/util/pan_lower_framebuffer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/util/pan_lower_framebuffer.c b/src/panfrost/util/pan_lower_framebuffer.c
index 7f0de066eec..80a88f636ae 100644
--- a/src/panfrost/util/pan_lower_framebuffer.c
+++ b/src/panfrost/util/pan_lower_framebuffer.c
@@ -489,7 +489,9 @@ pan_lower_fb_store(nir_shader *shader,
                 bool reorder_comps)
 {
         /* For stores, add conversion before */
-        nir_ssa_def *unpacked = nir_ssa_for_src(b, intr->src[1], 4);
+        nir_ssa_def *unpacked =
+                nir_ssa_for_src(b, intr->src[1], intr->num_components);
+        unpacked = nir_pad_vec4(b, unpacked);
 
         /* Re-order the components */
         if (reorder_comps)
@@ -539,7 +541,7 @@ pan_lower_fb_load(nir_shader *shader,
                         pan_unpacked_type_for_format(desc));
 
         unpacked = nir_convert_to_bit_size(b, unpacked, src_type, bits);
-        unpacked = nir_pad_vector(b, unpacked, nir_dest_num_components(intr->dest));
+        unpacked = nir_resize_vector(b, unpacked, intr->dest.ssa.num_components);
 
         /* Reorder the components */
         if (reorder_comps)



More information about the mesa-commit mailing list