https://git.reactos.org/?p=reactos.git;a=commitdiff;h=76955cb6aa33e3a6aa9ce0...
commit 76955cb6aa33e3a6aa9ce03da77c15f55d2f829a Author: winesync ros-dev@reactos.org AuthorDate: Mon Sep 21 23:01:50 2020 +0200 Commit: Jérôme Gardou jerome.gardou@reactos.org CommitDate: Thu Feb 4 16:37:04 2021 +0100
[WINESYNC] d3dx9: Implement d3dx_effect_BeginParameterBlock().
Signed-off-by: Paul Gofman gofmanp@gmail.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
wine commit id e281ba4db6654850caf713ab09aa6a2057e1d064 by Paul Gofman gofmanp@gmail.com --- dll/directx/wine/d3dx9_36/effect.c | 34 +++++++++++++++++++++++++--- modules/rostests/winetests/d3dx9_36/effect.c | 4 ++-- sdk/tools/winesync/d3dx9.cfg | 2 +- 3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index bc6ddb7722d..158a7437766 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -34,6 +34,7 @@ #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI)
static const char parameter_magic_string[4] = {'@', '!', '#', '\xFF'}; +static const char parameter_block_magic_string[4] = {'@', '!', '#', '\xFE'};
#define PARAMETER_FLAG_SHARED 1
@@ -151,6 +152,11 @@ struct d3dx_technique struct IDirect3DStateBlock9 *saved_state; };
+struct d3dx_parameter_block +{ + char magic_string[ARRAY_SIZE(parameter_block_magic_string)]; +}; + struct d3dx_effect { ID3DXEffect ID3DXEffect_iface; @@ -181,6 +187,8 @@ struct d3dx_effect unsigned int light_updated; D3DMATERIAL9 current_material; BOOL material_updated; + + struct d3dx_parameter_block *current_parameter_block; };
#define INITIAL_SHARED_DATA_SIZE 4 @@ -672,6 +680,14 @@ static void free_technique(struct d3dx_technique *technique) technique->name = NULL; }
+static void free_parameter_block(struct d3dx_parameter_block *block) +{ + if (!block) + return; + + heap_free(block); +} + static void d3dx_effect_cleanup(struct d3dx_effect *effect) { ID3DXEffectPool *pool; @@ -679,6 +695,8 @@ static void d3dx_effect_cleanup(struct d3dx_effect *effect)
TRACE("effect %p.\n", effect);
+ free_parameter_block(effect->current_parameter_block); + heap_free(effect->full_name_tmp);
if (effect->parameters) @@ -4049,11 +4067,21 @@ static HRESULT WINAPI d3dx_effect_GetStateManager(ID3DXEffect *iface, ID3DXEffec
static HRESULT WINAPI d3dx_effect_BeginParameterBlock(ID3DXEffect *iface) { - struct d3dx_effect *This = impl_from_ID3DXEffect(iface); + struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
- FIXME("(%p)->(): stub\n", This); + TRACE("iface %p.\n", iface);
- return E_NOTIMPL; + if (effect->current_parameter_block) + { + WARN("Parameter block is already started.\n"); + return D3DERR_INVALIDCALL; + } + + effect->current_parameter_block = heap_alloc_zero(sizeof(*effect->current_parameter_block)); + memcpy(effect->current_parameter_block->magic_string, parameter_block_magic_string, + sizeof(parameter_block_magic_string)); + + return D3D_OK; }
static D3DXHANDLE WINAPI d3dx_effect_EndParameterBlock(ID3DXEffect *iface) diff --git a/modules/rostests/winetests/d3dx9_36/effect.c b/modules/rostests/winetests/d3dx9_36/effect.c index 47237d7aef6..522039f1ae7 100644 --- a/modules/rostests/winetests/d3dx9_36/effect.c +++ b/modules/rostests/winetests/d3dx9_36/effect.c @@ -8080,9 +8080,9 @@ static void test_effect_parameter_block(void) ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
hr = effect->lpVtbl->BeginParameterBlock(effect); - todo_wine ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = effect->lpVtbl->BeginParameterBlock(effect); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); block = effect->lpVtbl->EndParameterBlock(effect); todo_wine ok(!!block, "Got unexpected block %p.\n", block); handle = effect->lpVtbl->EndParameterBlock(effect); diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 118bbd5df78..33a4c44b73d 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: 85d3ad879d5b13f7fce378009aaf80b419ad6185} +tags: {wine: e281ba4db6654850caf713ab09aa6a2057e1d064}