aboutsummaryrefslogtreecommitdiff
path: root/mesalib
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib')
-rw-r--r--mesalib/src/mesa/main/api_validate.c16
-rw-r--r--mesalib/src/mesa/tnl/t_draw.c2
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_array.c20
-rw-r--r--mesalib/src/mesa/vbo/vbo_split_inplace.c1
4 files changed, 21 insertions, 18 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index e48a18a00..c583d1293 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/src/mesa/main/api_validate.c
@@ -329,7 +329,7 @@ _mesa_validate_DrawArrays(struct gl_context *ctx,
GLboolean
_mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint first,
- GLsizei count, GLsizei primcount)
+ GLsizei count, GLsizei numInstances)
{
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
@@ -346,10 +346,10 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
return GL_FALSE;
}
- if (primcount <= 0) {
- if (primcount < 0)
+ if (numInstances <= 0) {
+ if (numInstances < 0)
_mesa_error(ctx, GL_INVALID_VALUE,
- "glDrawArraysInstanced(primcount=%d)", primcount);
+ "glDrawArraysInstanced(numInstances=%d)", numInstances);
return GL_FALSE;
}
@@ -374,7 +374,7 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
GLboolean
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices, GLsizei primcount)
+ const GLvoid *indices, GLsizei numInstances)
{
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
@@ -399,10 +399,10 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
return GL_FALSE;
}
- if (primcount <= 0) {
- if (primcount < 0)
+ if (numInstances <= 0) {
+ if (numInstances < 0)
_mesa_error(ctx, GL_INVALID_VALUE,
- "glDrawElementsInstanced(primcount=%d)", primcount);
+ "glDrawElementsInstanced(numInstances=%d)", numInstances);
return GL_FALSE;
}
diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c
index 2a11091c8..741f0ed3f 100644
--- a/mesalib/src/mesa/tnl/t_draw.c
+++ b/mesalib/src/mesa/tnl/t_draw.c
@@ -468,6 +468,8 @@ void _tnl_draw_prims( struct gl_context *ctx,
break;
}
+ assert(prim[i].num_instances > 0);
+
/* Binding inputs may imply mapping some vertex buffer objects.
* They will need to be unmapped below.
*/
diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c
index 5b3a06f3b..13b54d59c 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_array.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_array.c
@@ -629,15 +629,15 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
*/
static void GLAPIENTRY
vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
- GLsizei primcount)
+ GLsizei numInstances)
{
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
- _mesa_lookup_enum_by_nr(mode), start, count, primcount);
+ _mesa_lookup_enum_by_nr(mode), start, count, numInstances);
- if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, primcount))
+ if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances))
return;
FLUSH_CURRENT( ctx, 0 );
@@ -649,7 +649,7 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
if (0)
check_draw_arrays_data(ctx, start, count);
- vbo_draw_arrays(ctx, mode, start, count, primcount);
+ vbo_draw_arrays(ctx, mode, start, count, numInstances);
if (0)
print_draw_arrays(ctx, mode, start, count);
@@ -724,7 +724,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
GLuint start, GLuint end,
GLsizei count, GLenum type,
const GLvoid *indices,
- GLint basevertex, GLint primcount)
+ GLint basevertex, GLint numInstances)
{
struct vbo_context *vbo = vbo_context(ctx);
struct vbo_exec_context *exec = &vbo->exec;
@@ -757,7 +757,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
prim[0].count = count;
prim[0].indexed = 1;
prim[0].basevertex = basevertex;
- prim[0].num_instances = primcount;
+ prim[0].num_instances = numInstances;
/* Need to give special consideration to rendering a range of
* indices starting somewhere above zero. Typically the
@@ -977,21 +977,21 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
*/
static void GLAPIENTRY
vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices, GLsizei primcount)
+ const GLvoid *indices, GLsizei numInstances)
{
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_DRAW)
_mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n",
_mesa_lookup_enum_by_nr(mode), count,
- _mesa_lookup_enum_by_nr(type), indices, primcount);
+ _mesa_lookup_enum_by_nr(type), indices, numInstances);
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
- primcount))
+ numInstances))
return;
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
- count, type, indices, 0, primcount);
+ count, type, indices, 0, numInstances);
}
diff --git a/mesalib/src/mesa/vbo/vbo_split_inplace.c b/mesalib/src/mesa/vbo/vbo_split_inplace.c
index 98c32eda5..37db87335 100644
--- a/mesalib/src/mesa/vbo/vbo_split_inplace.c
+++ b/mesalib/src/mesa/vbo/vbo_split_inplace.c
@@ -178,6 +178,7 @@ static void split_prims( struct split_context *split)
outprim->end = (nr == remaining && prim->end);
outprim->start = prim->start + j;
outprim->count = nr;
+ outprim->num_instances = prim->num_instances;
update_index_bounds(split, outprim);