*/
#define CONVERT( TYPE, MACRO ) do { \
GLuint i, j; \
- if (attrib->Normalized) { \
+ if (attrib->Format.Normalized) { \
for (i = 0; i < count; i++) { \
const TYPE *in = (TYPE *)ptr; \
for (j = 0; j < sz; j++) { \
GLuint count )
{
GLuint i;
- assert(attrib->Normalized);
- assert(attrib->Size == 4);
+ assert(attrib->Format.Normalized);
+ assert(attrib->Format.Size == 4);
for (i = 0; i < count; i++) {
const GLubyte *in = (GLubyte *) ptr; /* in is in BGRA order */
*fptr++ = UBYTE_TO_FLOAT(in[2]); /* red */
{
GLuint i;
GLint j;
- const GLint size = attrib->Size;
+ const GLint size = attrib->Format.Size;
- if (attrib->Normalized) {
+ if (attrib->Format.Normalized) {
for (i = 0; i < count; ++i) {
const GLfixed *in = (GLfixed *) ptr;
for (j = 0; j < size; ++j) {
struct vertex_buffer *VB = &tnl->vb;
GLuint stride = binding->Stride;
- if (attrib->Type != GL_FLOAT) {
- const GLuint sz = attrib->Size;
+ if (attrib->Format.Type != GL_FLOAT) {
+ const GLuint sz = attrib->Format.Size;
GLubyte *buf = get_space(ctx, count * sz * sizeof(GLfloat));
GLfloat *fptr = (GLfloat *)buf;
- switch (attrib->Type) {
+ switch (attrib->Format.Type) {
case GL_BYTE:
CONVERT(GLbyte, BYTE_TO_FLOAT);
break;
case GL_UNSIGNED_BYTE:
- if (attrib->Format == GL_BGRA) {
+ if (attrib->Format.Format == GL_BGRA) {
/* See GL_EXT_vertex_array_bgra */
convert_bgra_to_float(binding, attrib, ptr, fptr, count);
}
VB->AttribPtr[attr]->start = (GLfloat *)ptr;
VB->AttribPtr[attr]->count = count;
VB->AttribPtr[attr]->stride = stride;
- VB->AttribPtr[attr]->size = attrib->Size;
+ VB->AttribPtr[attr]->size = attrib->Format.Size;
/* This should die, but so should the whole GLvector4f concept:
*/
- VB->AttribPtr[attr]->flags = (((1<<attrib->Size)-1) |
+ VB->AttribPtr[attr]->flags = (((1<<attrib->Format.Size)-1) |
VEC_NOT_WRITEABLE |
(stride == 4*sizeof(GLfloat) ? 0 : VEC_BAD_STRIDE));
GLboolean index_bounds_valid,
GLuint min_index,
GLuint max_index,
+ GLuint num_instances,
+ GLuint base_instance,
struct gl_transform_feedback_object *tfb_vertcount,
- unsigned stream,
- struct gl_buffer_object *indirect)
+ unsigned stream)
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
const GLuint TEST_SPLIT = 0;
/* We always translate away calls with min_index != 0.
*/
t_rebase_prims( ctx, arrays, prim, nr_prims, ib,
- min_index, max_index,
+ min_index, max_index, num_instances, base_instance,
_tnl_draw_prims );
return;
}
*/
_tnl_split_prims( ctx, arrays, prim, nr_prims, ib,
0, max_index + prim->basevertex,
+ num_instances, base_instance,
_tnl_draw_prims,
&limits );
}
GLuint nr_bo = 0;
GLuint inst;
+ assert(num_instances > 0);
+
for (i = 0; i < nr_prims;) {
GLuint this_nr_prims;
break;
}
- assert(prim[i].num_instances > 0);
-
/* Binding inputs may imply mapping some vertex buffer objects.
* They will need to be unmapped below.
*/
- for (inst = 0; inst < prim[i].num_instances; inst++) {
+ for (inst = 0; inst < num_instances; inst++) {
bind_prims(ctx, &prim[i], this_nr_prims);
bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1,
const struct _mesa_prim *prim, GLuint nr_prims,
const struct _mesa_index_buffer *ib,
GLboolean index_bounds_valid, GLuint min_index, GLuint max_index,
+ GLuint num_instances, GLuint base_instance,
struct gl_transform_feedback_object *tfb_vertcount,
- unsigned stream, struct gl_buffer_object *indirect)
+ unsigned stream)
{
/* Update TNLcontext::draw_arrays and return that pointer.
*/
_tnl_draw_prims(ctx, arrays, prim, nr_prims, ib,
index_bounds_valid, min_index, max_index,
- tfb_vertcount, stream, indirect);
+ num_instances, base_instance, tfb_vertcount, stream);
}