r600g: only set the Z export if shader exports it.
authorDave Airlie <airlied@redhat.com>
Fri, 1 Oct 2010 05:16:47 +0000 (15:16 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 1 Oct 2010 06:06:30 +0000 (16:06 +1000)
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_shader.c

index 2f5f1bff28eae27c8b50a6c7ad3495bb76c1cad8..4fa94e31e71c95a1c41bb68a55277ebc61776741 100644 (file)
@@ -1531,10 +1531,11 @@ void evergreen_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader
                r600_pipe_state_add_reg(rstate, R_028644_SPI_PS_INPUT_CNTL_0 + i * 4, tmp, 0xFFFFFFFF, NULL);
        }
        for (i = 0; i < rshader->noutput; i++) {
-               r600_pipe_state_add_reg(rstate,
-                               R_02880C_DB_SHADER_CONTROL,
-                               S_02880C_Z_EXPORT_ENABLE(1),
-                               S_02880C_Z_EXPORT_ENABLE(1), NULL);
+               if (rshader->input[i].name == TGSI_SEMANTIC_POSITION)
+                       r600_pipe_state_add_reg(rstate,
+                                               R_02880C_DB_SHADER_CONTROL,
+                                               S_02880C_Z_EXPORT_ENABLE(1),
+                                               S_02880C_Z_EXPORT_ENABLE(1), NULL);
        }
 
        exports_ps = 0;
index d35a99085dc1eac585a22dfd37de3082a1ebcc2d..66cc035e7d97e935205f739c65f61ce69ab371e0 100644 (file)
@@ -127,10 +127,11 @@ static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shade
                r600_pipe_state_add_reg(rstate, R_028644_SPI_PS_INPUT_CNTL_0 + i * 4, tmp, 0xFFFFFFFF, NULL);
        }
        for (i = 0; i < rshader->noutput; i++) {
-               r600_pipe_state_add_reg(rstate,
-                               R_02880C_DB_SHADER_CONTROL,
-                               S_02880C_Z_EXPORT_ENABLE(1),
-                               S_02880C_Z_EXPORT_ENABLE(1), NULL);
+               if (rshader->input[i].name == TGSI_SEMANTIC_POSITION)
+                       r600_pipe_state_add_reg(rstate,
+                                               R_02880C_DB_SHADER_CONTROL,
+                                               S_02880C_Z_EXPORT_ENABLE(1),
+                                               S_02880C_Z_EXPORT_ENABLE(1), NULL);
        }
 
        exports_ps = 0;