From 2b22e33c10f98f2f58101881818f55b4c4b73606 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 22 Jan 2020 18:49:51 -0500 Subject: vbo: remove immediate mode code that doesn't do anything and simplify stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no change in behavior Reviewed-by: Mathias Fröhlich Part-of: --- src/mesa/drivers/dri/i965/brw_context.c | 1 - src/mesa/state_tracker/st_context.c | 5 ---- src/mesa/vbo/vbo.h | 3 --- src/mesa/vbo/vbo_exec.h | 3 --- src/mesa/vbo/vbo_exec_api.c | 44 +++------------------------------ 5 files changed, 3 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 16f987812fc..eda8ba2fe70 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -1135,7 +1135,6 @@ brwCreateContext(gl_api api, brw_init_performance_queries(brw); vbo_use_buffer_objects(ctx); - vbo_always_unmap_buffers(ctx); brw->ctx.Cache = brw->screen->disk_cache; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 5aec2f5bb23..d66bd2b904b 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -620,14 +620,9 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, /* we want all vertex data to be placed in buffer objects */ vbo_use_buffer_objects(ctx); - - /* make sure that no VBOs are left mapped when we're drawing. */ - vbo_always_unmap_buffers(ctx); - /* Need these flags: */ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; - ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; if (no_error) diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 3399fcdea46..3dcc4485757 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -95,9 +95,6 @@ vbo_get_minmax_indices(struct gl_context *ctx, const struct _mesa_prim *prim, void vbo_use_buffer_objects(struct gl_context *ctx); -void -vbo_always_unmap_buffers(struct gl_context *ctx); - void vbo_sw_primitive_restart(struct gl_context *ctx, const struct _mesa_prim *prim, diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index a5f7888ad4b..2c1fb1e6e3a 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -109,9 +109,6 @@ struct vbo_exec_context struct vbo_exec_eval2_map map2[VERT_ATTRIB_MAX]; } eval; - /* Which flags to set in vbo_exec_begin_vertices() */ - GLbitfield begin_vertices_flags; - #ifndef NDEBUG GLint flush_call_depth; #endif diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 2fac34c2073..01b228f13c2 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -440,24 +440,6 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr, } -/** - * Called upon first glVertex, glColor, glTexCoord, etc. - */ -static void -vbo_exec_begin_vertices(struct gl_context *ctx) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - - if (unlikely(!exec->vtx.buffer_ptr)) - vbo_exec_vtx_map(exec); - - assert((ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0); - assert(exec->begin_vertices_flags); - - ctx->Driver.NeedFlush |= exec->begin_vertices_flags; -} - - /** * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex? * It depends on a few things, including whether we're inside or outside @@ -508,10 +490,6 @@ do { \ /* This is a glVertex call */ \ GLuint i; \ \ - if (unlikely((ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0)) { \ - vbo_exec_begin_vertices(ctx); \ - } \ - \ if (unlikely(!exec->vtx.buffer_ptr)) { \ vbo_exec_vtx_map(exec); \ } \ @@ -525,7 +503,8 @@ do { \ \ /* Set FLUSH_STORED_VERTICES to indicate that there's now */ \ /* something to draw (not just updating a color or texcoord).*/ \ - ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; \ + ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT | \ + FLUSH_STORED_VERTICES; \ \ if (++exec->vtx.vert_count >= exec->vtx.max_vert) \ vbo_exec_vtx_wrap(exec); \ @@ -988,20 +967,6 @@ vbo_use_buffer_objects(struct gl_context *ctx) } -/** - * If this function is called, all VBO buffers will be unmapped when - * we flush. - * Otherwise, if a simple command like glColor3f() is called and we flush, - * the current VBO may be left mapped. - */ -void -vbo_always_unmap_buffers(struct gl_context *ctx) -{ - struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - exec->begin_vertices_flags |= FLUSH_STORED_VERTICES; -} - - void vbo_exec_vtx_init(struct vbo_exec_context *exec) { @@ -1034,8 +999,6 @@ vbo_exec_vtx_init(struct vbo_exec_context *exec) } exec->vtx.vertex_size = 0; - - exec->begin_vertices_flags = FLUSH_UPDATE_CURRENT; } @@ -1100,8 +1063,7 @@ vbo_exec_FlushVertices(struct gl_context *ctx, GLuint flags) /* Flush (draw), and make sure VBO is left unmapped when done */ vbo_exec_FlushVertices_internal(exec, GL_TRUE); - /* Need to do this to ensure vbo_exec_begin_vertices gets called again: - */ + /* Clear the dirty flush flags, because the flush is finished. */ ctx->Driver.NeedFlush &= ~(FLUSH_UPDATE_CURRENT | flags); #ifndef NDEBUG -- cgit v1.2.3