summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-11-02 01:46:24 -0500
committerMarek Olšák <marek.olsak@amd.com>2021-01-04 19:22:33 -0500
commitbc6741832ee5952d2ee5c3de9e8049b299b129d5 (patch)
tree5afe9d52e5ff4ade61c2a8c7a01ef40d473276ec
parentd2982f6061ac2bb907ffc8c968011f9898ede407 (diff)
vbo: remove _mesa_prim parameter from vbo_copy_vertices
glBegin/End won't use _mesa_prim, so we need to stop using it. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>
-rw-r--r--src/mesa/vbo/vbo_exec.c10
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c3
-rw-r--r--src/mesa/vbo/vbo_private.h2
-rw-r--r--src/mesa/vbo/vbo_save_api.c3
4 files changed, 10 insertions, 8 deletions
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index 1be07843851..6619618c4cc 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -260,13 +260,13 @@ vbo_merge_draws(struct gl_context *ctx, bool in_dlist,
unsigned
vbo_copy_vertices(struct gl_context *ctx,
GLenum mode,
- struct _mesa_prim *last_prim,
+ unsigned start, unsigned *pcount, bool begin,
unsigned vertex_size,
bool in_dlist,
fi_type *dst,
const fi_type *src)
{
- const unsigned count = last_prim->count;
+ const unsigned count = *pcount;
unsigned copy = 0;
switch (mode) {
@@ -310,7 +310,7 @@ vbo_copy_vertices(struct gl_context *ctx,
}
break;
case GL_LINE_LOOP:
- if (!in_dlist && last_prim->begin == 0) {
+ if (!in_dlist && begin == 0) {
/* We're dealing with the second or later section of a split/wrapped
* GL_LINE_LOOP. Since we're converting line loops to line strips,
* we've already incremented the last_prim->start counter by one to
@@ -318,7 +318,7 @@ vbo_copy_vertices(struct gl_context *ctx,
* subtract one from last_prim->start) so that we copy the 0th vertex
* to the next vertex buffer.
*/
- assert(last_prim->start > 0);
+ assert(start > 0);
src -= vertex_size;
}
FALLTHROUGH;
@@ -337,7 +337,7 @@ vbo_copy_vertices(struct gl_context *ctx,
}
case GL_TRIANGLE_STRIP:
/* Draw an even number of triangles to keep front/back facing the same. */
- last_prim->count -= count % 2;
+ *pcount -= count % 2;
FALLTHROUGH;
case GL_QUAD_STRIP:
if (count <= 1)
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 101b3ed783c..1932da08ee8 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -75,7 +75,8 @@ vbo_exec_copy_vertices(struct vbo_exec_context *exec)
const fi_type *src = exec->vtx.buffer_map + last_prim->start * sz;
return vbo_copy_vertices(ctx, ctx->Driver.CurrentExecPrimitive,
- last_prim, sz, false, dst, src);
+ last_prim->start, &last_prim->count,
+ last_prim->begin, sz, false, dst, src);
}
diff --git a/src/mesa/vbo/vbo_private.h b/src/mesa/vbo/vbo_private.h
index 8e0c016da27..7bcb114c245 100644
--- a/src/mesa/vbo/vbo_private.h
+++ b/src/mesa/vbo/vbo_private.h
@@ -199,7 +199,7 @@ vbo_merge_draws(struct gl_context *ctx, bool in_dlist,
unsigned
vbo_copy_vertices(struct gl_context *ctx,
GLenum mode,
- struct _mesa_prim *last_prim,
+ unsigned start, unsigned *count, bool begin,
unsigned vertex_size,
bool in_dlist,
fi_type *dst,
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 789344bb91c..efc80578b40 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -128,7 +128,8 @@ copy_vertices(struct gl_context *ctx,
if (prim->end)
return 0;
- return vbo_copy_vertices(ctx, prim->mode, prim, sz, true, dst, src);
+ return vbo_copy_vertices(ctx, prim->mode, prim->start, &prim->count,
+ prim->begin, sz, true, dst, src);
}