Mesa (master): r600g: honour semantic index in fragment color exports

Marek Olšák mareko at kemper.freedesktop.org
Fri Aug 2 12:38:27 UTC 2013


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Thu Aug  1 20:56:21 2013 +0200

r600g: honour semantic index in fragment color exports

Signed-off-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/drivers/r600/r600_shader.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index dc44fae..37298cc 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -917,7 +917,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
 	unsigned output_done, noutput;
 	unsigned opcode;
 	int i, j, k, r = 0;
-	int next_pixel_base = 0, next_pos_base = 60, next_param_base = 0;
+	int next_pos_base = 60, next_param_base = 0;
 	/* Declarations used by llvm code */
 	bool use_llvm = false;
 	bool indirect_gprs;
@@ -1440,13 +1440,13 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
 		case TGSI_PROCESSOR_FRAGMENT:
 			if (shader->output[i].name == TGSI_SEMANTIC_COLOR) {
 				/* never export more colors than the number of CBs */
-				if (next_pixel_base && next_pixel_base >= key.nr_cbufs) {
+				if (shader->output[i].sid >= key.nr_cbufs) {
 					/* skip export */
 					j--;
 					continue;
 				}
 				output[j].swizzle_w = key.alpha_to_one ? 5 : 3;
-				output[j].array_base = next_pixel_base++;
+				output[j].array_base = shader->output[i].sid;
 				output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL;
 				shader->nr_ps_color_exports++;
 				if (shader->fs_write_all && (rscreen->chip_class >= EVERGREEN)) {
@@ -1461,7 +1461,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
 						output[j].swizzle_w = key.alpha_to_one ? 5 : 3;
 						output[j].burst_count = 1;
 						output[j].barrier = 1;
-						output[j].array_base = next_pixel_base++;
+						output[j].array_base = k;
 						output[j].op = CF_OP_EXPORT;
 						output[j].type = V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL;
 						shader->nr_ps_color_exports++;
@@ -1532,7 +1532,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen,
 	}
 
 	/* add fake pixel export */
-	if (ctx.type == TGSI_PROCESSOR_FRAGMENT && next_pixel_base == 0) {
+	if (ctx.type == TGSI_PROCESSOR_FRAGMENT && shader->nr_ps_color_exports == 0) {
 		memset(&output[j], 0, sizeof(struct r600_bytecode_output));
 		output[j].gpr = 0;
 		output[j].elem_size = 3;




More information about the mesa-commit mailing list