diff options
author | Marek Olšák <[email protected]> | 2012-06-27 06:10:30 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-06-28 22:46:51 +0200 |
commit | 62b971673950148eb949ba23d7fdc47debea16f0 (patch) | |
tree | 4b7323e124193c00b5635dbec4c079fcc18af506 | |
parent | d9eb1a12254add75f6842fdebe5b78512855d04d (diff) |
vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around
Reviewed-by: Brian Paul <[email protected]>
-rw-r--r-- | src/mesa/main/api_validate.c | 12 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec_array.c | 22 |
2 files changed, 6 insertions, 28 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 02495a15a90..ec47f1d6d87 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -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; diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index b70ddb3004b..ab9e246b20d 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -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; } |