Paul Gofman : d3dx9: Pass D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY when appropriate.
Alexandre Julliard
julliard at winehq.org
Mon Apr 20 15:01:56 CDT 2020
Module: wine
Branch: oldstable
Commit: 9d42b179a9c917e4e2c8504921d44c48f5682dc9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9d42b179a9c917e4e2c8504921d44c48f5682dc9
Author: Paul Gofman <gofmanp at gmail.com>
Date: Tue Jan 14 18:18:19 2020 +0100
d3dx9: Pass D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY when appropriate.
Manual testing shows that the backward compatible compilation is used
in d3dx9 versions below 37.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48302
Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 13880f8e6a0a972382de7de04b56bd1a414bef67)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/d3dx9_36/shader.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
index e8ce3dd796..10c75d556b 100644
--- a/dlls/d3dx9_36/shader.c
+++ b/dlls/d3dx9_36/shader.c
@@ -426,6 +426,9 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
debugstr_a(data), length, defines, include, debugstr_a(function), debugstr_a(profile),
flags, shader, error_msgs, constant_table);
+ if (D3DX_SDK_VERSION <= 36)
+ flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
+
hr = D3DCompile(data, length, NULL, (D3D_SHADER_MACRO *)defines, (ID3DInclude *)include,
function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
@@ -506,6 +509,9 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO
return D3DXERR_INVALIDDATA;
}
+ if (D3DX_SDK_VERSION <= 36)
+ flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
+
hr = D3DCompile(buffer, len, filename_a, (const D3D_SHADER_MACRO *)defines,
(ID3DInclude *)include, entrypoint, profile, flags, 0,
(ID3DBlob **)shader, (ID3DBlob **)error_messages);
More information about the wine-cvs
mailing list