[PATCH 1/2] wined3d: Return 1 for stream frequency if the value was not set.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39080 Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> --- dlls/wined3d/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e31ecc32e2..990b29bd73 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1477,7 +1477,7 @@ HRESULT CDECL wined3d_device_get_stream_source_freq(const struct wined3d_device TRACE("device %p, stream_idx %u, divider %p.\n", device, stream_idx, divider); stream = &device->state.streams[stream_idx]; - *divider = stream->flags | stream->frequency; + *divider = stream->flags | (stream->frequency || stream->flags ? stream->frequency : 1); TRACE("Returning %#x.\n", *divider); -- 2.20.1
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> --- 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)); -- 2.20.1
On Thu, 7 Feb 2019 at 23:14, Paul Gofman <gofmanp(a)gmail.com> wrote:
@@ -1477,7 +1477,7 @@ HRESULT CDECL wined3d_device_get_stream_source_freq(const struct wined3d_device TRACE("device %p, stream_idx %u, divider %p.\n", device, stream_idx, divider);
stream = &device->state.streams[stream_idx]; - *divider = stream->flags | stream->frequency; + *divider = stream->flags | (stream->frequency || stream->flags ? stream->frequency : 1);
Shouldn't we simply initialise the frequency to 1 in state_init_default() (and stateblock_state_init_default())?
participants (2)
-
Henri Verbeet -
Paul Gofman