1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

d3d10: Use older compiler for D3D10CompileEffectFromMemory().

Compilation output from D3D10CompileEffectFromMemory() always
contains $Globals buffer, even if it's empty. That matches
behaviour of 33-39 compilers.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2024-03-28 10:59:35 +01:00 committed by Alexandre Julliard
parent 69b049d1b6
commit 36a4e5c9bb
5 changed files with 14 additions and 5 deletions

View File

@ -1,11 +1,12 @@
MODULE = d3d10.dll
IMPORTLIB = d3d10
IMPORTS = uuid d3d10core d3dcompiler dxgi wined3d
IMPORTS = uuid d3d10core d3dcompiler_39 dxgi wined3d
EXTRADEFS = -DD3D_COMPILER_VERSION=0
PARENTSRC = ../d3dcompiler_43
EXTRAINCL = $(VKD3D_PE_CFLAGS)
SOURCES = \
blob.c \
d3d10_main.c \
effect.c \
reflection.c \

View File

@ -239,7 +239,7 @@ HRESULT WINAPI D3D10CompileEffectFromMemory(void *data, SIZE_T data_size, const
data, data_size, wine_dbgstr_a(filename), defines, include,
hlsl_flags, fx_flags, effect, errors);
return D3DCompile(data, data_size, filename, defines, include,
return D3DCompileFromMemory(data, data_size, filename, defines, include,
NULL, "fx_4_0", hlsl_flags, fx_flags, effect, errors);
}

View File

@ -315,4 +315,12 @@ HRESULT d3d10_effect_parse(struct d3d10_effect *effect, const void *data, SIZE_T
HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter,
unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device);
/* d3dcompiler_39 function prototypes */
HRESULT WINAPI D3DCompileFromMemory(const void *data, SIZE_T data_size, const char *filename,
const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages);
HRESULT WINAPI D3DDisassembleCode(const void *data, SIZE_T data_size,
UINT flags, const char *comments, ID3DBlob **disassembly);
#endif /* __WINE_D3D10_PRIVATE_H */

View File

@ -26,8 +26,7 @@ HRESULT WINAPI D3D10CompileShader(const char *data, SIZE_T data_size, const char
const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entrypoint,
const char *profile, UINT flags, ID3D10Blob **shader, ID3D10Blob **error_messages)
{
/* Forward to d3dcompiler */
return D3DCompile(data, data_size, filename, defines, include,
return D3DCompileFromMemory(data, data_size, filename, defines, include,
entrypoint, profile, flags, 0, shader, error_messages);
}
@ -37,5 +36,5 @@ HRESULT WINAPI D3D10DisassembleShader(const void *data, SIZE_T data_size,
TRACE("data %p, data_size %#Ix, color_code %#x, comments %p, disassembly %p.\n",
data, data_size, color_code, comments, disassembly);
return D3DDisassemble(data, data_size, color_code ? D3D_DISASM_ENABLE_COLOR_CODE : 0, comments, disassembly);
return D3DDisassembleCode(data, data_size, color_code ? D3D_DISASM_ENABLE_COLOR_CODE : 0, comments, disassembly);
}

View File

@ -1,4 +1,5 @@
MODULE = d3dcompiler_39.dll
IMPORTLIB = d3dcompiler_39
IMPORTS = wined3d
EXTRADEFS = -DD3D_COMPILER_VERSION=39
PARENTSRC = ../d3dcompiler_43