r300g: atomize beginning occlusion query

This commit is contained in:
Marek Olšák 2010-04-14 04:22:22 +02:00
parent 3da70606b3
commit eb4e399ef0
7 changed files with 8 additions and 17 deletions

View file

@ -101,6 +101,7 @@ static void r300_setup_atoms(struct r300_context* r300)
* the size of 0 here. */
make_empty_list(&r300->atom_list);
R300_INIT_ATOM(invariant_state, 71);
R300_INIT_ATOM(query_start, 4);
R300_INIT_ATOM(ztop_state, 2);
R300_INIT_ATOM(blend_state, 8);
R300_INIT_ATOM(blend_color_state, is_r500 ? 3 : 2);

View file

@ -372,6 +372,8 @@ struct r300_context {
struct r300_atom fs_constants;
/* Framebuffer state. */
struct r300_atom fb_state;
/* Occlusion query. */
struct r300_atom query_start;
/* Rasterizer state. */
struct r300_atom rs_state;
/* RS block state. */
@ -417,8 +419,6 @@ struct r300_context {
struct pipe_viewport_state viewport;
/* Bitmask of dirty state objects. */
uint32_t dirty_state;
/* Flag indicating whether or not the HW is dirty. */
uint32_t dirty_hw;
/* Whether polygon offset is enabled. */

View file

@ -30,10 +30,6 @@
#define R300_RESOURCE_FLAG_TRANSFER PIPE_RESOURCE_FLAG_DRV_PRIV
/* Non-atom dirty state flags. */
#define R300_NEW_QUERY 0x40000000
#define R300_NEW_KITCHEN_SINK 0x7fffffff
/* Tiling flags. */
enum r300_buffer_tiling {
R300_BUFFER_LINEAR = 0,

View file

@ -570,7 +570,7 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state)
END_CS;
}
void r300_emit_query_start(struct r300_context *r300)
void r300_emit_query_start(struct r300_context *r300, unsigned size, void*state)
{
struct r300_query *query = r300->query_current;
CS_LOCALS(r300);
@ -578,7 +578,7 @@ void r300_emit_query_start(struct r300_context *r300)
if (!query)
return;
BEGIN_CS(4);
BEGIN_CS(size);
if (r300->screen->caps.family == CHIP_FAMILY_RV530) {
OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL);
} else {
@ -1149,7 +1149,7 @@ validate:
}
}
/* ...occlusion query buffer... */
if (r300->dirty_state & R300_NEW_QUERY) {
if (r300->query_start.dirty) {
if (!r300_add_buffer(r300->rws, r300->oqbo,
0, RADEON_GEM_DOMAIN_GTT)) {
r300->context.flush(&r300->context, 0, NULL);
@ -1219,11 +1219,6 @@ void r300_emit_dirty_state(struct r300_context* r300)
struct r300_screen* r300screen = r300->screen;
struct r300_atom* atom;
if (r300->dirty_state & R300_NEW_QUERY) {
r300_emit_query_start(r300);
r300->dirty_state &= ~R300_NEW_QUERY;
}
foreach(atom, &r300->atom_list) {
if (atom->dirty || atom->always_dirty) {
atom->emit(r300, atom->size, atom->state);

View file

@ -61,7 +61,7 @@ void r500_emit_fs_rc_constant_state(struct r300_context* r300, unsigned size, vo
void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state);
void r300_emit_query_start(struct r300_context* r300);
void r300_emit_query_start(struct r300_context *r300, unsigned size, void *state);
void r300_emit_query_end(struct r300_context* r300);

View file

@ -52,7 +52,6 @@ static void r300_flush(struct pipe_context* pipe,
if (r300->dirty_hw) {
FLUSH_CS;
r300->dirty_state = R300_NEW_KITCHEN_SINK;
r300->dirty_hw = 0;
/* New kitchen sink, baby. */

View file

@ -92,7 +92,7 @@ static void r300_begin_query(struct pipe_context* pipe,
q->flushed = FALSE;
r300->query_current = q;
r300->dirty_state |= R300_NEW_QUERY;
r300->query_start.dirty = TRUE;
}
static void r300_end_query(struct pipe_context* pipe,