for (attr = 0; attr < vpv->num_inputs; attr++) {
const GLuint mesaAttr = vp->index_to_input[attr];
- const struct gl_buffer_object *bufObj = arrays[mesaAttr]->BufferObj;
- const GLsizei stride = arrays[mesaAttr]->StrideB; /* in bytes */
+ const struct gl_client_array *array = arrays[mesaAttr];
+ const struct gl_buffer_object *bufObj = array->BufferObj;
+ const GLsizei stride = array->StrideB; /* in bytes */
if (firstStride < 0) {
firstStride = stride;
return GL_FALSE;
}
if (!client_addr) {
- client_addr = arrays[mesaAttr]->Ptr;
+ client_addr = array->Ptr;
}
- else if (abs(arrays[mesaAttr]->Ptr - client_addr) > firstStride) {
+ else if (abs(array->Ptr - client_addr) > firstStride) {
/* arrays start too far apart */
return GL_FALSE;
}
for (attr = 0; attr < vpv->num_inputs; attr++) {
const GLuint mesaAttr = vp->index_to_input[attr];
- struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj;
+ const struct gl_client_array *array = arrays[mesaAttr];
+ struct gl_buffer_object *bufobj = array->BufferObj;
struct st_buffer_object *stobj = st_buffer_object(bufobj);
- GLsizei stride = arrays[mesaAttr]->StrideB;
+ GLsizei stride = array->StrideB;
if (attr == 0) {
if (bufobj && bufobj->Name) {
pipe_resource_reference(&vbuffer->buffer, stobj->buffer);
vbuffer->buffer_offset = pointer_to_offset(low_addr);
} else {
- uint divisor = arrays[mesaAttr]->InstanceDivisor;
+ uint divisor = array->InstanceDivisor;
uint length = (divisor ? num_instances / divisor : max_index) + 1;
vbuffer->buffer =
pipe_user_buffer_create(pipe->screen, (void*)low_addr,
vbuffer->stride = stride; /* in bytes */
}
- velements[attr].src_offset =
- (unsigned) (arrays[mesaAttr]->Ptr - low_addr);
- velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor;
+ velements[attr].src_offset = (unsigned) (array->Ptr - low_addr);
+ velements[attr].instance_divisor = array->InstanceDivisor;
velements[attr].vertex_buffer_index = 0;
- velements[attr].src_format =
- st_pipe_vertex_format(arrays[mesaAttr]->Type,
- arrays[mesaAttr]->Size,
- arrays[mesaAttr]->Format,
- arrays[mesaAttr]->Normalized);
+ velements[attr].src_format = st_pipe_vertex_format(array->Type,
+ array->Size,
+ array->Format,
+ array->Normalized);
assert(velements[attr].src_format);
}
}
for (attr = 0; attr < vpv->num_inputs; attr++) {
const GLuint mesaAttr = vp->index_to_input[attr];
- struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj;
- GLsizei stride = arrays[mesaAttr]->StrideB;
+ const struct gl_client_array *array = arrays[mesaAttr];
+ struct gl_buffer_object *bufobj = array->BufferObj;
+ GLsizei stride = array->StrideB;
if (bufobj && bufobj->Name) {
/* Attribute data is in a VBO.
vbuffer[attr].buffer = NULL;
pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer);
- vbuffer[attr].buffer_offset = pointer_to_offset(arrays[mesaAttr]->Ptr);
+ vbuffer[attr].buffer_offset = pointer_to_offset(array->Ptr);
}
else {
/* wrap user data */
uint bytes;
void *ptr;
- if (arrays[mesaAttr]->Ptr) {
+ if (array->Ptr) {
if (stride == 0) {
- bytes = _mesa_sizeof_type(arrays[mesaAttr]->Type)
- * arrays[mesaAttr]->Size;
+ bytes = _mesa_sizeof_type(array->Type) * array->Size;
}
else {
- uint divisor = arrays[mesaAttr]->InstanceDivisor;
+ uint divisor = array->InstanceDivisor;
uint length = (divisor ? num_instances / divisor : max_index) + 1;
bytes = stride * length;
}
- ptr = (void *) arrays[mesaAttr]->Ptr;
+ ptr = (void *) array->Ptr;
}
else {
/* no array, use ctx->Current.Attrib[] value */
vbuffer[attr].stride = stride; /* in bytes */
velements[attr].src_offset = 0;
- velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor;
+ velements[attr].instance_divisor = array->InstanceDivisor;
velements[attr].vertex_buffer_index = attr;
- velements[attr].src_format
- = st_pipe_vertex_format(arrays[mesaAttr]->Type,
- arrays[mesaAttr]->Size,
- arrays[mesaAttr]->Format,
- arrays[mesaAttr]->Normalized);
+ velements[attr].src_format = st_pipe_vertex_format(array->Type,
+ array->Size,
+ array->Format,
+ array->Normalized);
assert(velements[attr].src_format);
}
}