GLuint drawID)
{
struct vbo_context *vbo = vbo_context(ctx);
- struct _mesa_prim prim[2];
+ struct _mesa_prim prim;
if (skip_validated_draw(ctx))
return;
/* OpenGL 4.5 says that primitive restart is ignored with non-indexed
* draws.
*/
- memset(prim, 0, sizeof(prim));
- prim[0].begin = 1;
- prim[0].end = 1;
- prim[0].mode = mode;
- prim[0].num_instances = numInstances;
- prim[0].base_instance = baseInstance;
- prim[0].draw_id = drawID;
- prim[0].is_indirect = 0;
- prim[0].start = start;
- prim[0].count = count;
-
- vbo->draw_prims(ctx, prim, 1, NULL,
+ memset(&prim, 0, sizeof(prim));
+ prim.begin = 1;
+ prim.end = 1;
+ prim.mode = mode;
+ prim.num_instances = numInstances;
+ prim.base_instance = baseInstance;
+ prim.draw_id = drawID;
+ prim.is_indirect = 0;
+ prim.start = start;
+ prim.count = count;
+
+ vbo->draw_prims(ctx, &prim, 1, NULL,
GL_TRUE, start, start + count - 1, NULL, 0, NULL);
if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
{
struct vbo_context *vbo = vbo_context(ctx);
struct _mesa_index_buffer ib;
- struct _mesa_prim prim[1];
+ struct _mesa_prim prim;
if (skip_draw_elements(ctx, count, indices))
return;
ib.obj = ctx->Array.VAO->IndexBufferObj;
ib.ptr = indices;
- prim[0].begin = 1;
- prim[0].end = 1;
- prim[0].weak = 0;
- prim[0].pad = 0;
- prim[0].mode = mode;
- prim[0].start = 0;
- prim[0].count = count;
- prim[0].indexed = 1;
- prim[0].is_indirect = 0;
- prim[0].basevertex = basevertex;
- prim[0].num_instances = numInstances;
- prim[0].base_instance = baseInstance;
- prim[0].draw_id = 0;
+ prim.begin = 1;
+ prim.end = 1;
+ prim.weak = 0;
+ prim.pad = 0;
+ prim.mode = mode;
+ prim.start = 0;
+ prim.count = count;
+ prim.indexed = 1;
+ prim.is_indirect = 0;
+ prim.basevertex = basevertex;
+ prim.num_instances = numInstances;
+ prim.base_instance = baseInstance;
+ prim.draw_id = 0;
/* Need to give special consideration to rendering a range of
* indices starting somewhere above zero. Typically the
* for the latter case elsewhere.
*/
- vbo->draw_prims(ctx, prim, 1, &ib,
+ vbo->draw_prims(ctx, &prim, 1, &ib,
index_bounds_valid, start, end, NULL, 0, NULL);
if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
GLuint stream, GLuint numInstances)
{
struct vbo_context *vbo = vbo_context(ctx);
- struct _mesa_prim prim[2];
+ struct _mesa_prim prim;
if (!_mesa_validate_DrawTransformFeedback(ctx, mode, obj, stream,
numInstances)) {
vbo_bind_arrays(ctx);
/* init most fields to zero */
- memset(prim, 0, sizeof(prim));
- prim[0].begin = 1;
- prim[0].end = 1;
- prim[0].mode = mode;
- prim[0].num_instances = numInstances;
- prim[0].base_instance = 0;
- prim[0].is_indirect = 0;
+ memset(&prim, 0, sizeof(prim));
+ prim.begin = 1;
+ prim.end = 1;
+ prim.mode = mode;
+ prim.num_instances = numInstances;
+ prim.base_instance = 0;
+ prim.is_indirect = 0;
/* Maybe we should do some primitive splitting for primitive restart
* (like in DrawArrays), but we have no way to know how many vertices
* will be rendered. */
- vbo->draw_prims(ctx, prim, 1, NULL, GL_FALSE, 0, ~0, obj, stream, NULL);
+ vbo->draw_prims(ctx, &prim, 1, NULL, GL_FALSE, 0, ~0, obj, stream, NULL);
if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
_mesa_flush(ctx);