r600g: initialize DB_DEPTH_CONTROL at beginning of CS
authorMarek Olšák <maraeo@gmail.com>
Mon, 27 Feb 2012 13:34:52 +0000 (14:34 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 5 Mar 2012 13:22:25 +0000 (14:22 +0100)
Otherwise streamout with rasterizer discard will make the kernel upset
if the state tracker doesn't set a depth-stencil-alpha state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index 603b57973960e16ca28027211ccf46b2f13513c3..5d0fabca550ceb4946480596cf968239a09cfff7 100644 (file)
@@ -1956,6 +1956,7 @@ static void cayman_init_atom_start_cs(struct r600_context *rctx)
        r600_store_context_reg(cb, R_0288A8_SQ_PGM_RESOURCES_FS, 0);
 
        r600_store_context_reg(cb, R_028354_SX_SURFACE_SYNC, S_028354_SURFACE_SYNC_MASK(0xf));
+       r600_store_context_reg(cb, R_028800_DB_DEPTH_CONTROL, 0);
 
        eg_store_loop_const(cb, R_03A200_SQ_LOOP_CONST_0, 0x01000FFF);
        eg_store_loop_const(cb, R_03A200_SQ_LOOP_CONST_0 + (32 * 4), 0x01000FFF);
@@ -2438,6 +2439,7 @@ void evergreen_init_atom_start_cs(struct r600_context *rctx)
        r600_store_context_reg(cb, R_0288A8_SQ_PGM_RESOURCES_FS, 0);
 
        r600_store_context_reg(cb, R_028354_SX_SURFACE_SYNC, S_028354_SURFACE_SYNC_MASK(0xf));
+       r600_store_context_reg(cb, R_028800_DB_DEPTH_CONTROL, 0);
 
        eg_store_loop_const(cb, R_03A200_SQ_LOOP_CONST_0, 0x01000FFF);
        eg_store_loop_const(cb, R_03A200_SQ_LOOP_CONST_0 + (32 * 4), 0x01000FFF);
index bdecf7f8f94d38738533aa77b50eb8eb53199819..9b1dd3cee5e85127f46e19ebf8ecebd785cc5f0c 100644 (file)
@@ -2142,6 +2142,7 @@ void r600_init_atom_start_cs(struct r600_context *rctx)
 
        if (rctx->chip_class == R700)
                r600_store_context_reg(cb, R_028354_SX_SURFACE_SYNC, S_028354_SURFACE_SYNC_MASK(0xf));
+       r600_store_context_reg(cb, R_028800_DB_DEPTH_CONTROL, 0);
 
        r600_store_loop_const(cb, R_03E200_SQ_LOOP_CONST_0, 0x1000FFF);
        r600_store_loop_const(cb, R_03E200_SQ_LOOP_CONST_0 + (32 * 4), 0x1000FFF);