vbo: remove _mesa_prim parameter from vbo_try_prim_conversion

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>
This commit is contained in:
Marek Olšák 2020-11-02 01:46:24 -05:00
parent 9d90b44a23
commit 9088058df0
4 changed files with 9 additions and 10 deletions

View file

@ -146,16 +146,15 @@ void vbo_exec_destroy( struct gl_context *ctx )
* This function converts 2-vertex line strips/loops into GL_LINES, etc.
*/
void
vbo_try_prim_conversion(struct _mesa_prim *p)
vbo_try_prim_conversion(GLubyte *mode, unsigned *count)
{
if (p->mode == GL_LINE_STRIP && p->count == 2) {
if (*mode == GL_LINE_STRIP && *count == 2) {
/* convert 2-vertex line strip to a separate line */
p->mode = GL_LINES;
}
else if ((p->mode == GL_TRIANGLE_STRIP || p->mode == GL_TRIANGLE_FAN)
&& p->count == 3) {
*mode = GL_LINES;
} else if ((*mode == GL_TRIANGLE_STRIP || *mode == GL_TRIANGLE_FAN) &&
*count == 3) {
/* convert 3-vertex tri strip or fan to a separate triangle */
p->mode = GL_TRIANGLES;
*mode = GL_TRIANGLES;
}
/* Note: we can't convert a 4-vertex quad strip to a separate quad

View file

@ -868,7 +868,7 @@ try_vbo_merge(struct vbo_exec_context *exec)
assert(exec->vtx.prim_count >= 1);
vbo_try_prim_conversion(cur);
vbo_try_prim_conversion(&cur->mode, &cur->count);
if (exec->vtx.prim_count >= 2) {
struct gl_context *ctx = gl_context_from_vbo_exec(exec);

View file

@ -186,7 +186,7 @@ vbo_compute_max_verts(const struct vbo_exec_context *exec)
void
vbo_try_prim_conversion(struct _mesa_prim *p);
vbo_try_prim_conversion(GLubyte *mode, unsigned *count);
bool
vbo_merge_draws(struct gl_context *ctx, bool in_dlist,

View file

@ -296,7 +296,7 @@ merge_prims(struct gl_context *ctx, struct _mesa_prim *prim_list,
for (i = 1; i < *prim_count; i++) {
struct _mesa_prim *this_prim = prim_list + i;
vbo_try_prim_conversion(this_prim);
vbo_try_prim_conversion(&this_prim->mode, &this_prim->count);
if (vbo_merge_draws(ctx, true, prev_prim, this_prim)) {
/* We've found a prim that just extend the previous one. Tack it