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

wined3d: Take the input slot into account when handling WINED3D_APPEND_ALIGNED_ELEMENT.

parent f3765e9f
...@@ -218,14 +218,18 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara ...@@ -218,14 +218,18 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
if (e->offset == WINED3D_APPEND_ALIGNED_ELEMENT) if (e->offset == WINED3D_APPEND_ALIGNED_ELEMENT)
{ {
if (!i) const struct wined3d_vertex_declaration_element *prev;
{ unsigned int j;
e->offset = 0;
} e->offset = 0;
else for (j = 1; j <= i; ++j)
{ {
struct wined3d_vertex_declaration_element *prev = &declaration->elements[i - 1]; prev = &declaration->elements[i - j];
e->offset = (prev->offset + prev->format->byte_count + 3) & ~3; if (prev->input_slot == e->input_slot)
{
e->offset = (prev->offset + prev->format->byte_count + 3) & ~3;
break;
}
} }
} }
......
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