Module: wine Branch: oldstable Commit: 6c6b34839dcff1919a1c2191ed2fe17d93f10ce1 URL: https://source.winehq.org/git/wine.git/?a=commit;h=6c6b34839dcff1919a1c2191e...
Author: Paul Gofman gofmanp@gmail.com Date: Tue Oct 29 02:23:12 2019 +0300
d3d8: Fix stream data skip count in convert_to_wined3d_declaration().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40364 Signed-off-by: Paul Gofman gofmanp@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit 5e10f1d339aaf798374917ba039363072a867c1e) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/d3d8/tests/visual.c | 17 ++++++++++++----- dlls/d3d8/vertexdeclaration.c | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index cc5992281f..e085270d1c 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -7746,13 +7746,19 @@ static void test_vshader_input(void) {{ 0.0f, 0.0f, 0.1f}, 0x00ff8040}, {{ 1.0f, -1.0f, 0.1f}, 0x00ff8040}, {{ 1.0f, 0.0f, 0.1f}, 0x00ff8040}, - }, + }; + static const struct + { + struct vec3 position; + struct vec3 dummy; /* testing D3DVSD_SKIP */ + DWORD diffuse; + } quad3_color[] = { - {{-1.0f, 0.0f, 0.1f}, 0x00ff8040}, - {{-1.0f, 1.0f, 0.1f}, 0x00ff8040}, - {{ 0.0f, 0.0f, 0.1f}, 0x00ff8040}, - {{ 0.0f, 1.0f, 0.1f}, 0x00ff8040}, + {{-1.0f, 0.0f, 0.1f}, {0.0f}, 0x00ff8040}, + {{-1.0f, 1.0f, 0.1f}, {0.0f}, 0x00ff8040}, + {{ 0.0f, 0.0f, 0.1f}, {0.0f}, 0x00ff8040}, + {{ 0.0f, 1.0f, 0.1f}, {0.0f}, 0x00ff8040}, }; static const float quad4_color[] = { @@ -7803,6 +7809,7 @@ static void test_vshader_input(void) { D3DVSD_STREAM(0), D3DVSD_REG(0, D3DVSDT_FLOAT3), /* position */ + D3DVSD_SKIP(3), /* not used */ D3DVSD_REG(5, D3DVSDT_D3DCOLOR), /* diffuse */ D3DVSD_END() }; diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c index 0cae3cd8c6..1cde622f28 100644 --- a/dlls/d3d8/vertexdeclaration.c +++ b/dlls/d3d8/vertexdeclaration.c @@ -294,8 +294,8 @@ static UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3
offset += wined3d_type_sizes[type]; } else if (token_type == D3DVSD_TOKEN_STREAMDATA && (*token & D3DVSD_DATALOADTYPEMASK)) { - TRACE(" 0x%08x SKIP(%u)\n", token_type, ((token_type & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT)); - offset += sizeof(DWORD) * ((token_type & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT); + TRACE(" 0x%08x SKIP(%u)\n", *token, (*token & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT); + offset += sizeof(DWORD) * ((*token & D3DVSD_SKIPCOUNTMASK) >> D3DVSD_SKIPCOUNTSHIFT); }
if (element_count >= 127) {