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

Author: Eric Anholt <e...@anholt.net>
Date:   Tue Apr 24 13:22:41 2018 -0700

broadcom/vc5: Fix tile load/store of MSAA surfaces on 4.x.

For single-sample we have to always program SAMPLE_0, but for multisample
we want to store all the samples.

---

 src/broadcom/cle/v3d_packet_v41.xml |  4 ++--
 src/broadcom/cle/v3d_packet_v42.xml |  4 ++--
 src/gallium/drivers/vc5/vc5_rcl.c   | 12 +++++++++++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/broadcom/cle/v3d_packet_v41.xml 
b/src/broadcom/cle/v3d_packet_v41.xml
index 32934d71cd..5f6d643195 100644
--- a/src/broadcom/cle/v3d_packet_v41.xml
+++ b/src/broadcom/cle/v3d_packet_v41.xml
@@ -277,7 +277,7 @@
     <field name="Clear buffer being stored" size="1" start="18" type="bool"/>
     <field name="Output Image Format" size="6" start="12" type="Output Image 
Format"/>
 
-    <field name="Decimate" size="2" start="10" type="Decimate Mode"/>
+    <field name="Decimate mode" size="2" start="10" type="Decimate Mode"/>
 
     <field name="A dithered" size="1" start="9" type="bool"/>
     <field name="BGR dithered" size="1" start="8" type="bool"/>
@@ -311,7 +311,7 @@
 
     <field name="Input Image Format" size="6" start="12" type="Output Image 
Format"/>
 
-    <field name="Decimate" size="2" start="10" type="Decimate Mode"/>
+    <field name="Decimate mode" size="2" start="10" type="Decimate Mode"/>
 
     <field name="Flip Y" size="1" start="7" type="bool"/>
 
diff --git a/src/broadcom/cle/v3d_packet_v42.xml 
b/src/broadcom/cle/v3d_packet_v42.xml
index db128b5451..f180e5eec5 100644
--- a/src/broadcom/cle/v3d_packet_v42.xml
+++ b/src/broadcom/cle/v3d_packet_v42.xml
@@ -278,7 +278,7 @@
     <field name="Clear buffer being stored" size="1" start="18" type="bool"/>
     <field name="Output Image Format" size="6" start="12" type="Output Image 
Format"/>
 
-    <field name="Decimate" size="2" start="10" type="Decimate Mode"/>
+    <field name="Decimate mode" size="2" start="10" type="Decimate Mode"/>
 
     <field name="A dithered" size="1" start="9" type="bool"/>
     <field name="BGR dithered" size="1" start="8" type="bool"/>
@@ -312,7 +312,7 @@
 
     <field name="Input Image Format" size="6" start="12" type="Output Image 
Format"/>
 
-    <field name="Decimate" size="2" start="10" type="Decimate Mode"/>
+    <field name="Decimate mode" size="2" start="10" type="Decimate Mode"/>
 
     <field name="Flip Y" size="1" start="7" type="bool"/>
 
diff --git a/src/gallium/drivers/vc5/vc5_rcl.c 
b/src/gallium/drivers/vc5/vc5_rcl.c
index 2b1309bc1a..3289227513 100644
--- a/src/gallium/drivers/vc5/vc5_rcl.c
+++ b/src/gallium/drivers/vc5/vc5_rcl.c
@@ -85,7 +85,11 @@ load_general(struct vc5_cl *cl, struct pipe_surface *psurf, 
int buffer,
                         load.height_in_ub_or_stride = slice->stride;
                 }
 
-                /* XXX: MSAA */
+                if (psurf->texture->nr_samples > 1)
+                        load.decimate_mode = V3D_DECIMATE_MODE_ALL_SAMPLES;
+                else
+                        load.decimate_mode = V3D_DECIMATE_MODE_SAMPLE_0;
+
 #else /* V3D_VERSION < 40 */
                 /* Can't do raw ZSTENCIL loads -- need to load/store them to
                  * separate buffers for Z and stencil.
@@ -147,6 +151,12 @@ store_general(struct vc5_job *job,
                                 &rsc->slices[psurf->u.tex.level];
                         store.height_in_ub_or_stride = slice->stride;
                 }
+
+                if (psurf->texture->nr_samples > 1)
+                        store.decimate_mode = V3D_DECIMATE_MODE_ALL_SAMPLES;
+                else
+                        store.decimate_mode = V3D_DECIMATE_MODE_SAMPLE_0;
+
 #else /* V3D_VERSION < 40 */
                 /* Can't do raw ZSTENCIL stores -- need to load/store them to
                  * separate buffers for Z and stencil.

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to