summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_rasterpos.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2012-04-16 04:56:12 +0200
committerMarek Olšák <maraeo@gmail.com>2012-05-08 15:57:51 +0200
commitc5e473fbe25b20cb27aac44ff6e269701abd33a8 (patch)
tree9e4f43c7752b733dfecb55246d283713b2a207df /src/mesa/state_tracker/st_cb_rasterpos.c
parent50f7e75f9e945cfbb2ae868cc961a2205a0b6e73 (diff)
downloadexternal_mesa3d-c5e473fbe25b20cb27aac44ff6e269701abd33a8.zip
external_mesa3d-c5e473fbe25b20cb27aac44ff6e269701abd33a8.tar.gz
external_mesa3d-c5e473fbe25b20cb27aac44ff6e269701abd33a8.tar.bz2
mesa: add gl_context::NewDriverState and use it for vertex arrays
The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use the same flag to notify the driver. Since we've run out of bits in NewState and NewState is for core Mesa anyway, we need to find another way. This patch is the first to start decoupling the state flags meant only for core Mesa and those only for drivers. The idea is to have two flag sets: - gl_context::NewState - used by core Mesa only - gl_context::NewDriverState - used by drivers only (the flags are defined by the driver and opaque to core Mesa) It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module that the user changed vertex arrays, and the vbo module in turn sets a driver-specific flag to notify the driver that it should update its vertex array bindings. The driver decides which bits of NewDriverState should be set and stores them in gl_context::DriverFlags. Then, Core Mesa can do this: ctx->NewDriverState |= ctx->DriverFlags.NewArray; This patch implements this behavior and adapts st/mesa. DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS. Core Mesa only sets NewDriverState. It's the driver's responsibility to read it whenever it wants and reset it to 0. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_rasterpos.c')
-rw-r--r--src/mesa/state_tracker/st_cb_rasterpos.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index 7fef031..8337f46 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -251,7 +251,10 @@ st_RasterPos(struct gl_context *ctx, const GLfloat v[4])
*/
rs->array[0].Ptr = (GLubyte *) v;
- /* draw the point */
+ /* Draw the point.
+ *
+ * Don't set DriverFlags.NewArray.
+ * st_feedback_draw_vbo doesn't check for that flag. */
ctx->Array._DrawArrays = rs->arrays;
st_feedback_draw_vbo(ctx, &rs->prim, 1, NULL, GL_TRUE, 0, 1,
NULL);