Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39080 Signed-off-by: Paul Gofman gofmanp@gmail.com --- v2: - initialize streams' frequencies to 1 instead of handling uninitialized case.
dlls/wined3d/context.c | 2 +- dlls/wined3d/stateblock.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index c7eb7849fc..ae94daba2e 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -5390,7 +5390,7 @@ static void context_load_numbered_arrays(struct wined3d_context *context, stream = &state->streams[element->stream_idx];
if ((stream->flags & WINED3DSTREAMSOURCE_INSTANCEDATA) && !context->instance_count) - context->instance_count = state->streams[0].frequency ? state->streams[0].frequency : 1; + context->instance_count = state->streams[0].frequency;
if (gl_info->supported[ARB_INSTANCED_ARRAYS]) { diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index b694414382..9da99d7302 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1448,6 +1448,9 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->blend_factor.g = 1.0f; state->blend_factor.b = 1.0f; state->blend_factor.a = 1.0f; + + for (i = 0; i < MAX_STREAMS; ++i) + state->streams[i].frequency = 1; }
void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, @@ -1496,6 +1499,9 @@ static void stateblock_state_init_default(struct wined3d_stateblock_state *state state->blend_factor.g = 1.0f; state->blend_factor.b = 1.0f; state->blend_factor.a = 1.0f; + + for (i = 0; i < MAX_STREAMS; ++i) + state->streams[i].frequency = 1; }
void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state,
Signed-off-by: Paul Gofman gofmanp@gmail.com --- v2: - no changes.
dlls/d3d9/tests/visual.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index bd3b8bc79d..800e07bdc9 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -12419,9 +12419,15 @@ static void stream_test(void) goto done; }
- /* set the default value because it isn't done in wine? */ + hr = IDirect3DDevice9_GetStreamSourceFreq(device, 0, &ind); + ok(hr == D3D_OK && ind == 1, "IDirect3DDevice9_GetStreamSourceFreq unexpected result, " + "hr %#x, ind %#x.\n", hr, ind); + hr = IDirect3DDevice9_GetStreamSourceFreq(device, 1, &ind); + ok(hr == D3D_OK && ind == 1, "IDirect3DDevice9_GetStreamSourceFreq unexpected result, " + "hr %#x, ind %#x.\n", hr, ind); + hr = IDirect3DDevice9_SetStreamSourceFreq(device, 1, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x\n", hr); + ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed, hr %#x.\n", hr);
/* check for D3DSTREAMSOURCE_INDEXEDDATA at stream0 */ hr = IDirect3DDevice9_SetStreamSourceFreq(device, 0, (D3DSTREAMSOURCE_INSTANCEDATA | 1));
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47349
Your paranoid android.
=== w8 (32 bit report) ===
d3d9: visual.c:8750: Test failed: Got unexpected color 0x00007580 for quad 2 (different colors).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On Fri, 8 Feb 2019 at 20:04, Paul Gofman gofmanp@gmail.com wrote:
v2: - initialize streams' frequencies to 1 instead of handling uninitialized case.
dlls/wined3d/context.c | 2 +- dlls/wined3d/stateblock.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
This is fine, but perhaps "wined3d: Initialise stream frequency to 1." would be a more appropriate subject line.