[Mesa-dev] [PATCH 3/8] i965: Create a macro for checking a dirty bit.
Jordan Justen
jordan.l.justen at intel.com
Wed Aug 27 14:30:12 PDT 2014
From: Paul Berry <stereotype441 at gmail.com>
This will make it easier to extend dirty bit handling to support
compute shaders.
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/mesa/drivers/dri/i965/brw_context.h | 6 ++++++
src/mesa/drivers/dri/i965/brw_vec4_gs.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 5ffd960..a44b77f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -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;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c
index ecab59a..d99502d 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs.c
@@ -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);
}
--
2.1.0
More information about the mesa-dev
mailing list