/**
* Return a PIPE_FORMAT_x for the given GL datatype and size.
*/
-GLuint
+enum pipe_format
st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
GLboolean normalized)
{
case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1];
case GL_FIXED: return fixed_types[size-1];
default: assert(0); return 0;
- }
+ }
}
else {
switch (type) {
case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1];
case GL_FIXED: return fixed_types[size-1];
default: assert(0); return 0;
- }
+ }
}
- return 0; /* silence compiler warning */
+ return PIPE_FORMAT_NONE; /* silence compiler warning */
}
-
-
/**
* Examine the active arrays to determine if we have interleaved
* vertex arrays all living in one VBO, or all living in user space.
GLuint attr;
const GLubyte *low_addr = NULL;
- /* Find the lowest address. */
- if(vpv->num_inputs) {
+ /* Find the lowest address of the arrays we're drawing */
+ if (vpv->num_inputs) {
low_addr = arrays[vp->index_to_input[0]]->Ptr;
for (attr = 1; attr < vpv->num_inputs; attr++) {
vbuffer->buffer = NULL;
pipe_resource_reference(&vbuffer->buffer, stobj->buffer);
vbuffer->buffer_offset = pointer_to_offset(low_addr);
- } else {
+ }
+ else {
uint divisor = array->InstanceDivisor;
uint length = (divisor ? num_instances / divisor : max_index) + 1;
- vbuffer->buffer =
- pipe_user_buffer_create(pipe->screen, (void*)low_addr,
- stride * length,
- PIPE_BIND_VERTEX_BUFFER);
+ vbuffer->buffer = pipe_user_buffer_create(pipe->screen,
+ (void*) low_addr,
+ stride * length,
+ PIPE_BIND_VERTEX_BUFFER);
vbuffer->buffer_offset = 0;
/* Track user vertex buffers. */
}
else {
setup_non_interleaved_attribs(ctx, vp, vpv, arrays,
- vbuffer, velements, max_index, num_instances);
+ vbuffer, velements, max_index,
+ num_instances);
num_vbuffers = vpv->num_inputs;
num_velements = vpv->num_inputs;
}
for (i = 0; i < nr_prims; i++) {
num_instances = MAX2(num_instances, prims[i].num_instances);
}
- } else {
+ }
+ else {
/* Get min/max index for non-indexed drawing. */
min_index = ~0;
max_index = 0;
pipe->redefine_user_buffer(pipe, st->user_vb[i],
min_index * stride,
(max_index + 1 - min_index) * stride);
- } else {
+ }
+ else {
/* stride == 0 */
pipe->redefine_user_buffer(pipe, st->user_vb[i],
0, st->user_vb[i]->width0);
}
-void st_init_draw( struct st_context *st )
+void
+st_init_draw(struct st_context *st)
{
struct gl_context *ctx = st->ctx;
}
-void st_destroy_draw( struct st_context *st )
+void
+st_destroy_draw(struct st_context *st)
{
#if FEATURE_feedback || FEATURE_rastpos
draw_destroy(st->draw);
#endif
}
-
-