Mesa (master): radeonsi: support per-sample gl_FragCoord

Marek Olšák mareko at kemper.freedesktop.org
Tue Nov 18 13:33:03 UTC 2014


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon Nov 17 20:49:11 2014 +0100

radeonsi: support per-sample gl_FragCoord

Cc: 10.4 <mesa-stable at lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/gallium/drivers/radeonsi/si_state_draw.c |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index d5b27e7..f108282 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -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;
 		}
 	}
 




More information about the mesa-commit mailing list