aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-10 21:42:56 -0500
committerMarge Bot <[email protected]>2020-02-28 00:53:45 +0000
commitb78ab9c741ac758e9d1eb237f7e8ddc3b70235f5 (patch)
tree982ae2d8ce6aed0089f1c45233b90ac3c4f51675 /src/mesa/vbo
parentaaa758d3dd4112e6ce52b033cb6dcabfcebadb1f (diff)
mesa: move num_instances and base_instance out of _mesa_prim
They are never used by multi draws and internal draws. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo.h1
-rw-r--r--src/mesa/vbo/vbo_exec.c4
-rw-r--r--src/mesa/vbo/vbo_exec_api.c2
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c2
-rw-r--r--src/mesa/vbo/vbo_primitive_restart.c8
-rw-r--r--src/mesa/vbo/vbo_save_api.c4
-rw-r--r--src/mesa/vbo/vbo_save_draw.c2
7 files changed, 10 insertions, 13 deletions
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index a03a4cec70b..688e8fd83eb 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -97,6 +97,7 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
const struct _mesa_prim *prim,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
+ GLuint num_instances, GLuint base_instance,
struct gl_buffer_object *indirect,
GLsizeiptr indirect_offset);
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index f1b1f8bff95..66ad8888bcd 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -191,9 +191,7 @@ vbo_can_merge_prims(const struct _mesa_prim *p0, const struct _mesa_prim *p1)
if (p0->start + p0->count != p1->start)
return false;
- assert(p0->basevertex == p1->basevertex &&
- p0->num_instances == p1->num_instances &&
- p0->base_instance == p1->base_instance);
+ assert(p0->basevertex == p1->basevertex);
/* can always merge subsequent GL_POINTS primitives */
if (p0->mode == GL_POINTS)
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index d724f4efe11..2f049ccd450 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -812,8 +812,6 @@ vbo_exec_Begin(GLenum mode)
exec->vtx.prim[i].end = 0;
exec->vtx.prim[i].start = exec->vtx.vert_count;
exec->vtx.prim[i].count = 0;
- exec->vtx.prim[i].num_instances = 1;
- exec->vtx.prim[i].base_instance = 0;
ctx->Driver.CurrentExecPrimitive = mode;
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 10e330eb816..87e7db18d67 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -413,7 +413,7 @@ vbo_exec_vtx_flush(struct vbo_exec_context *exec)
exec->vtx.vert_count);
ctx->Driver.Draw(ctx, exec->vtx.prim, exec->vtx.prim_count,
- NULL, GL_TRUE, 0, exec->vtx.vert_count - 1,
+ NULL, GL_TRUE, 0, exec->vtx.vert_count - 1, 1, 0,
NULL, 0);
/* Get new storage -- unless asked not to. */
diff --git a/src/mesa/vbo/vbo_primitive_restart.c b/src/mesa/vbo/vbo_primitive_restart.c
index b4b3cdf8d4c..2b6bcd46e3e 100644
--- a/src/mesa/vbo/vbo_primitive_restart.c
+++ b/src/mesa/vbo/vbo_primitive_restart.c
@@ -164,6 +164,7 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
const struct _mesa_prim *prims,
GLuint nr_prims,
const struct _mesa_index_buffer *ib,
+ GLuint num_instances, GLuint base_instance,
struct gl_buffer_object *indirect,
GLsizeiptr indirect_offset)
{
@@ -200,10 +201,11 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
indirect_offset);
new_prim.count = indirect_params[0];
- new_prim.num_instances = indirect_params[1];
new_prim.start = indirect_params[2];
new_prim.basevertex = indirect_params[3];
- new_prim.base_instance = indirect_params[4];
+
+ num_instances = indirect_params[1];
+ base_instance = indirect_params[4];
new_ib = *ib;
new_ib.count = new_prim.count;
@@ -249,10 +251,12 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
(temp_prim.count == sub_prim->count)) {
ctx->Driver.Draw(ctx, &temp_prim, 1, ib, GL_TRUE,
sub_prim->min_index, sub_prim->max_index,
+ num_instances, base_instance,
NULL, 0);
} else {
ctx->Driver.Draw(ctx, &temp_prim, 1, ib,
GL_FALSE, -1, -1,
+ num_instances, base_instance,
NULL, 0);
}
}
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 8e7ab86bae1..1ef6043ad0c 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -739,8 +739,6 @@ wrap_buffers(struct gl_context *ctx)
save->prims[0].end = 0;
save->prims[0].start = 0;
save->prims[0].count = 0;
- save->prims[0].num_instances = 1;
- save->prims[0].base_instance = 0;
save->prim_count = 1;
}
@@ -1218,8 +1216,6 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode,
save->prims[i].end = 0;
save->prims[i].start = save->vert_count;
save->prims[i].count = 0;
- save->prims[i].num_instances = 1;
- save->prims[i].base_instance = 0;
save->no_current_update = no_current_update;
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index f6298ee2c9b..e193a5a32af 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -213,7 +213,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data)
GLuint min_index = _vbo_save_get_min_index(node);
GLuint max_index = _vbo_save_get_max_index(node);
ctx->Driver.Draw(ctx, node->prims, node->prim_count, NULL, GL_TRUE,
- min_index, max_index, NULL, 0);
+ min_index, max_index, 1, 0, NULL, 0);
}
}