[Mesa-dev] [PATCH 1/3] r600g: set ENABLE_KILL in the shader state in the new design

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sat Sep 25 07:11:40 PDT 2010


---
 src/gallium/drivers/r600/r600_state2.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_state2.c b/src/gallium/drivers/r600/r600_state2.c
index 40038f0..c375c54 100644
--- a/src/gallium/drivers/r600/r600_state2.c
+++ b/src/gallium/drivers/r600/r600_state2.c
@@ -109,7 +109,7 @@ static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shade
 	struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
 	struct r600_pipe_state *rstate = &shader->rstate;
 	struct r600_shader *rshader = &shader->shader;
-	unsigned i, tmp, exports_ps, num_cout, spi_ps_in_control_0, spi_input_z;
+	unsigned i, tmp, exports_ps, num_cout, spi_ps_in_control_0, spi_input_z,db_shader_control;
 	boolean have_pos = FALSE, have_face = FALSE;
 
 	/* clear previous register */
@@ -173,6 +173,13 @@ static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shade
 	r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT,
 				R_0288CC_SQ_PGM_CF_OFFSET_PS,
 				0x00000000, 0xFFFFFFFF, NULL);
+	
+	db_shader_control = 0;
+	if (rshader->uses_kill)
+		db_shader_control |= S_02880C_KILL_ENABLE(1);
+
+	/* only set some bits here, the other bits are set in the dsa state */
+	r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT, R_02880C_DB_SHADER_CONTROL, db_shader_control, 0x00000041, NULL);
 }
 
 static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *shader)
-- 
1.7.1



More information about the mesa-dev mailing list