summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-05-12 15:52:40 +0200
committerMarek Olšák <[email protected]>2012-06-15 03:15:50 +0200
commitb4753dafcce4fc771ec3d7e3d5781bd4cae20326 (patch)
tree13ef59a6eceb501f366cb3866e3cf624af85e11e /src/mesa/state_tracker/st_atom.c
parent6bb0151f1fd87b4e15f177c7122fc28fea29497e (diff)
st/mesa: atomize vertex array state
This moves the state validation to where all the other states are validated.
Diffstat (limited to 'src/mesa/state_tracker/st_atom.c')
-rw-r--r--src/mesa/state_tracker/st_atom.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index d9cd4aab49b..e6fc114f1fc 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/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.