/* Internal functions:
*/
+void vbo_reset_attr(struct vbo_exec_context *exec, GLuint attr);
void vbo_exec_vtx_init( struct vbo_exec_context *exec );
void vbo_exec_vtx_destroy( struct vbo_exec_context *exec );
#endif
}
+void vbo_reset_attr(struct vbo_exec_context *exec, GLuint attr)
+{
+ exec->vtx.attrsz[attr] = 0;
+ exec->vtx.attrtype[attr] = GL_FLOAT;
+ exec->vtx.active_sz[attr] = 0;
+}
static void reset_attrfv( struct vbo_exec_context *exec )
-{
+{
while (exec->vtx.enabled) {
const int i = u_bit_scan64(&exec->vtx.enabled);
- assert(exec->vtx.attrsz[i]);
-
- exec->vtx.attrsz[i] = 0;
- exec->vtx.attrtype[i] = GL_FLOAT;
- exec->vtx.active_sz[i] = 0;
+ vbo_reset_attr(exec, i);
}
exec->vtx.vertex_size = 0;
exec->vtx.inputs[VERT_ATTRIB_GENERIC0] = exec->vtx.inputs[0];
exec->vtx.attrsz[VERT_ATTRIB_GENERIC0] = exec->vtx.attrsz[0];
exec->vtx.attrptr[VERT_ATTRIB_GENERIC0] = exec->vtx.attrptr[0];
- exec->vtx.attrsz[0] = 0;
+ vbo_reset_attr(exec, VERT_ATTRIB_POS);
exec->vtx.enabled &= (~BITFIELD64_BIT(VBO_ATTRIB_POS));
exec->vtx.enabled |= BITFIELD64_BIT(VBO_ATTRIB_GENERIC0);
}