st/mesa: restore draw rasterization stage after rasterpos
authorBrian Paul <brianp@vmware.com>
Sat, 13 Feb 2010 00:22:10 +0000 (17:22 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 13 Feb 2010 00:22:10 +0000 (17:22 -0700)
This fixes invalid calls to rastpos_point/line/tri() that can occur
when glRasterPos() is called while in feedback or selection mode.

(cherry picked from commit b3c7dc6ff232eb4c5ff6b0ddcfa90bcb56f78df1)

src/mesa/state_tracker/st_cb_rasterpos.c

index 42a1377809a966cb46e5720ecd2bcae54df50ab4..4692891c8aa9eac65861302768371d02021a5446 100644 (file)
@@ -251,6 +251,14 @@ st_RasterPos(GLcontext *ctx, const GLfloat v[4])
 
    /* draw the point */
    st_feedback_draw_vbo(ctx, rs->arrays, &rs->prim, 1, NULL, GL_TRUE, 0, 1);
+
+   /* restore draw's rasterization stage depending on rendermode */
+   if (ctx->RenderMode == GL_FEEDBACK) {
+      draw_set_rasterize_stage(draw, st->feedback_stage);
+   }
+   else if (ctx->RenderMode == GL_SELECT) {
+      draw_set_rasterize_stage(draw, st->selection_stage);
+   }
 }