vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around
authorMarek Olšák <maraeo@gmail.com>
Wed, 27 Jun 2012 04:10:30 +0000 (06:10 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 28 Jun 2012 20:46:51 +0000 (22:46 +0200)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/api_validate.c
src/mesa/vbo/vbo_exec_array.c

index 02495a15a905093eb76fb50aedde4124563db2d2..ec47f1d6d87355f0fa3b9853c924d8ad7fae2141 100644 (file)
@@ -272,7 +272,7 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
                            GLenum mode, GLsizei count, GLenum type,
                            const GLvoid *indices, GLint basevertex)
 {
-   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
 
    if (count <= 0) {
       if (count < 0)
@@ -328,7 +328,7 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
                                 GLsizei count, GLenum type,
                                 const GLvoid *indices, GLint basevertex)
 {
-   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
 
    if (count <= 0) {
       if (count < 0)
@@ -386,7 +386,7 @@ GLboolean
 _mesa_validate_DrawArrays(struct gl_context *ctx,
                          GLenum mode, GLint start, GLsizei count)
 {
-   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
 
    if (count <= 0) {
       if (count < 0)
@@ -414,7 +414,7 @@ GLboolean
 _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint first,
                                    GLsizei count, GLsizei numInstances)
 {
-   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
 
    if (count <= 0) {
       if (count < 0)
@@ -458,7 +458,7 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
                                      const GLvoid *indices, GLsizei numInstances,
                                      GLint basevertex)
 {
-   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
 
    if (count <= 0) {
       if (count < 0)
@@ -519,7 +519,7 @@ _mesa_validate_DrawTransformFeedback(struct gl_context *ctx,
                                      GLenum mode,
                                      struct gl_transform_feedback_object *obj)
 {
-   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
+   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, GL_FALSE);
 
    if (!_mesa_valid_prim_mode(ctx, mode, "glDrawTransformFeedback")) {
       return GL_FALSE;
index b70ddb3004b250261802f0fbfa639efee9947421..ab9e246b20d3e6c80ae2a6e967c9838ebe6f6364 100644 (file)
@@ -666,8 +666,6 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
       _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
                   _mesa_lookup_enum_by_nr(mode), start, count);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
       return;
 
@@ -695,8 +693,6 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
       _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
                   _mesa_lookup_enum_by_nr(mode), start, count, numInstances);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances))
       return;
 
@@ -724,8 +720,6 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first, GLsizei count
                   _mesa_lookup_enum_by_nr(mode), first, count,
                   numInstances, baseInstance);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawArraysInstanced(ctx, mode, first, count,
                                            numInstances))
       return;
@@ -899,8 +893,6 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
                 _mesa_lookup_enum_by_nr(mode), start, end, count,
                 _mesa_lookup_enum_by_nr(type), indices, basevertex);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
                                           type, indices, basevertex ))
       return;
@@ -999,8 +991,6 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
                   _mesa_lookup_enum_by_nr(mode), count,
                   _mesa_lookup_enum_by_nr(type), indices);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 ))
       return;
 
@@ -1023,8 +1013,6 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
                   _mesa_lookup_enum_by_nr(mode), count,
                   _mesa_lookup_enum_by_nr(type), indices, basevertex);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices,
                                     basevertex ))
       return;
@@ -1048,8 +1036,6 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
                   _mesa_lookup_enum_by_nr(mode), count,
                   _mesa_lookup_enum_by_nr(type), indices, numInstances);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
                                              numInstances, 0))
       return;
@@ -1075,8 +1061,6 @@ vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type
                   _mesa_lookup_enum_by_nr(type), indices,
                   numInstances, basevertex);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
                                              numInstances, basevertex))
       return;
@@ -1272,8 +1256,6 @@ vbo_exec_MultiDrawElements(GLenum mode,
    GET_CURRENT_CONTEXT(ctx);
    GLint i;
 
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
    for (i = 0; i < primcount; i++) {
       if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i],
                                       0))
@@ -1295,8 +1277,6 @@ vbo_exec_MultiDrawElementsBaseVertex(GLenum mode,
    GET_CURRENT_CONTEXT(ctx);
    GLint i;
 
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
    for (i = 0; i < primcount; i++) {
       if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i],
                                       basevertex[i]))
@@ -1360,8 +1340,6 @@ vbo_exec_DrawTransformFeedback(GLenum mode, GLuint name)
       _mesa_debug(ctx, "glDrawTransformFeedback(%s, %d)\n",
                   _mesa_lookup_enum_by_nr(mode), name);
 
-   FLUSH_CURRENT(ctx, 0);
-
    if (!_mesa_validate_DrawTransformFeedback(ctx, mode, obj)) {
       return;
    }