st/mesa: move a piece of _mesa_draw_array_attrib out of the loop in setup_arrays
This inlines _mesa_draw_array_attrib and moves attribute_map out of the loop. The compiler doesn't do this automatically. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27198>
This commit is contained in:
@@ -89,10 +89,13 @@ setup_arrays(struct st_context *st,
|
||||
|
||||
/* Process attribute array data. */
|
||||
if (vao->IsDynamic) {
|
||||
const GLubyte *attribute_map =
|
||||
_mesa_vao_attribute_map[vao->_AttributeMapMode];
|
||||
|
||||
while (mask) {
|
||||
const gl_vert_attrib attr = (gl_vert_attrib)u_bit_scan(&mask);
|
||||
const struct gl_array_attributes *const attrib =
|
||||
_mesa_draw_array_attrib(vao, attr);
|
||||
&vao->VertexAttrib[attribute_map[attr]];
|
||||
const struct gl_vertex_buffer_binding *const binding =
|
||||
&vao->BufferBinding[attrib->BufferBindingIndex];
|
||||
const unsigned bufidx = (*num_vbuffers)++;
|
||||
|
Reference in New Issue
Block a user