mesa: use FLUSH_CURRENT and not FLUSH_VERTICES in _mesa_validate_*
authorMarek Olšák <maraeo@gmail.com>
Mon, 2 Jul 2012 15:10:09 +0000 (17:10 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 2 Jul 2012 15:48:36 +0000 (17:48 +0200)
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL calls FLUSH_VERTICES, which
is not what we want.

This fixes a breakage in classic drivers, introduced in:

  62b971673950148eb949ba23d7fdc47debea16f0
  vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around

It should fix:
  https://bugs.freedesktop.org/show_bug.cgi?id=51629
  https://bugs.freedesktop.org/show_bug.cgi?id=51642

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/api_validate.c

index 631bceecfee2b0b3749b648ae9e082a43a83f78c..cf6aaf0c6870d9c94ce58bf2c876b53d4d52842b 100644 (file)
@@ -272,7 +272,8 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
                            GLenum mode, GLsizei count, GLenum type,
                            const GLvoid *indices, GLint basevertex)
 {
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   FLUSH_CURRENT(ctx, 0);
 
    if (count <= 0) {
       if (count < 0)
@@ -330,7 +331,8 @@ _mesa_validate_MultiDrawElements(struct gl_context *ctx,
 {
    unsigned i;
 
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   FLUSH_CURRENT(ctx, 0);
 
    for (i = 0; i < primcount; i++) {
       if (count[i] <= 0) {
@@ -398,7 +400,8 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
                                 GLsizei count, GLenum type,
                                 const GLvoid *indices, GLint basevertex)
 {
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   FLUSH_CURRENT(ctx, 0);
 
    if (count <= 0) {
       if (count < 0)
@@ -456,7 +459,8 @@ GLboolean
 _mesa_validate_DrawArrays(struct gl_context *ctx,
                          GLenum mode, GLint start, GLsizei count)
 {
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   FLUSH_CURRENT(ctx, 0);
 
    if (count <= 0) {
       if (count < 0)
@@ -484,7 +488,8 @@ GLboolean
 _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint first,
                                    GLsizei count, GLsizei numInstances)
 {
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   FLUSH_CURRENT(ctx, 0);
 
    if (count <= 0) {
       if (count < 0)
@@ -528,7 +533,8 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
                                      const GLvoid *indices, GLsizei numInstances,
                                      GLint basevertex)
 {
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   FLUSH_CURRENT(ctx, 0);
 
    if (count <= 0) {
       if (count < 0)
@@ -589,7 +595,8 @@ _mesa_validate_DrawTransformFeedback(struct gl_context *ctx,
                                      GLenum mode,
                                      struct gl_transform_feedback_object *obj)
 {
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   FLUSH_CURRENT(ctx, 0);
 
    if (!_mesa_valid_prim_mode(ctx, mode, "glDrawTransformFeedback")) {
       return GL_FALSE;