r600g: fix the CB_SHADER_MASK setup
authorMarek Olšák <marek.olsak@amd.com>
Sun, 2 Aug 2015 13:18:36 +0000 (15:18 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 2 Aug 2015 22:18:41 +0000 (00:18 +0200)
This fixes the single-sample fast clear hang.

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_shader.c

index 5c8fd0d2d35e13f61794c1484817a9e8f56aa9c1..13ecc46959f797b41bfba1f6547c1f0cb436d6a1 100644 (file)
@@ -1736,10 +1736,10 @@ static void evergreen_emit_cb_misc_state(struct r600_context *rctx, struct r600_
 
        r600_write_context_reg_seq(cs, R_028238_CB_TARGET_MASK, 2);
        radeon_emit(cs, a->blend_colormask & fb_colormask); /* R_028238_CB_TARGET_MASK */
-       /* Always enable the first colorbuffer in CB_SHADER_MASK. This
-        * will assure that the alpha-test will work even if there is
-        * no colorbuffer bound. */
-       radeon_emit(cs, 0xf | (a->dual_src_blend ? ps_colormask : 0) | fb_colormask); /* R_02823C_CB_SHADER_MASK */
+       /* This must match the used export instructions exactly.
+        * Other values may lead to undefined behavior and hangs.
+        */
+       radeon_emit(cs, ps_colormask); /* R_02823C_CB_SHADER_MASK */
 }
 
 static void evergreen_emit_db_state(struct r600_context *rctx, struct r600_atom *atom)
index 09f50f5d810ba12a253b00643550d47ff0445bbb..8d1f95abddc8ccd7fa4b067a3ae19bb9226c90a0 100644 (file)
@@ -2490,6 +2490,7 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
                        output[j].array_base = 0;
                        output[j].op = CF_OP_EXPORT;
                        j++;
+                       shader->nr_ps_color_exports++;
                }
 
                noutput = j;