[PATCH 2/4] d3dx9: Pass the "flags" argument to D3DXFXCreateEffectEx() as compiler flags, not effect flags.
Matteo Bruni
matteo.mystral at gmail.com
Wed Feb 9 05:54:44 CST 2022
On Tue, Feb 8, 2022 at 12:42 AM Zebediah Figura <zfigura at codeweavers.com> wrote:
>
> And strip D3DXFX_* creation flags from them.
>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
> dlls/d3dx9_36/effect.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
> index e623c10035a..b8c957245a6 100644
> --- a/dlls/d3dx9_36/effect.c
> +++ b/dlls/d3dx9_36/effect.c
> @@ -6393,7 +6393,7 @@ static const char **parse_skip_constants_string(char *skip_constants_string, uns
>
> static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDevice9 *device,
> const char *data, SIZE_T data_size, const D3D_SHADER_MACRO *defines, ID3DInclude *include,
> - UINT eflags, ID3DBlob **errors, struct ID3DXEffectPool *pool, const char *skip_constants_string)
> + UINT flags, ID3DBlob **errors, struct ID3DXEffectPool *pool, const char *skip_constants_string)
> {
> #if D3DX_SDK_VERSION <= 36
> UINT compile_flags = D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
> @@ -6409,9 +6409,9 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev
> unsigned int i, j;
> HRESULT hr;
>
> - TRACE("effect %p, device %p, data %p, data_size %lu, defines %p, include %p, eflags %#x, errors %p, "
> + TRACE("effect %p, device %p, data %p, data_size %lu, defines %p, include %p, flags %#x, errors %p, "
> "pool %p, skip_constants %s.\n",
> - effect, device, data, data_size, defines, include, eflags, errors, pool,
> + effect, device, data, data_size, defines, include, flags, errors, pool,
> debugstr_a(skip_constants_string));
>
> effect->ID3DXEffect_iface.lpVtbl = &ID3DXEffect_Vtbl;
> @@ -6426,7 +6426,7 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev
> IDirect3DDevice9_AddRef(device);
> effect->device = device;
>
> - effect->flags = eflags;
> + effect->flags = flags;
>
> list_init(&effect->parameter_block_list);
>
> @@ -6436,8 +6436,9 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev
> if (tag != d3dx9_effect_version(9, 1))
> {
> TRACE("HLSL ASCII effect, trying to compile it.\n");
> + compile_flags |= flags & ~(D3DXFX_NOT_CLONEABLE | D3DXFX_LARGEADDRESSAWARE);
The D3DXFX_DONOTSAVE[*]STATE flags might also need to be filtered out.
They conflict with D3DXSHADER_DEBUG, D3DXSHADER_SKIPVALIDATION and
D3DXSHADER_SKIPOPTIMIZATION (and their D3DCOMPILE_ counterparts). It
might be possible to verify the expected behavior for those, or at
least for the validation flag.
> hr = D3DCompile(data, data_size, NULL, defines, include,
> - NULL, "fx_2_0", compile_flags, eflags, &bytecode, &temp_errors);
> + NULL, "fx_2_0", compile_flags, 0, &bytecode, &temp_errors);
> if (FAILED(hr))
> {
> WARN("Failed to compile ASCII effect.\n");
> --
> 2.34.1
>
>
More information about the wine-devel
mailing list