radeonsi: support per-sample gl_FragCoord
authorMarek Olšák <marek.olsak@amd.com>
Mon, 17 Nov 2014 19:49:11 +0000 (20:49 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 18 Nov 2014 13:27:54 +0000 (14:27 +0100)
Cc: 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index d5b27e7e3a6f2fc741812fb20e8d62581ab1a87d..f10828271112c776a55d0b26037f05e041ace709 100644 (file)
@@ -248,20 +248,21 @@ static void si_shader_ps(struct si_shader *shader)
        for (i = 0; i < info->num_inputs; i++) {
                switch (info->input_semantic_name[i]) {
                case TGSI_SEMANTIC_POSITION:
-                       if (info->input_interpolate_loc[i] ==
-                           TGSI_INTERPOLATE_LOC_CENTROID) {
-                               /* SPI_BARYC_CNTL.POS_FLOAT_LOCATION
-                                * Possible vaules:
-                                * 0 -> Position = pixel center (default)
-                                * 1 -> Position = pixel centroid
-                                * 2 -> Position = iterated sample number XXX:
-                                *                        What does this mean?
-                                */
+                       /* SPI_BARYC_CNTL.POS_FLOAT_LOCATION
+                        * Possible vaules:
+                        * 0 -> Position = pixel center (default)
+                        * 1 -> Position = pixel centroid
+                        * 2 -> Position = at sample position
+                        */
+                       switch (info->input_interpolate_loc[i]) {
+                       case TGSI_INTERPOLATE_LOC_CENTROID:
                                spi_baryc_cntl |= S_0286E0_POS_FLOAT_LOCATION(1);
+                               break;
+                       case TGSI_INTERPOLATE_LOC_SAMPLE:
+                               spi_baryc_cntl |= S_0286E0_POS_FLOAT_LOCATION(2);
+                               break;
                        }
-                       /* Fall through */
-               case TGSI_SEMANTIC_FACE:
-                       continue;
+                       break;
                }
        }