It may seem pointless, but this avoids a fair amount of predicted CSO pain.
uint32_t z_buffer_control; /* R300_ZB_CNTL: 0x4f00 */
uint32_t z_stencil_control; /* R300_ZB_ZSTENCILCNTL: 0x4f04 */
uint32_t stencil_ref_mask; /* R300_ZB_STENCILREFMASK: 0x4f08 */
- uint32_t z_buffer_top; /* R300_ZB_ZTOP: 0x4f14 */
uint32_t stencil_ref_bf; /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */
};
uint32_t vte_control; /* R300_VAP_VTE_CNTL: 0x20b0 */
};
+struct r300_ztop_state {
+ uint32_t z_buffer_top; /* R300_ZB_ZTOP: 0x4f14 */
+};
+
#define R300_NEW_BLEND 0x00000001
#define R300_NEW_BLEND_COLOR 0x00000002
#define R300_NEW_CLIP 0x00000004
struct r300_vertex_shader* vs;
/* Viewport state. */
struct r300_viewport_state* viewport_state;
+ /* ZTOP state. */
+ struct r300_ztop_state ztop_state;
+
/* Bitmask of dirty state objects. */
uint32_t dirty_state;
/* Flag indicating whether or not the HW is dirty. */
OUT_CS(dsa->z_buffer_control);
OUT_CS(dsa->z_stencil_control);
OUT_CS(dsa->stencil_ref_mask);
- OUT_CS_REG(R300_ZB_ZTOP, dsa->z_buffer_top);
+ OUT_CS_REG(R300_ZB_ZTOP, r300->ztop_state.z_buffer_top);
if (r300screen->caps->is_r500) {
/* OUT_CS_REG(R500_ZB_STENCILREFMASK_BF, dsa->stencil_ref_bf); */
}
static void r300_update_ztop(struct r300_context* r300)
{
- r300->dsa_state->z_buffer_top = R300_ZTOP_ENABLE;
+ r300->ztop_state.z_buffer_top = R300_ZTOP_ENABLE;
/* This is important enough that I felt it warranted a comment.
*
* ~C.
*/
if (r300->dsa_state->alpha_function) {
- r300->dsa_state->z_buffer_top = R300_ZTOP_DISABLE;
+ r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE;
} else if (r300_fragment_shader_writes_depth(r300->fs)) {
- r300->dsa_state->z_buffer_top = R300_ZTOP_DISABLE;
+ r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE;
} else if (r300->query_current) {
- r300->dsa_state->z_buffer_top = R300_ZTOP_DISABLE;
+ r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE;
}
}
.z_buffer_control = 0x0,
.z_stencil_control = 0x0,
.stencil_ref_mask = R300_STENCILWRITEMASK_MASK,
- .z_buffer_top = R300_ZTOP_ENABLE,
.stencil_ref_bf = 0x0,
};