aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom.c b/mesalib/src/mesa/state_tracker/st_atom.c
index d9cd4aab4..e6fc114f1 100644
--- a/mesalib/src/mesa/state_tracker/st_atom.c
+++ b/mesalib/src/mesa/state_tracker/st_atom.c
@@ -63,7 +63,10 @@ static const struct st_tracked_state *atoms[] =
&st_update_vs_constants,
&st_update_gs_constants,
&st_update_fs_constants,
- &st_update_pixel_transfer
+ &st_update_pixel_transfer,
+
+ /* this must be done after the vertex program update */
+ &st_update_array
};
@@ -122,6 +125,22 @@ static void check_program_state( struct st_context *st )
st->dirty.st |= ST_NEW_GEOMETRY_PROGRAM;
}
+static void check_attrib_edgeflag(struct st_context *st)
+{
+ const struct gl_client_array **arrays = st->ctx->Array._DrawArrays;
+ GLboolean vertDataEdgeFlags;
+
+ if (!arrays)
+ return;
+
+ vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
+ arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
+ if (vertDataEdgeFlags != st->vertdata_edgeflags) {
+ st->vertdata_edgeflags = vertDataEdgeFlags;
+ st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
+ }
+}
+
/***********************************************************************
* Update all derived state:
@@ -132,6 +151,12 @@ void st_validate_state( struct st_context *st )
struct st_state_flags *state = &st->dirty;
GLuint i;
+ /* Get Mesa driver state. */
+ st->dirty.st |= st->ctx->NewDriverState;
+ st->ctx->NewDriverState = 0;
+
+ check_attrib_edgeflag(st);
+
/* The bitmap cache is immune to pixel unpack changes.
* Note that GLUT makes several calls to glPixelStore for each
* bitmap char it draws so this is an important check.