Procházet zdrojové kódy

vbo: do FLUSH_CURRENT before validating and updating state

This fixes an assertion failure since:
   commit 81afdd20f3
   vbo: don't check twice whether it's valid to render

FLUSH_CURRENT may set _NEW_CURRENT_ATTRIB.

Reviewed-by: Brian Paul <brianp@vmware.com>
tags/i965-primitive-restart-v2
Marek Olšák před 13 roky
rodič
revize
6fc565a94b
1 změnil soubory, kde provedl 16 přidání a 10 odebrání
  1. 16
    10
      src/mesa/vbo/vbo_exec_array.c

+ 16
- 10
src/mesa/vbo/vbo_exec_array.c Zobrazit soubor

@@ -640,11 +640,11 @@ 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;

FLUSH_CURRENT( ctx, 0 );

if (0)
check_draw_arrays_data(ctx, start, count);

@@ -669,11 +669,11 @@ 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;

FLUSH_CURRENT( ctx, 0 );

if (0)
check_draw_arrays_data(ctx, start, count);

@@ -761,8 +761,6 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
struct _mesa_index_buffer ib;
struct _mesa_prim prim[1];

FLUSH_CURRENT( ctx, 0 );

vbo_bind_arrays(ctx);

ib.count = count;
@@ -838,6 +836,8 @@ 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;
@@ -936,6 +936,8 @@ 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;

@@ -958,6 +960,8 @@ 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;
@@ -981,6 +985,8 @@ 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;
@@ -1005,6 +1011,8 @@ 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;
@@ -1037,8 +1045,6 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
if (primcount == 0)
return;

FLUSH_CURRENT( ctx, 0 );

prim = calloc(1, primcount * sizeof(*prim));
if (prim == NULL) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements");
@@ -1226,12 +1232,12 @@ 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;
}

FLUSH_CURRENT(ctx, 0);

vbo_draw_transform_feedback(ctx, mode, obj, 1);
}


Načítá se…
Zrušit
Uložit