aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-22 18:49:51 -0500
committerMarge Bot <[email protected]>2020-02-11 00:34:57 +0000
commit2b22e33c10f98f2f58101881818f55b4c4b73606 (patch)
tree0f7c57382a81d9dd2bfbd7176c8b197e10700cc4 /src/mesa/vbo
parent3e0d612f5e22fee19aff0e40814db24d63f63103 (diff)
vbo: remove immediate mode code that doesn't do anything and simplify stuff
no change in behavior Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo.h3
-rw-r--r--src/mesa/vbo/vbo_exec.h3
-rw-r--r--src/mesa/vbo/vbo_exec_api.c44
3 files changed, 3 insertions, 47 deletions
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
@@ -96,9 +96,6 @@ 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,
GLuint nr_prims,
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
@@ -441,24 +441,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
* of glBegin/glEnd.
@@ -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