diff options
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r-- | src/mesa/vbo/vbo_exec_api.c | 2 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec_array.c | 2 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_private.h | 37 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_draw.c | 6 |
4 files changed, 6 insertions, 41 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 881255ceb72..64e792bfa2c 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -770,7 +770,7 @@ vbo_exec_Begin(GLenum mode) return; } - vbo_draw_method(vbo_context(ctx), DRAW_BEGIN_END); + _mesa_set_drawing_arrays(ctx, exec->vtx.inputs); if (ctx->NewState) { _mesa_update_state(ctx); diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 43362db2c7c..1d2f806cd5b 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -444,7 +444,7 @@ vbo_bind_arrays(struct gl_context *ctx) struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; - vbo_draw_method(vbo, DRAW_ARRAYS); + _mesa_set_drawing_arrays(ctx, vbo->exec.array.inputs); if (exec->array.recalculate_inputs) { recalculate_input_bindings(ctx); diff --git a/src/mesa/vbo/vbo_private.h b/src/mesa/vbo/vbo_private.h index d78593c7fa2..7c1e3c481f1 100644 --- a/src/mesa/vbo/vbo_private.h +++ b/src/mesa/vbo/vbo_private.h @@ -99,43 +99,6 @@ get_vp_mode( struct gl_context *ctx ) /** - * This is called by glBegin, glDrawArrays and glDrawElements (and - * variations of those calls). When we transition from immediate mode - * drawing to array drawing we need to invalidate the array state. - * - * glBegin/End builds vertex arrays. Those arrays may look identical - * to glDrawArrays arrays except that the position of the elements may - * be different. For example, arrays of (position3v, normal3f) vs. arrays - * of (normal3f, position3f). So we need to make sure we notify drivers - * that arrays may be changing. - */ -static inline void -vbo_draw_method(struct vbo_context *vbo, gl_draw_method method) -{ - struct gl_context *ctx = vbo->exec.ctx; - - if (ctx->Array.DrawMethod != method) { - switch (method) { - case DRAW_ARRAYS: - ctx->Array._DrawArrays = vbo->exec.array.inputs; - break; - case DRAW_BEGIN_END: - ctx->Array._DrawArrays = vbo->exec.vtx.inputs; - break; - case DRAW_DISPLAY_LIST: - ctx->Array._DrawArrays = vbo->save.inputs; - break; - default: - unreachable("Bad VBO drawing method"); - } - - ctx->NewDriverState |= ctx->DriverFlags.NewArray; - ctx->Array.DrawMethod = method; - } -} - - -/** * Return if format is integer. The immediate mode commands only emit floats * for non-integer types, thus everything else is integer. */ diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 60405d54ead..c86efcb05ee 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -34,6 +34,7 @@ #include "main/macros.h" #include "main/light.h" #include "main/state.h" +#include "main/varray.h" #include "util/bitscan.h" #include "vbo_private.h" @@ -267,7 +268,8 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) { const struct vbo_save_vertex_list *node = (const struct vbo_save_vertex_list *) data; - struct vbo_save_context *save = &vbo_context(ctx)->save; + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_save_context *save = &vbo->save; GLboolean remap_vertex_store = GL_FALSE; if (save->vertex_store && save->vertex_store->buffer_map) { @@ -318,7 +320,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) bind_vertex_list(ctx, node); - vbo_draw_method(vbo_context(ctx), DRAW_DISPLAY_LIST); + _mesa_set_drawing_arrays(ctx, vbo->save.inputs); /* Again... */ |