r300: Various flags, small state tracking things.
Getting these out of the way so more stuff can be put in.
This commit is contained in:
parent
7961974fc2
commit
2e09845277
|
@ -56,5 +56,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
|
|||
|
||||
r300_init_state_functions(r300);
|
||||
|
||||
r300->dirty_state = R300_NEW_KITCHEN_SINK;
|
||||
r300->dirty_hw++;
|
||||
|
||||
return &r300->context;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ struct r300_dsa_state {
|
|||
};
|
||||
|
||||
struct r300_rs_state {
|
||||
uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */
|
||||
uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
|
||||
uint32_t depth_offset_front; /* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */
|
||||
uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */
|
||||
|
@ -98,6 +99,8 @@ struct r300_context {
|
|||
|
||||
/* Bitmask of dirty state objects. */
|
||||
uint32_t dirty_state;
|
||||
/* Flag indicating whether or not the HW is dirty. */
|
||||
uint32_t dirty_hw;
|
||||
};
|
||||
|
||||
/* Convenience cast wrapper. */
|
||||
|
|
|
@ -31,6 +31,10 @@ static void r300_emit_dirty_state(struct r300_context* r300)
|
|||
struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen;
|
||||
CS_LOCALS(r300);
|
||||
|
||||
if (!(r300->dirty_state) && !(r300->dirty_hw)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* XXX check size */
|
||||
|
||||
if (r300->dirty_state & R300_NEW_BLEND) {
|
||||
|
@ -72,6 +76,7 @@ static void r300_emit_dirty_state(struct r300_context* r300)
|
|||
|
||||
if (r300->dirty_state & R300_NEW_RS) {
|
||||
struct r300_rs_state* rs = r300->rs_state;
|
||||
OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
|
||||
/* XXX next six are contiguous regs */
|
||||
OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, rs->depth_scale_front);
|
||||
OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, rs->depth_offset_front);
|
||||
|
|
|
@ -123,7 +123,6 @@ static void* r300_surface_map(struct pipe_screen* screen,
|
|||
struct pipe_surface* surface,
|
||||
unsigned flags)
|
||||
{
|
||||
/* XXX this is not quite right */
|
||||
char* map = pipe_buffer_map(screen, surface->buffer, flags);
|
||||
|
||||
if (!map) {
|
||||
|
|
|
@ -434,6 +434,10 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
|
|||
pack_float_32(state->offset_scale);
|
||||
}
|
||||
|
||||
/* XXX this is part of HW TCL */
|
||||
/* XXX endian control */
|
||||
rs->vap_control_status = R300_VAP_TCL_BYPASS;
|
||||
|
||||
return (void*)rs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue