/* We've smashed all state compared to what the normal 3D pipeline
* rendering tracks for GL.
*/
- brw->state.dirty.brw = ~0;
- brw->state.dirty.cache = ~0;
+ SET_DIRTY_ALL(brw);
+ SET_DIRTY_ALL(cache);
brw->no_depth_or_stencil = false;
brw->ib.type = -1;
#define SET_DIRTY_BIT(FIELD, FLAG) brw->state.dirty.FIELD |= (FLAG)
+/**
+ * Set all of the bits in a field of brw_state_flags.
+ */
+#define SET_DIRTY_ALL(FIELD) \
+ do { \
+ /* ~0 == 0xffffffff, so make sure field is <= 32 bits */ \
+ STATIC_ASSERT(sizeof(brw->state.dirty.FIELD) == 4); \
+ brw->state.dirty.FIELD = ~0; \
+ } while (false)
+
+
/** Subclass of Mesa vertex program */
struct brw_vertex_program {
struct gl_vertex_program program;
/* We need to make sure that the programs get regenerated, since
* any offsets leftover in brw_context will no longer be valid.
*/
- brw->state.dirty.mesa |= ~0;
- brw->state.dirty.brw |= ~0;
- brw->state.dirty.cache |= ~0;
+ SET_DIRTY_ALL(mesa);
+ SET_DIRTY_ALL(brw);
+ SET_DIRTY_ALL(cache);
intel_batchbuffer_flush(brw);
}
brw_upload_initial_gpu_state(brw);
- brw->state.dirty.mesa = ~0;
- brw->state.dirty.brw = ~0;
+ SET_DIRTY_ALL(mesa);
+ SET_DIRTY_ALL(brw);
/* Make sure that brw->state.dirty.brw has enough bits to hold all possible
* dirty flags.