From: Elizabeth Figura zfigura@codeweavers.com
This reflects native, and may be necessary to reflect changes in behaviour before version 33 (although no such differences are yet known to matter).
By supplying the D3DX SDK version we also now reflect differences in behaviour between different D3DX versions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33770 --- dlls/d3dx9_24/Makefile.in | 2 +- dlls/d3dx9_25/Makefile.in | 2 +- dlls/d3dx9_26/Makefile.in | 2 +- dlls/d3dx9_27/Makefile.in | 2 +- dlls/d3dx9_28/Makefile.in | 2 +- dlls/d3dx9_29/Makefile.in | 2 +- dlls/d3dx9_30/Makefile.in | 2 +- dlls/d3dx9_31/Makefile.in | 2 +- dlls/d3dx9_32/Makefile.in | 2 +- dlls/d3dx9_33/Makefile.in | 2 +- dlls/d3dx9_34/Makefile.in | 2 +- dlls/d3dx9_35/Makefile.in | 2 +- dlls/d3dx9_36/Makefile.in | 2 +- dlls/d3dx9_36/shader.c | 28 +++++++++++++++++----------- dlls/d3dx9_37/Makefile.in | 2 +- dlls/d3dx9_38/Makefile.in | 2 +- dlls/d3dx9_39/Makefile.in | 2 +- dlls/d3dx9_40/Makefile.in | 2 +- dlls/d3dx9_41/Makefile.in | 2 +- 19 files changed, 35 insertions(+), 29 deletions(-)
diff --git a/dlls/d3dx9_24/Makefile.in b/dlls/d3dx9_24/Makefile.in index d0fef3bebd0..3f3fc57bfb5 100644 --- a/dlls/d3dx9_24/Makefile.in +++ b/dlls/d3dx9_24/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=24 MODULE = d3dx9_24.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_25/Makefile.in b/dlls/d3dx9_25/Makefile.in index 869c1162904..93691cfb23d 100644 --- a/dlls/d3dx9_25/Makefile.in +++ b/dlls/d3dx9_25/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=25 MODULE = d3dx9_25.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_26/Makefile.in b/dlls/d3dx9_26/Makefile.in index ae3f2e18953..b7369e7810e 100644 --- a/dlls/d3dx9_26/Makefile.in +++ b/dlls/d3dx9_26/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=26 MODULE = d3dx9_26.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_27/Makefile.in b/dlls/d3dx9_27/Makefile.in index 4f2993638f3..da4e396db86 100644 --- a/dlls/d3dx9_27/Makefile.in +++ b/dlls/d3dx9_27/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=27 MODULE = d3dx9_27.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_28/Makefile.in b/dlls/d3dx9_28/Makefile.in index 3c7ddb93c2e..b321e3605af 100644 --- a/dlls/d3dx9_28/Makefile.in +++ b/dlls/d3dx9_28/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=28 MODULE = d3dx9_28.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_29/Makefile.in b/dlls/d3dx9_29/Makefile.in index 75eb3e73243..c1bee84ca0c 100644 --- a/dlls/d3dx9_29/Makefile.in +++ b/dlls/d3dx9_29/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=29 MODULE = d3dx9_29.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_30/Makefile.in b/dlls/d3dx9_30/Makefile.in index 9b8eb133611..da162dae334 100644 --- a/dlls/d3dx9_30/Makefile.in +++ b/dlls/d3dx9_30/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=30 MODULE = d3dx9_30.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_31/Makefile.in b/dlls/d3dx9_31/Makefile.in index 52d3a3d0986..d973244f620 100644 --- a/dlls/d3dx9_31/Makefile.in +++ b/dlls/d3dx9_31/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=31 MODULE = d3dx9_31.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_32/Makefile.in b/dlls/d3dx9_32/Makefile.in index 70a1696de97..1b2fb450b92 100644 --- a/dlls/d3dx9_32/Makefile.in +++ b/dlls/d3dx9_32/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=32 MODULE = d3dx9_32.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in index 2c01e9da3d9..038280385e3 100644 --- a/dlls/d3dx9_33/Makefile.in +++ b/dlls/d3dx9_33/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=33 MODULE = d3dx9_33.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_34/Makefile.in b/dlls/d3dx9_34/Makefile.in index 1e317f37226..1cb2deace74 100644 --- a/dlls/d3dx9_34/Makefile.in +++ b/dlls/d3dx9_34/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=34 MODULE = d3dx9_34.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_35/Makefile.in b/dlls/d3dx9_35/Makefile.in index 859cef9b1ce..0c8d93acf7e 100644 --- a/dlls/d3dx9_35/Makefile.in +++ b/dlls/d3dx9_35/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=35 MODULE = d3dx9_35.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index 5370b3e7e7a..798ae4c2c1d 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -1,7 +1,7 @@ EXTRADEFS = -DD3DX_SDK_VERSION=36 MODULE = d3dx9_36.dll IMPORTLIB = d3dx9 -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d DELAYIMPORTS = windowscodecs
EXTRADLLFLAGS = -Wb,--prefer-native diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 88c4916b74d..dec6352d174 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -431,6 +431,12 @@ HRESULT WINAPI D3DXAssembleShaderFromResourceW(HMODULE module, const WCHAR *reso shader, error_messages); }
+HRESULT WINAPI vkd3d_D3DCompile2VKD3D(const void *data, SIZE_T data_size, const char *filename, + const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, + const char *target, UINT flags, UINT effect_flags, UINT secondary_flags, + const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader, + ID3DBlob **error_messages, unsigned int compiler_version); + HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO *defines, ID3DXInclude *include, const char *function, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_msgs, ID3DXConstantTable **constant_table) @@ -443,10 +449,18 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO flags, shader, error_msgs, constant_table);
if (D3DX_SDK_VERSION <= 36) - flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY; + flags |= D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY; + +#if D3DX_SDK_VERSION < 42 + if (shader) + *shader = NULL;
+ hr = vkd3d_D3DCompile2VKD3D(data, length, NULL, (D3D_SHADER_MACRO *)defines, (ID3DInclude *)include, + function, profile, flags, 0, 0, NULL, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs, D3DX_SDK_VERSION); +#else hr = D3DCompile(data, length, NULL, (D3D_SHADER_MACRO *)defines, (ID3DInclude *)include, function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs); +#endif
if (SUCCEEDED(hr) && constant_table) { @@ -526,16 +540,8 @@ 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); - - if (SUCCEEDED(hr) && constant_table) - hr = D3DXGetShaderConstantTable(ID3DXBuffer_GetBufferPointer(*shader), - constant_table); + hr = D3DXCompileShader(buffer, len, defines, include, entrypoint, + profile, flags, shader, error_messages, constant_table);
ID3DXInclude_Close(include, buffer); LeaveCriticalSection(&from_file_mutex); diff --git a/dlls/d3dx9_37/Makefile.in b/dlls/d3dx9_37/Makefile.in index 150f1ceb215..b61c8ceddf5 100644 --- a/dlls/d3dx9_37/Makefile.in +++ b/dlls/d3dx9_37/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=37 MODULE = d3dx9_37.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_38/Makefile.in b/dlls/d3dx9_38/Makefile.in index 5706fe9b203..4d9a11580bc 100644 --- a/dlls/d3dx9_38/Makefile.in +++ b/dlls/d3dx9_38/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=38 MODULE = d3dx9_38.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_39/Makefile.in b/dlls/d3dx9_39/Makefile.in index 9e8f8f6199e..6ff59e7b98e 100644 --- a/dlls/d3dx9_39/Makefile.in +++ b/dlls/d3dx9_39/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=39 MODULE = d3dx9_39.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_40/Makefile.in b/dlls/d3dx9_40/Makefile.in index fe10a5d3dcb..ae63a814403 100644 --- a/dlls/d3dx9_40/Makefile.in +++ b/dlls/d3dx9_40/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=40 MODULE = d3dx9_40.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs
diff --git a/dlls/d3dx9_41/Makefile.in b/dlls/d3dx9_41/Makefile.in index bc02a280d33..9fdc2884e1b 100644 --- a/dlls/d3dx9_41/Makefile.in +++ b/dlls/d3dx9_41/Makefile.in @@ -1,6 +1,6 @@ EXTRADEFS = -DD3DX_SDK_VERSION=41 MODULE = d3dx9_41.dll -IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d PARENTSRC = ../d3dx9_36 DELAYIMPORTS = windowscodecs