i965: Create a macro for checking a dirty bit.
authorPaul Berry <stereotype441@gmail.com>
Fri, 10 Jan 2014 23:40:57 +0000 (15:40 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 2 Sep 2014 02:38:27 +0000 (19:38 -0700)
This will make it easier to extend dirty bit handling to support
compute shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_vec4_gs.c

index 5ffd9604a9c89174d63ca7e7fbab96a4bac71760..a44b77f4717742dfff8fc584f26bf57192362795 100644 (file)
@@ -259,6 +259,12 @@ struct brw_state_flags {
    } while (false)
 
 
+/**
+ * Check one of the bits in a field of brw_state_flags.
+ */
+#define CHECK_DIRTY_BIT(FIELD, FLAG) ((brw->state.dirty.FIELD & (FLAG)) != 0)
+
+
 /** Subclass of Mesa vertex program */
 struct brw_vertex_program {
    struct gl_vertex_program program;
index ecab59ae8e515c3d02426c7565ef5a16f60b9209..d99502de61326e861be8159eef0772615e2b88b3 100644 (file)
@@ -272,7 +272,7 @@ brw_upload_gs_prog(struct brw_context *brw)
 
    if (gp == NULL) {
       /* No geometry shader.  Vertex data just passes straight through. */
-      if (brw->state.dirty.brw & BRW_NEW_VUE_MAP_VS) {
+      if (CHECK_DIRTY_BIT(brw, BRW_NEW_VUE_MAP_VS)) {
          brw->vue_map_geom_out = brw->vue_map_vs;
          SET_DIRTY_BIT(brw, BRW_NEW_VUE_MAP_GEOM_OUT);
       }