Commit abad305c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Emit position / attribute 0 last in draw_primitive_immediate_mode().

Emitting the position / attribute 0 provokes the actual vertex emission, so needs to happen last. This fixes a regression introduced by commit f3c155cc. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f69cf783
......@@ -214,9 +214,9 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const
unsigned int element_idx;
stride_idx = get_stride_idx(idx_data, idx_size, state->base_vertex_index, start_idx, vertex_idx);
for (element_idx = 0; use_map; use_map >>= 1, ++element_idx)
for (element_idx = MAX_ATTRIBS - 1; use_map; use_map &= ~(1u << element_idx), --element_idx)
{
if (!(use_map & 1u))
if (!(use_map & 1u << element_idx))
continue;
ptr = si->elements[element_idx].data.addr + si->elements[element_idx].stride * stride_idx;
......@@ -329,12 +329,6 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const
stride_idx = get_stride_idx(idx_data, idx_size, state->base_vertex_index, start_idx, vertex_idx);
if (position)
{
ptr = position + stride_idx * si->elements[WINED3D_FFP_POSITION].stride;
ops->position[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptr);
}
if (normal)
{
ptr = normal + stride_idx * si->elements[WINED3D_FFP_NORMAL].stride;
......@@ -379,6 +373,12 @@ static void draw_primitive_immediate_mode(struct wined3d_context *context, const
ops->texcoord[si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format->emit_idx](
GL_TEXTURE0_ARB + context->tex_unit_map[texture_idx], ptr);
}
if (position)
{
ptr = position + stride_idx * si->elements[WINED3D_FFP_POSITION].stride;
ops->position[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptr);
}
}
gl_info->gl_ops.gl.p_glEnd();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment