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:
Marek Olšák
2024-01-04 02:30:11 -05:00
committed by Marge Bot
parent 3363d41a20
commit 7dd66244af

View File

@@ -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)++;