Module: wine Branch: master Commit: cbe717b8f3429a4ca30c1ac6276902cf486f1c27 URL: http://source.winehq.org/git/wine.git/?a=commit;h=cbe717b8f3429a4ca30c1ac627...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Mar 23 09:17:15 2015 +0100
wined3d: Take the input slot into account when handling WINED3D_APPEND_ALIGNED_ELEMENT.
---
dlls/wined3d/vertexdeclaration.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index df3d8ba..97992d6 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -218,14 +218,18 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
if (e->offset == WINED3D_APPEND_ALIGNED_ELEMENT) { - if (!i) - { - e->offset = 0; - } - else + const struct wined3d_vertex_declaration_element *prev; + unsigned int j; + + e->offset = 0; + for (j = 1; j <= i; ++j) { - struct wined3d_vertex_declaration_element *prev = &declaration->elements[i - 1]; - e->offset = (prev->offset + prev->format->byte_count + 3) & ~3; + prev = &declaration->elements[i - j]; + if (prev->input_slot == e->input_slot) + { + e->offset = (prev->offset + prev->format->byte_count + 3) & ~3; + break; + } } }