i965: Create a macro for setting all dirty bits.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_context.h
index 602275c26abad7fc751f26a6fd4c4ca9c8ffdac4..5ffd9604a9c89174d63ca7e7fbab96a4bac71760 100644 (file)
@@ -241,6 +241,24 @@ struct brw_state_flags {
    GLuint cache;
 };
 
+
+/**
+ * Set one of the bits in a field of brw_state_flags.
+ */
+#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;