r300g: if no DS buffer is set, disable reading from and writing to it

It fixes another "Bad CS" issue.
This commit is contained in:
Marek Olšák
2009-12-24 14:23:57 +01:00
committed by Corbin Simpson
parent 26f67a272b
commit 1a4f242be6
2 changed files with 10 additions and 2 deletions

View File

@@ -121,8 +121,15 @@ void r300_emit_dsa_state(struct r300_context* r300,
}*/ }*/
OUT_CS_REG_SEQ(R300_ZB_CNTL, 3); OUT_CS_REG_SEQ(R300_ZB_CNTL, 3);
OUT_CS(dsa->z_buffer_control);
OUT_CS(dsa->z_stencil_control); if (r300->framebuffer_state.zsbuf) {
OUT_CS(dsa->z_buffer_control);
OUT_CS(dsa->z_stencil_control);
} else {
OUT_CS(0);
OUT_CS(0);
}
OUT_CS(dsa->stencil_ref_mask); OUT_CS(dsa->stencil_ref_mask);
OUT_CS_REG(R300_ZB_ZTOP, r300->ztop_state.z_buffer_top); OUT_CS_REG(R300_ZB_ZTOP, r300->ztop_state.z_buffer_top);

View File

@@ -522,6 +522,7 @@ static void
} }
r300->dirty_state |= R300_NEW_FRAMEBUFFERS; r300->dirty_state |= R300_NEW_FRAMEBUFFERS;
r300->dirty_state |= R300_NEW_BLEND; r300->dirty_state |= R300_NEW_BLEND;
r300->dirty_state |= R300_NEW_DSA;
} }
/* Create fragment shader state. */ /* Create fragment shader state. */