broadcom/vc5: Fix tile load/store of MSAA surfaces on 4.x.
authorEric Anholt <eric@anholt.net>
Tue, 24 Apr 2018 20:22:41 +0000 (13:22 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 25 Apr 2018 16:21:54 +0000 (09:21 -0700)
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
src/broadcom/cle/v3d_packet_v42.xml
src/gallium/drivers/vc5/vc5_rcl.c

index 32934d71cdaa134345df60d3c3bea96c679a790f..5f6d643195a16c546efdf0c55a80ece02689b6ed 100644 (file)
     <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"/>
 
     <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"/>
 
index db128b5451816b35fdbe201f9b8dbf4925a32ae7..f180e5eec5e81e9fa7987bba2d89175a77ccaa66 100644 (file)
     <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"/>
 
     <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"/>
 
index 2b1309bc1a916a715b18d50a2d31010336e5aff7..328922751304ecc704bf02cf811379bfe40239e4 100644 (file)
@@ -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.