Added wined3d-stream-frequency patchset

This commit is contained in:
Alistair Leslie-Hughes
2019-01-25 16:05:43 +11:00
parent 8a60fbdd19
commit 3b56f9ccef
3 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
From 54d8899aa04476bc279b6551ce3ed04cf4461e0b Mon Sep 17 00:00:00 2001
From: Paul Gofman <gofmanp@gmail.com>
Date: Tue, 22 Jan 2019 17:03:14 +0300
Subject: [PATCH] wined3d: Return stream frequency of 1 if it was not set.
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=39080
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
---
dlls/d3d9/tests/visual.c | 7 +++++++
dlls/wined3d/device.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index fb1c7ef21d..7278051ddc 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -12416,6 +12416,13 @@ static void stream_test(void)
goto done;
}
+ hr = IDirect3DDevice9_GetStreamSourceFreq(device, 0, &ind);
+ ok(hr == D3D_OK && ind == 1, "IDirect3DDevice9_GetStreamSourceFreq unexpected result,"
+ " hr %08x, ind %U.\n", hr, ind);
+ hr = IDirect3DDevice9_GetStreamSourceFreq(device, 1, &ind);
+ ok(hr == D3D_OK && ind == 1, "IDirect3DDevice9_GetStreamSourceFreq unexpected result,"
+ " hr %08x, ind %U.\n", hr, ind);
+
/* set the default value because it isn't done in wine? */
hr = IDirect3DDevice9_SetStreamSourceFreq(device, 1, 1);
ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x\n", hr);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9fa27f65e5..0f1406c90b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1476,7 +1476,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

View File

@@ -0,0 +1 @@
Fixes: [39080] wined3d: Return stream frequency of 1 if it was not set.