[PATCH 4/5] wined3d: Take the input slot into account when handling WINED3D_APPEND_ALIGNED_ELEMENT.
Henri Verbeet
hverbeet at codeweavers.com
Mon Mar 23 03:17:15 CDT 2015
---
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;
+ }
}
}
--
1.7.10.4
More information about the wine-patches
mailing list