#define BRW_NEW_METAOPS 0x1000
#define BRW_NEW_FENCE 0x2000
#define BRW_NEW_LOCK 0x4000
-
-
+/**
+ * Used for any batch entry with a relocated pointer that will be used
+ * by any 3D rendering.
+ */
+#define BRW_NEW_BATCH 0x8000
+/** brw->depth_region updated */
+#define BRW_NEW_DEPTH_BUFFER 0x10000
struct brw_state_flags {
/** State update flags signalled by mesa internals */
struct brw_tracked_state {
struct brw_state_flags dirty;
void (*update)( struct brw_context *brw );
- GLboolean always_update;
};
/* Flags for brw->state.cache.
BRW_NEW_VERTEX_PROGRAM |
BRW_NEW_URB_FENCE | /* Implicit - hardware requires this, not used above */
BRW_NEW_PSP | /* Implicit - hardware requires this, not used above */
- BRW_NEW_CURBE_OFFSETS),
+ BRW_NEW_CURBE_OFFSETS |
+ BRW_NEW_BATCH),
.cache = (CACHE_NEW_WM_PROG)
},
.update = upload_constant_buffer,
- .always_update = GL_TRUE, /* Has a relocation in the batchbuffer */
};
}
const struct brw_tracked_state brw_binding_table_pointers = {
+ .dirty = {
+ .mesa = 0,
+ .brw = BRW_NEW_BATCH,
+ .cache = CACHE_NEW_SURF_BIND,
+ },
.update = upload_binding_table_pointers,
- .always_update = GL_TRUE, /* Has a relocation in the batchbuffer */
};
const struct brw_tracked_state brw_pipelined_state_pointers = {
.dirty = {
.mesa = 0,
- .brw = BRW_NEW_METAOPS,
+ .brw = BRW_NEW_METAOPS | BRW_NEW_BATCH,
.cache = (CACHE_NEW_VS_UNIT |
CACHE_NEW_GS_UNIT |
CACHE_NEW_GS_PROG |
CACHE_NEW_CC_UNIT)
},
.update = upload_pipelined_state_pointers
- .always_update = GL_TRUE, /* Has a relocation in the batchbuffer */
};
#endif
const struct brw_tracked_state brw_psp_urb_cbs = {
.dirty = {
.mesa = 0,
- .brw = BRW_NEW_URB_FENCE | BRW_NEW_METAOPS,
+ .brw = BRW_NEW_URB_FENCE | BRW_NEW_METAOPS | BRW_NEW_BATCH,
.cache = (CACHE_NEW_VS_UNIT |
CACHE_NEW_GS_UNIT |
CACHE_NEW_GS_PROG |
CACHE_NEW_CC_UNIT)
},
.update = upload_psp_urb_cbs,
- .always_update = GL_TRUE, /* psp has relocations. */
};
/**
}
const struct brw_tracked_state brw_depthbuffer = {
+ .dirty = {
+ .mesa = 0,
+ .brw = BRW_NEW_DEPTH_BUFFER | BRW_NEW_BATCH,
+ .cache = 0,
+ },
.update = upload_depthbuffer,
- .always_update = GL_TRUE,
};
assert(atom->dirty.mesa ||
atom->dirty.brw ||
- atom->dirty.cache ||
- atom->always_update);
+ atom->dirty.cache);
assert(atom->update);
- if (check_state(state, &atom->dirty) || atom->always_update) {
+ if (check_state(state, &atom->dirty)) {
atom->update( brw );
/* emit_foo(brw); */
for (i = 0; i < Elements(atoms); i++) {
const struct brw_tracked_state *atom = brw->state.atoms[i];
- if (check_state(state, &atom->dirty) || atom->always_update)
+ if (check_state(state, &atom->dirty))
atom->update( brw );
}
}
{
struct brw_context *brw = brw_context(&intel->ctx);
+ if (brw->state.depth_region != depth_region)
+ brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER;
+
intel_region_release(&brw->state.draw_region);
intel_region_release(&brw->state.depth_region);
intel_region_reference(&brw->state.draw_region, draw_region);