[Mesa-dev] [PATCH 03/13] radeonsi: get fs_write_all from tgsi_shader_info directly

Marek Olšák maraeo at gmail.com
Tue Sep 30 09:46:42 PDT 2014


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_shader.c | 8 ++------
 src/gallium/drivers/radeonsi/si_shader.h | 6 ------
 src/gallium/drivers/radeonsi/si_state.c  | 5 +----
 3 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 5c3efd4..e76b969 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1438,11 +1438,6 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base)
 
 		tgsi_parse_token(parse);
 
-		if (parse->FullToken.Token.Type == TGSI_TOKEN_TYPE_PROPERTY &&
-		    parse->FullToken.FullProperty.Property.PropertyName ==
-		    TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS)
-			shader->fs_write_all = TRUE;
-
 		if (parse->FullToken.Token.Type != TGSI_TOKEN_TYPE_DECLARATION)
 			continue;
 
@@ -1499,7 +1494,8 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base)
 				memcpy(last_args, args, sizeof(args));
 
 				/* Handle FS_COLOR0_WRITES_ALL_CBUFS. */
-				if (shader->fs_write_all && shader->output[i].sid == 0 &&
+				if (shader->selector->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0] &&
+                                    shader->output[i].sid == 0 &&
 				    si_shader_ctx->shader->key.ps.nr_cbufs > 1) {
 					for (int c = 1; c < si_shader_ctx->shader->key.ps.nr_cbufs; c++) {
 						si_llvm_init_export_args_load(bld_base,
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index 8f5b431..c6026bd 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -124,11 +124,6 @@ struct si_shader_selector {
 
 	/* PIPE_SHADER_[VERTEX|FRAGMENT|...] */
 	unsigned	type;
-
-	/* 1 when the shader contains
-	 * TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS, otherwise it's 0.
-	 * Used to determine whether we need to include nr_cbufs in the key */
-	unsigned	fs_write_all;
 };
 
 union si_shader_key {
@@ -184,7 +179,6 @@ struct si_shader {
 
 	unsigned		nparam;
 	bool			uses_instanceid;
-	bool			fs_write_all;
 	bool			vs_out_misc_write;
 	bool			vs_out_point_size;
 	bool			vs_out_edgeflag;
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 0e2d6c4..eb25606 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2215,7 +2215,7 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx,
 			key->vs.gs_used_inputs = sctx->gs_shader->current->gs_used_inputs;
 		}
 	} else if (sel->type == PIPE_SHADER_FRAGMENT) {
-		if (sel->fs_write_all)
+		if (sel->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0])
 			key->ps.nr_cbufs = sctx->framebuffer.state.nr_cbufs;
 		key->ps.export_16bpc = sctx->framebuffer.export_16bpc;
 
@@ -2312,9 +2312,6 @@ static void *si_create_shader_state(struct pipe_context *ctx,
 	sel->so = state->stream_output;
 	tgsi_scan_shader(state->tokens, &sel->info);
 
-	if (pipe_shader_type == PIPE_SHADER_FRAGMENT)
-		sel->fs_write_all = sel->info.color0_writes_all_cbufs;
-
 	r = si_shader_select(ctx, sel);
 	if (r) {
 	    free(sel);
-- 
1.9.1



More information about the mesa-dev mailing list