* 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);
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. */
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. */
#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,
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);
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 {
}
}
/* ...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);
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);
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);
if (r300->dirty_hw) {
FLUSH_CS;
- r300->dirty_state = R300_NEW_KITCHEN_SINK;
r300->dirty_hw = 0;
/* New kitchen sink, baby. */
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,