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

Author: Eric Anholt <[email protected]>
Date:   Tue Jul  3 15:52:59 2018 -0700

v3d: Respect swap_color_rb for the f32_color_rb case.

We don't actually set the two flags together, but I want to use the
r/g/b/a reordered fields in the next commit.

---

 src/broadcom/compiler/nir_to_vir.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/broadcom/compiler/nir_to_vir.c 
b/src/broadcom/compiler/nir_to_vir.c
index 267d61a25a..8012d483a7 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -1031,14 +1031,16 @@ emit_frag_end(struct v3d_compile *c)
                         }
 
                         if (c->fs_key->f32_color_rb & (1 << rt)) {
-                                inst = vir_MOV_dest(c, vir_reg(QFILE_TLBU, 0), 
color[0]);
+                                inst = vir_MOV_dest(c, vir_reg(QFILE_TLBU, 0), 
r);
                                 inst->src[vir_get_implicit_uniform_src(inst)] =
                                         vir_uniform_ui(c, conf);
 
-                                for (int i = 1; i < num_components; i++) {
-                                        inst = vir_MOV_dest(c, 
vir_reg(QFILE_TLB, 0),
-                                                            color[i]);
-                                }
+                                if (num_components >= 2)
+                                        vir_MOV_dest(c, vir_reg(QFILE_TLB, 0), 
g);
+                                if (num_components >= 3)
+                                        vir_MOV_dest(c, vir_reg(QFILE_TLB, 0), 
b);
+                                if (num_components >= 4)
+                                        vir_MOV_dest(c, vir_reg(QFILE_TLB, 0), 
a);
                         } else {
                                 inst = vir_VFPACK_dest(c, vir_reg(QFILE_TLB, 
0), r, g);
                                 if (conf != ~0) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to