forked from Mirrors/wine-wine
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@gmail.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>stable
parent
96dab5abee
commit
13880f8e6a
|
@ -424,6 +424,9 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
|
||||||
debugstr_a(data), length, defines, include, debugstr_a(function), debugstr_a(profile),
|
debugstr_a(data), length, defines, include, debugstr_a(function), debugstr_a(profile),
|
||||||
flags, shader, error_msgs, constant_table);
|
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,
|
hr = D3DCompile(data, length, NULL, (D3D_SHADER_MACRO *)defines, (ID3DInclude *)include,
|
||||||
function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
|
function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
|
||||||
|
|
||||||
|
@ -504,6 +507,9 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO
|
||||||
return D3DXERR_INVALIDDATA;
|
return D3DXERR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (D3DX_SDK_VERSION <= 36)
|
||||||
|
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
|
||||||
|
|
||||||
hr = D3DCompile(buffer, len, filename_a, (const D3D_SHADER_MACRO *)defines,
|
hr = D3DCompile(buffer, len, filename_a, (const D3D_SHADER_MACRO *)defines,
|
||||||
(ID3DInclude *)include, entrypoint, profile, flags, 0,
|
(ID3DInclude *)include, entrypoint, profile, flags, 0,
|
||||||
(ID3DBlob **)shader, (ID3DBlob **)error_messages);
|
(ID3DBlob **)shader, (ID3DBlob **)error_messages);
|
||||||
|
|
Loading…
Reference in New Issue