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

This commit is contained in:
Henri Verbeet 2015-03-23 09:17:15 +01:00 committed by Alexandre Julliard
parent f3765e9f77
commit cbe717b8f3
1 changed files with 11 additions and 7 deletions

View File

@ -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;
for (j = 1; j <= i; ++j)
{ {
e->offset = 0; prev = &declaration->elements[i - j];
} if (prev->input_slot == e->input_slot)
else {
{ e->offset = (prev->offset + prev->format->byte_count + 3) & ~3;
struct wined3d_vertex_declaration_element *prev = &declaration->elements[i - 1]; break;
e->offset = (prev->offset + prev->format->byte_count + 3) & ~3; }
} }
} }