diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 7c665d8a..fb0ad61b 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -361,6 +361,7 @@ patch_enable_all () enable_wined3d_WINED3D_TEXF_ANISOTROPIC="$1" enable_wined3d_mesa_texture_download="$1" enable_wined3d_multisample_quality="$1" + enable_wined3d_stream_frequency="$1" enable_wined3d_wined3d_guess_gl_vendor="$1" enable_winedbg_Process_Arguments="$1" enable_winedevice_Default_Drivers="$1" @@ -1247,6 +1248,9 @@ patch_enable () wined3d-multisample-quality) enable_wined3d_multisample_quality="$2" ;; + wined3d-stream-frequency) + enable_wined3d_stream_frequency="$2" + ;; wined3d-wined3d_guess_gl_vendor) enable_wined3d_wined3d_guess_gl_vendor="$2" ;; @@ -7338,6 +7342,21 @@ if test "$enable_wined3d_multisample_quality" -eq 1; then ) >> "$patchlist" fi +# Patchset wined3d-stream-frequency +# | +# | This patchset fixes the following Wine bugs: +# | * [#39080] wined3d: Return stream frequency of 1 if it was not set. +# | +# | Modified files: +# | * dlls/d3d9/tests/visual.c, dlls/wined3d/device.c +# | +if test "$enable_wined3d_stream_frequency" -eq 1; then + patch_apply wined3d-stream-frequency/0001-wined3d-Return-stream-frequency-of-1-if-it-was-not-s.patch + ( + printf '%s\n' '+ { "Paul Gofman", "wined3d: Return stream frequency of 1 if it was not set.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-wined3d_guess_gl_vendor # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wined3d-stream-frequency/0001-wined3d-Return-stream-frequency-of-1-if-it-was-not-s.patch b/patches/wined3d-stream-frequency/0001-wined3d-Return-stream-frequency-of-1-if-it-was-not-s.patch new file mode 100644 index 00000000..5206868f --- /dev/null +++ b/patches/wined3d-stream-frequency/0001-wined3d-Return-stream-frequency-of-1-if-it-was-not-s.patch @@ -0,0 +1,46 @@ +From 54d8899aa04476bc279b6551ce3ed04cf4461e0b Mon Sep 17 00:00:00 2001 +From: Paul Gofman +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 +--- + 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 + diff --git a/patches/wined3d-stream-frequency/definition b/patches/wined3d-stream-frequency/definition new file mode 100644 index 00000000..ab372e4f --- /dev/null +++ b/patches/wined3d-stream-frequency/definition @@ -0,0 +1 @@ +Fixes: [39080] wined3d: Return stream frequency of 1 if it was not set.