From 7d1fa6a11152bc5f3207bc8b93522eba4753733f Mon Sep 17 00:00:00 2001 From: winesync Date: Mon, 21 Sep 2020 23:03:24 +0200 Subject: [PATCH] [WINESYNC] 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 Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard wine commit id 13880f8e6a0a972382de7de04b56bd1a414bef67 by Paul Gofman --- dll/directx/wine/d3dx9_36/shader.c | 6 ++++++ sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dll/directx/wine/d3dx9_36/shader.c b/dll/directx/wine/d3dx9_36/shader.c index 8ef4f38af18..6a038265d11 100644 --- a/dll/directx/wine/d3dx9_36/shader.c +++ b/dll/directx/wine/d3dx9_36/shader.c @@ -428,6 +428,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); @@ -508,6 +511,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); diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 1ac83465926..904bff57f85 100644 --- a/sdk/tools/winesync/d3dx9.cfg +++ b/sdk/tools/winesync/d3dx9.cfg @@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h: sdk/inc include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h: sdk/include/dxsdk/d3dx9of.h, include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h: sdk/include/dxsdk/d3dx9shape.h, include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h} -tags: {wine: 96dab5abeedbb0908ac11915464f71eb74383bd7} +tags: {wine: 13880f8e6a0a972382de7de04b56bd1a414bef67}