r600g: Fix the DB_SHADER_CONTROL mask in create_ds_state().
authorHenri Verbeet <hverbeet@gmail.com>
Mon, 14 Mar 2011 21:07:44 +0000 (22:07 +0100)
committerHenri Verbeet <hverbeet@gmail.com>
Mon, 14 Mar 2011 21:15:56 +0000 (22:15 +0100)
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index e770b17225e6bd23d1ea6204e51c27bf00bbcb85..fedca3baad5820cb8de7794b5b868b7d603bb30d 100644 (file)
@@ -150,10 +150,6 @@ static void *evergreen_create_dsa_state(struct pipe_context *ctx,
 
        rstate->id = R600_PIPE_STATE_DSA;
        /* depth TODO some of those db_shader_control field depend on shader adjust mask & add it to shader */
-       /* db_shader_control is 0xFFFFFFBE as Z_EXPORT_ENABLE (bit 0) will be
-        * set by fragment shader if it export Z and KILL_ENABLE (bit 6) will
-        * be set if shader use texkill instruction
-        */
        db_shader_control = S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z);
        stencil_ref_mask = 0;
        stencil_ref_mask_bf = 0;
@@ -210,7 +206,10 @@ static void *evergreen_create_dsa_state(struct pipe_context *ctx,
        r600_pipe_state_add_reg(rstate, R_028438_SX_ALPHA_REF, alpha_ref, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_0286DC_SPI_FOG_CNTL, 0x00000000, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_028800_DB_DEPTH_CONTROL, db_depth_control, 0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate, R_02880C_DB_SHADER_CONTROL, db_shader_control, 0xFFFFFFBE, NULL);
+       /* The DB_SHADER_CONTROL mask is 0xFFFFFFBC since Z_EXPORT_ENABLE,
+        * STENCIL_EXPORT_ENABLE and KILL_ENABLE are controlled by
+        * evergreen_pipe_shader_ps().*/
+       r600_pipe_state_add_reg(rstate, R_02880C_DB_SHADER_CONTROL, db_shader_control, 0xFFFFFFBC, NULL);
        r600_pipe_state_add_reg(rstate, R_028000_DB_RENDER_CONTROL, db_render_control, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_02800C_DB_RENDER_OVERRIDE, db_render_override, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_028AC0_DB_SRESULTS_COMPARE_STATE0, 0x0, 0xFFFFFFFF, NULL);
index f1e21bceaddafa1ddd48972e0a0ea8f85c61031e..2afa37443fd26122ff228f05f877147c611bdd95 100644 (file)
@@ -200,10 +200,6 @@ static void *r600_create_dsa_state(struct pipe_context *ctx,
 
        rstate->id = R600_PIPE_STATE_DSA;
        /* depth TODO some of those db_shader_control field depend on shader adjust mask & add it to shader */
-       /* db_shader_control is 0xFFFFFFBE as Z_EXPORT_ENABLE (bit 0) will be
-        * set by fragment shader if it export Z and KILL_ENABLE (bit 6) will
-        * be set if shader use texkill instruction
-        */
        db_shader_control = S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z);
        stencil_ref_mask = 0;
        stencil_ref_mask_bf = 0;
@@ -262,7 +258,10 @@ static void *r600_create_dsa_state(struct pipe_context *ctx,
        r600_pipe_state_add_reg(rstate, R_0286E4_SPI_FOG_FUNC_BIAS, 0x00000000, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_0286DC_SPI_FOG_CNTL, 0x00000000, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_028800_DB_DEPTH_CONTROL, db_depth_control, 0xFFFFFFFF, NULL);
-       r600_pipe_state_add_reg(rstate, R_02880C_DB_SHADER_CONTROL, db_shader_control, 0xFFFFFFBE, NULL);
+       /* The DB_SHADER_CONTROL mask is 0xFFFFFFBC since Z_EXPORT_ENABLE,
+        * STENCIL_EXPORT_ENABLE and KILL_ENABLE are controlled by
+        * r600_pipe_shader_ps().*/
+       r600_pipe_state_add_reg(rstate, R_02880C_DB_SHADER_CONTROL, db_shader_control, 0xFFFFFFBC, NULL);
        r600_pipe_state_add_reg(rstate, R_028D0C_DB_RENDER_CONTROL, db_render_control, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_028D10_DB_RENDER_OVERRIDE, db_render_override, 0xFFFFFFFF, NULL);
        r600_pipe_state_add_reg(rstate, R_028D2C_DB_SRESULTS_COMPARE_STATE1, 0x00000000, 0xFFFFFFFF, NULL);