ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2021
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
30 participants
434 discussions
Start a n
N
ew thread
[reactos] 99/218: [WINESYNC] d3dx9: Secure against unsafe iface to COM object transitions.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9add999c513f92e72545f…
commit 9add999c513f92e72545ffcbedaf03ff8dd4170a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Secure against unsafe iface to COM object transitions. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id cd3e5020e4c87f49eb042fff9f607b6d745a5d55 by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 13 ++++++++++++- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index cd022dbf0ec..52908a274f1 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -1772,6 +1772,8 @@ static inline struct d3dx_effect_pool *impl_from_ID3DXEffectPool(ID3DXEffectPool return CONTAINING_RECORD(iface, struct d3dx_effect_pool, ID3DXEffectPool_iface); } +static inline struct d3dx_effect_pool *unsafe_impl_from_ID3DXEffectPool(ID3DXEffectPool *iface); + static inline struct d3dx_effect *impl_from_ID3DXEffect(ID3DXEffect *iface) { return CONTAINING_RECORD(iface, struct d3dx_effect, ID3DXEffect_iface); @@ -6168,8 +6170,8 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev if (pool) { + effect->pool = unsafe_impl_from_ID3DXEffectPool(pool); pool->lpVtbl->AddRef(pool); - effect->pool = impl_from_ID3DXEffectPool(pool); } IDirect3DDevice9_AddRef(device); @@ -6481,6 +6483,15 @@ static const struct ID3DXEffectPoolVtbl ID3DXEffectPool_Vtbl = d3dx_effect_pool_Release }; +static inline struct d3dx_effect_pool *unsafe_impl_from_ID3DXEffectPool(ID3DXEffectPool *iface) +{ + if (!iface) + return NULL; + + assert(iface->lpVtbl == &ID3DXEffectPool_Vtbl); + return impl_from_ID3DXEffectPool(iface); +} + HRESULT WINAPI D3DXCreateEffectPool(ID3DXEffectPool **pool) { struct d3dx_effect_pool *object; diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 2a08def01b1..616db55328b 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: 3b951b77f87ed9102fc7a2ccb0807b5592990147} +tags: {wine: cd3e5020e4c87f49eb042fff9f607b6d745a5d55}
3 years, 10 months
1
0
0
0
[reactos] 98/218: [WINESYNC] d3dx9: Get rid of struct d3dx9_base_effect.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=13aa089045b698366305b…
commit 13aa089045b698366305bee8f832812fa603fd0c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Get rid of struct d3dx9_base_effect. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3b951b77f87ed9102fc7a2ccb0807b5592990147 by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 15 +++------------ sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index bfd9d5a4048..cd022dbf0ec 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -152,20 +152,11 @@ struct d3dx_technique struct IDirect3DStateBlock9 *saved_state; }; -struct d3dx9_base_effect -{ - struct d3dx_effect *effect; - - - ULONG64 version_counter; -}; - struct d3dx_effect { ID3DXEffect ID3DXEffect_iface; LONG ref; - struct d3dx9_base_effect base_effect; unsigned int parameter_count; unsigned int technique_count; unsigned int object_count; @@ -173,6 +164,7 @@ struct d3dx_effect struct d3dx_technique *techniques; struct d3dx_object *objects; DWORD flags; + struct wine_rb_tree param_tree; char *full_name_tmp; unsigned int full_name_tmp_size; @@ -184,6 +176,7 @@ struct d3dx_effect struct d3dx_pass *active_pass; BOOL started; DWORD begin_flags; + ULONG64 version_counter; D3DLIGHT9 current_light[8]; unsigned int light_updated; @@ -1130,7 +1123,7 @@ static BOOL walk_parameter_tree(struct d3dx_parameter *param, walk_parameter_dep static ULONG64 *get_version_counter_ptr(struct d3dx_effect *effect) { - return effect->pool ? &effect->pool->version_counter : &effect->base_effect.version_counter; + return effect->pool ? &effect->pool->version_counter : &effect->version_counter; } static ULONG64 next_effect_update_version(struct d3dx_effect *effect) @@ -6156,7 +6149,6 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev #else UINT compile_flags = 0; #endif - struct d3dx9_base_effect *base = &effect->base_effect; ID3DBlob *bytecode = NULL, *temp_errors = NULL; unsigned int skip_constants_count = 0; char *skip_constants_buffer = NULL; @@ -6183,7 +6175,6 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev IDirect3DDevice9_AddRef(device); effect->device = device; - base->effect = effect; effect->flags = eflags; read_dword(&ptr, &tag); diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index e5844e9ca1f..2a08def01b1 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: 7f16670edc3ed5c8ab5bdd88e88a00f8ba1853dc} +tags: {wine: 3b951b77f87ed9102fc7a2ccb0807b5592990147}
3 years, 10 months
1
0
0
0
[reactos] 97/218: [WINESYNC] d3dx9: Move flags out of struct d3dx9_base_effect.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b2df33e579ba7b8ccf9cf…
commit b2df33e579ba7b8ccf9cfc63461357100220ad81 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Move flags out of struct d3dx9_base_effect. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7f16670edc3ed5c8ab5bdd88e88a00f8ba1853dc by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 11 +++++------ sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index 69c078d2dee..bfd9d5a4048 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -156,7 +156,6 @@ struct d3dx9_base_effect { struct d3dx_effect *effect; - DWORD flags; ULONG64 version_counter; }; @@ -173,6 +172,7 @@ struct d3dx_effect struct d3dx_top_level_parameter *parameters; struct d3dx_technique *techniques; struct d3dx_object *objects; + DWORD flags; struct wine_rb_tree param_tree; char *full_name_tmp; unsigned int full_name_tmp_size; @@ -507,8 +507,7 @@ static struct d3dx_parameter *get_valid_parameter(struct d3dx_effect *effect, D3 sizeof(parameter_magic_string))) return handle_param; - return effect->base_effect.flags & D3DXFX_LARGEADDRESSAWARE - ? NULL : get_parameter_by_name(effect, NULL, parameter); + return effect->flags & D3DXFX_LARGEADDRESSAWARE ? NULL : get_parameter_by_name(effect, NULL, parameter); } static void free_state(struct d3dx_state *state) @@ -1918,7 +1917,7 @@ static HRESULT WINAPI d3dx_effect_GetPassDesc(ID3DXEffect *iface, D3DXHANDLE pas desc->pVertexShaderFunction = NULL; desc->pPixelShaderFunction = NULL; - if (effect->base_effect.flags & D3DXFX_NOT_CLONEABLE) + if (effect->flags & D3DXFX_NOT_CLONEABLE) return D3D_OK; for (i = 0; i < pass->state_count; ++i) @@ -4101,7 +4100,7 @@ static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface, IDirect3DDevic if (!new_effect) return D3DERR_INVALIDCALL; - if (effect->base_effect.flags & D3DXFX_NOT_CLONEABLE) + if (effect->flags & D3DXFX_NOT_CLONEABLE) return E_FAIL; if (!device) @@ -6185,7 +6184,7 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev effect->device = device; base->effect = effect; - base->flags = eflags; + effect->flags = eflags; read_dword(&ptr, &tag); TRACE("Tag: %x\n", tag); diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 50683c00a48..e5844e9ca1f 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: c56906599cdad729834a6807747ce2c928fc511d} +tags: {wine: 7f16670edc3ed5c8ab5bdd88e88a00f8ba1853dc}
3 years, 10 months
1
0
0
0
[reactos] 96/218: [WINESYNC] d3dx9: Avoid using This in d3dx_effect_Clone().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9fd48117e669370b7fe15…
commit 9fd48117e669370b7fe15e53ca733684e2d548fd Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Avoid using This in d3dx_effect_Clone(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id c56906599cdad729834a6807747ce2c928fc511d by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 12 ++++++------ sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index 0dc42b5931d..69c078d2dee 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -4091,17 +4091,17 @@ static HRESULT WINAPI d3dx_effect_DeleteParameterBlock(ID3DXEffect *iface, D3DXH } #endif -static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface, struct IDirect3DDevice9 *device, - struct ID3DXEffect **effect) +static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface, IDirect3DDevice9 *device, + ID3DXEffect **new_effect) { - struct d3dx_effect *This = impl_from_ID3DXEffect(iface); + struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - FIXME("(%p)->(%p, %p): stub\n", This, device, effect); + FIXME("iface %p, device %p, new_effect %p stub.\n", effect, device, new_effect); - if (!effect) + if (!new_effect) return D3DERR_INVALIDCALL; - if (This->base_effect.flags & D3DXFX_NOT_CLONEABLE) + if (effect->base_effect.flags & D3DXFX_NOT_CLONEABLE) return E_FAIL; if (!device) diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 09089bd67da..50683c00a48 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: ef974e59856d702523ef04b5e315d0c980097c8d} +tags: {wine: c56906599cdad729834a6807747ce2c928fc511d}
3 years, 10 months
1
0
0
0
[reactos] 95/218: [WINESYNC] d3dx9: Merge the two pool fields of struct d3dx_effect.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c660479aedaa7e7348c5…
commit 2c660479aedaa7e7348c5cdc518272222cd8ac15 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Merge the two pool fields of struct d3dx_effect. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ef974e59856d702523ef04b5e315d0c980097c8d by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 21 ++++++++++----------- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index 393efae5c7b..0dc42b5931d 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -156,7 +156,6 @@ struct d3dx9_base_effect { struct d3dx_effect *effect; - struct d3dx_effect_pool *pool; DWORD flags; ULONG64 version_counter; @@ -180,7 +179,7 @@ struct d3dx_effect struct ID3DXEffectStateManager *manager; struct IDirect3DDevice9 *device; - struct ID3DXEffectPool *pool; + struct d3dx_effect_pool *pool; struct d3dx_technique *active_technique; struct d3dx_pass *active_pass; BOOL started; @@ -683,6 +682,7 @@ static void free_technique(struct d3dx_technique *technique) static void d3dx_effect_cleanup(struct d3dx_effect *effect) { + ID3DXEffectPool *pool; unsigned int i; TRACE("effect %p.\n", effect); @@ -711,7 +711,10 @@ static void d3dx_effect_cleanup(struct d3dx_effect *effect) } if (effect->pool) - effect->pool->lpVtbl->Release(effect->pool); + { + pool = &effect->pool->ID3DXEffectPool_iface; + pool->lpVtbl->Release(pool); + } if (effect->manager) IUnknown_Release(effect->manager); @@ -1128,7 +1131,7 @@ static BOOL walk_parameter_tree(struct d3dx_parameter *param, walk_parameter_dep static ULONG64 *get_version_counter_ptr(struct d3dx_effect *effect) { - return effect->base_effect.pool ? &effect->base_effect.pool->version_counter : &effect->base_effect.version_counter; + return effect->pool ? &effect->pool->version_counter : &effect->base_effect.version_counter; } static ULONG64 next_effect_update_version(struct d3dx_effect *effect) @@ -3540,7 +3543,7 @@ static HRESULT WINAPI d3dx_effect_GetPool(ID3DXEffect *iface, ID3DXEffectPool ** *pool = NULL; if (effect->pool) { - *pool = effect->pool; + *pool = &effect->pool->ID3DXEffectPool_iface; (*pool)->lpVtbl->AddRef(*pool); } @@ -5941,7 +5944,6 @@ static BOOL param_set_top_level_param(void *top_level_param, struct d3dx_paramet static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, UINT data_size, DWORD start, const char **skip_constants, unsigned int skip_constants_count) { - struct d3dx9_base_effect *base = &effect->base_effect; const char *ptr = data + start; UINT stringcount, resourcecount; HRESULT hr; @@ -6051,7 +6053,7 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U for (i = 0; i < effect->parameter_count; ++i) { - if (FAILED(hr = d3dx_pool_sync_shared_parameter(base->pool, &effect->parameters[i]))) + if (FAILED(hr = d3dx_pool_sync_shared_parameter(effect->pool, &effect->parameters[i]))) goto err_out; effect->parameters[i].version_counter = get_version_counter_ptr(effect); set_dirty(&effect->parameters[i].param); @@ -6157,7 +6159,6 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev #endif struct d3dx9_base_effect *base = &effect->base_effect; ID3DBlob *bytecode = NULL, *temp_errors = NULL; - struct d3dx_effect_pool *pool_impl = NULL; unsigned int skip_constants_count = 0; char *skip_constants_buffer = NULL; const char **skip_constants = NULL; @@ -6177,15 +6178,13 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev if (pool) { pool->lpVtbl->AddRef(pool); - pool_impl = impl_from_ID3DXEffectPool(pool); + effect->pool = impl_from_ID3DXEffectPool(pool); } - effect->pool = pool; IDirect3DDevice9_AddRef(device); effect->device = device; base->effect = effect; - base->pool = pool_impl; base->flags = eflags; read_dword(&ptr, &tag); diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 4cfdb06fce5..09089bd67da 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: 3bd0fc3d6ad75ec723f2268e2d6de79be904de2c} +tags: {wine: ef974e59856d702523ef04b5e315d0c980097c8d}
3 years, 10 months
1
0
0
0
[reactos] 94/218: [WINESYNC] d3dx9: Avoid using 'This' in d3dx_effect_GetPool().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=234a3a63899280d73d516…
commit 234a3a63899280d73d516d16ecbe994ecb473e52 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Avoid using 'This' in d3dx_effect_GetPool(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3bd0fc3d6ad75ec723f2268e2d6de79be904de2c by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 14 +++++++------- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index 6fdca701fca..393efae5c7b 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -3527,9 +3527,9 @@ static HRESULT WINAPI d3dx_effect_SetArrayRange(ID3DXEffect *iface, D3DXHANDLE p /*** ID3DXEffect methods ***/ static HRESULT WINAPI d3dx_effect_GetPool(ID3DXEffect *iface, ID3DXEffectPool **pool) { - struct d3dx_effect *This = impl_from_ID3DXEffect(iface); + struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - TRACE("iface %p, pool %p\n", This, pool); + TRACE("iface %p, pool %p.\n", effect, pool); if (!pool) { @@ -3537,14 +3537,14 @@ static HRESULT WINAPI d3dx_effect_GetPool(ID3DXEffect *iface, ID3DXEffectPool ** return D3DERR_INVALIDCALL; } - if (This->pool) + *pool = NULL; + if (effect->pool) { - This->pool->lpVtbl->AddRef(This->pool); + *pool = effect->pool; + (*pool)->lpVtbl->AddRef(*pool); } - *pool = This->pool; - - TRACE("Returning pool %p\n", *pool); + TRACE("Returning pool %p.\n", *pool); return S_OK; } diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index d7675cd5cd2..4cfdb06fce5 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: 9a121f511533abb801ce49011e2a089b15265a44} +tags: {wine: 3bd0fc3d6ad75ec723f2268e2d6de79be904de2c}
3 years, 10 months
1
0
0
0
[reactos] 93/218: [WINESYNC] d3dx9: Simplify effect init.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eb06082f45e9ccf565fbe…
commit eb06082f45e9ccf565fbe47707081215db967411 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Simplify effect init. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 9a121f511533abb801ce49011e2a089b15265a44 by Matteo Bruni <mbruni(a)codeweavers.com> --- dll/directx/wine/d3dx9_36/effect.c | 76 +++++++++++++++----------------------- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 30 insertions(+), 48 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index 08e51298cd0..6fdca701fca 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -6146,32 +6146,46 @@ static const char **parse_skip_constants_string(char *skip_constants_string, uns return new_alloc; } -static HRESULT d3dx9_base_effect_init(struct d3dx_effect *effect, const char *data, SIZE_T data_size, - const D3D_SHADER_MACRO *defines, ID3DInclude *include, unsigned int eflags, ID3DBlob **errors, - struct d3dx_effect_pool *pool, const char *skip_constants_string) +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) { - struct d3dx9_base_effect *base = &effect->base_effect; - DWORD tag, offset; - const char *ptr = data; - HRESULT hr; - ID3DBlob *bytecode = NULL, *temp_errors = NULL; - char *skip_constants_buffer = NULL; - const char **skip_constants = NULL; - unsigned int skip_constants_count = 0; #if D3DX_SDK_VERSION <= 36 UINT compile_flags = D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY; #else UINT compile_flags = 0; #endif + struct d3dx9_base_effect *base = &effect->base_effect; + ID3DBlob *bytecode = NULL, *temp_errors = NULL; + struct d3dx_effect_pool *pool_impl = NULL; + unsigned int skip_constants_count = 0; + char *skip_constants_buffer = NULL; + const char **skip_constants = NULL; + const char *ptr = data; + DWORD tag, offset; unsigned int i, j; + HRESULT hr; - TRACE("effect %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, eflags %#x, errors %p, " "pool %p, skip_constants %s.\n", - effect, data, data_size, defines, include, eflags, errors, pool, + effect, device, data, data_size, defines, include, eflags, errors, pool, debugstr_a(skip_constants_string)); + effect->ID3DXEffect_iface.lpVtbl = &ID3DXEffect_Vtbl; + effect->ref = 1; + + if (pool) + { + pool->lpVtbl->AddRef(pool); + pool_impl = impl_from_ID3DXEffectPool(pool); + } + effect->pool = pool; + + IDirect3DDevice9_AddRef(device); + effect->device = device; + base->effect = effect; - base->pool = pool; + base->pool = pool_impl; base->flags = eflags; read_dword(&ptr, &tag); @@ -6287,38 +6301,6 @@ static HRESULT d3dx9_base_effect_init(struct d3dx_effect *effect, const char *da HeapFree(GetProcessHeap(), 0, skip_constants_buffer); HeapFree(GetProcessHeap(), 0, skip_constants); - return D3D_OK; -} - -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 **error_messages, struct ID3DXEffectPool *pool, const char *skip_constants) -{ - HRESULT hr; - struct d3dx_effect_pool *pool_impl = NULL; - - TRACE("effect %p, device %p, data %p, data_size %lu, pool %p\n", effect, device, data, data_size, pool); - - effect->ID3DXEffect_iface.lpVtbl = &ID3DXEffect_Vtbl; - effect->ref = 1; - - if (pool) - { - pool->lpVtbl->AddRef(pool); - pool_impl = impl_from_ID3DXEffectPool(pool); - } - effect->pool = pool; - - IDirect3DDevice9_AddRef(device); - effect->device = device; - - if (FAILED(hr = d3dx9_base_effect_init(effect, data, data_size, defines, include, eflags, - error_messages, pool_impl, skip_constants))) - { - FIXME("Failed to parse effect, hr %#x.\n", hr); - return hr; - } - /* initialize defaults - check because of unsupported ascii effects */ if (effect->techniques) { @@ -6362,7 +6344,7 @@ HRESULT WINAPI D3DXCreateEffectEx(struct IDirect3DDevice9 *device, const void *s (ID3DInclude *)include, flags, (ID3DBlob **)compilation_errors, pool, skip_constants); if (FAILED(hr)) { - WARN("Failed to create effect object.\n"); + WARN("Failed to create effect object, hr %#x.\n", hr); d3dx_effect_cleanup(object); return hr; } diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index d8f6eaaad50..d7675cd5cd2 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: 009279845d9503468d5d3d39e393ad2ffa00181d} +tags: {wine: 9a121f511533abb801ce49011e2a089b15265a44}
3 years, 10 months
1
0
0
0
[reactos] 92/218: [WINESYNC] d3dx9: Simplify effect cleanup.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f336e915a21733e5d1306…
commit f336e915a21733e5d1306a766ce01b997e94cfd1 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Simplify effect cleanup. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 009279845d9503468d5d3d39e393ad2ffa00181d by Matteo Bruni <mbruni(a)codeweavers.com> --- dll/directx/wine/d3dx9_36/effect.c | 39 ++++++++++---------------------------- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index a3efbcef329..08e51298cd0 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -681,11 +681,11 @@ static void free_technique(struct d3dx_technique *technique) technique->name = NULL; } -static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect) +static void d3dx_effect_cleanup(struct d3dx_effect *effect) { unsigned int i; - TRACE("Effect %p.\n", effect); + TRACE("effect %p.\n", effect); heap_free(effect->full_name_tmp); @@ -694,7 +694,6 @@ static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect) for (i = 0; i < effect->parameter_count; ++i) free_top_level_parameter(&effect->parameters[i]); heap_free(effect->parameters); - effect->parameters = NULL; } if (effect->techniques) @@ -702,37 +701,23 @@ static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect) for (i = 0; i < effect->technique_count; ++i) free_technique(&effect->techniques[i]); heap_free(effect->techniques); - effect->techniques = NULL; } if (effect->objects) { for (i = 0; i < effect->object_count; ++i) - { free_object(&effect->objects[i]); - } heap_free(effect->objects); - effect->objects = NULL; } -} - -static void free_effect(struct d3dx_effect *effect) -{ - TRACE("Free effect %p\n", effect); - - d3dx9_base_effect_cleanup(effect); if (effect->pool) - { effect->pool->lpVtbl->Release(effect->pool); - } if (effect->manager) - { IUnknown_Release(effect->manager); - } IDirect3DDevice9_Release(effect->device); + heap_free(effect); } static void get_vector(struct d3dx_parameter *param, D3DXVECTOR4 *vector) @@ -1826,18 +1811,15 @@ static ULONG WINAPI d3dx_effect_AddRef(ID3DXEffect *iface) static ULONG WINAPI d3dx_effect_Release(ID3DXEffect *iface) { - struct d3dx_effect *This = impl_from_ID3DXEffect(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); + ULONG refcount = InterlockedDecrement(&effect->ref); - TRACE("(%p)->(): Release from %u\n", This, ref + 1); + TRACE("%p decreasing refcount to %u.\n", effect, refcount); - if (!ref) - { - free_effect(This); - HeapFree(GetProcessHeap(), 0, This); - } + if (!refcount) + d3dx_effect_cleanup(effect); - return ref; + return refcount; } /*** ID3DXBaseEffect methods ***/ @@ -6334,7 +6316,6 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev error_messages, pool_impl, skip_constants))) { FIXME("Failed to parse effect, hr %#x.\n", hr); - free_effect(effect); return hr; } @@ -6382,7 +6363,7 @@ HRESULT WINAPI D3DXCreateEffectEx(struct IDirect3DDevice9 *device, const void *s if (FAILED(hr)) { WARN("Failed to create effect object.\n"); - HeapFree(GetProcessHeap(), 0, object); + d3dx_effect_cleanup(object); return hr; } diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 918cf38d8be..d8f6eaaad50 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: 5fa06bbc302c0fdbf8a5e087b7f18445475add2a} +tags: {wine: 009279845d9503468d5d3d39e393ad2ffa00181d}
3 years, 10 months
1
0
0
0
[reactos] 91/218: [WINESYNC] d3dx9: Move techniques out of struct d3dx9_base_effect.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=275bd75bd60d85b2eca61…
commit 275bd75bd60d85b2eca6189254f5781f03027fdd Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Move techniques out of struct d3dx9_base_effect. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 5fa06bbc302c0fdbf8a5e087b7f18445475add2a by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 63 +++++++++++++++++--------------------- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index 10a90ad394c..a3efbcef329 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -156,8 +156,6 @@ struct d3dx9_base_effect { struct d3dx_effect *effect; - struct d3dx_technique *techniques; - struct d3dx_effect_pool *pool; DWORD flags; @@ -174,6 +172,7 @@ struct d3dx_effect unsigned int technique_count; unsigned int object_count; struct d3dx_top_level_parameter *parameters; + struct d3dx_technique *techniques; struct d3dx_object *objects; struct wine_rb_tree param_tree; char *full_name_tmp; @@ -457,15 +456,14 @@ static inline D3DXHANDLE get_pass_handle(struct d3dx_pass *pass) static struct d3dx_technique *get_technique_by_name(struct d3dx_effect *effect, const char *name) { - struct d3dx9_base_effect *base = &effect->base_effect; unsigned int i; if (!name) return NULL; for (i = 0; i < effect->technique_count; ++i) { - if (!strcmp(base->techniques[i].name, name)) - return &base->techniques[i]; + if (!strcmp(effect->techniques[i].name, name)) + return &effect->techniques[i]; } return NULL; @@ -473,13 +471,12 @@ static struct d3dx_technique *get_technique_by_name(struct d3dx_effect *effect, static struct d3dx_technique *get_valid_technique(struct d3dx_effect *effect, D3DXHANDLE technique) { - struct d3dx9_base_effect *base = &effect->base_effect; unsigned int i; for (i = 0; i < effect->technique_count; ++i) { - if (get_technique_handle(&base->techniques[i]) == technique) - return &base->techniques[i]; + if (get_technique_handle(&effect->techniques[i]) == technique) + return &effect->techniques[i]; } return get_technique_by_name(effect, technique); @@ -487,12 +484,11 @@ static struct d3dx_technique *get_valid_technique(struct d3dx_effect *effect, D3 static struct d3dx_pass *get_valid_pass(struct d3dx_effect *effect, D3DXHANDLE pass) { - struct d3dx9_base_effect *base = &effect->base_effect; unsigned int i, k; for (i = 0; i < effect->technique_count; ++i) { - struct d3dx_technique *technique = &base->techniques[i]; + struct d3dx_technique *technique = &effect->techniques[i]; for (k = 0; k < technique->pass_count; ++k) { @@ -687,10 +683,9 @@ static void free_technique(struct d3dx_technique *technique) static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect) { - struct d3dx9_base_effect *base = &effect->base_effect; unsigned int i; - TRACE("base %p.\n", base); + TRACE("Effect %p.\n", effect); heap_free(effect->full_name_tmp); @@ -702,12 +697,12 @@ static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect) effect->parameters = NULL; } - if (base->techniques) + if (effect->techniques) { for (i = 0; i < effect->technique_count; ++i) - free_technique(&base->techniques[i]); - HeapFree(GetProcessHeap(), 0, base->techniques); - base->techniques = NULL; + free_technique(&effect->techniques[i]); + heap_free(effect->techniques); + effect->techniques = NULL; } if (effect->objects) @@ -1901,7 +1896,7 @@ static HRESULT WINAPI d3dx_effect_GetTechniqueDesc(ID3DXEffect *iface, D3DXHANDL D3DXTECHNIQUE_DESC *desc) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx_technique *tech = technique ? get_valid_technique(effect, technique) : &effect->base_effect.techniques[0]; + struct d3dx_technique *tech = technique ? get_valid_technique(effect, technique) : &effect->techniques[0]; TRACE("iface %p, technique %p, desc %p.\n", iface, technique, desc); @@ -2131,9 +2126,9 @@ static D3DXHANDLE WINAPI d3dx_effect_GetTechnique(ID3DXEffect *iface, UINT index return NULL; } - TRACE("Returning technique %p.\n", &effect->base_effect.techniques[index]); + TRACE("Returning technique %p.\n", &effect->techniques[index]); - return get_technique_handle(&effect->base_effect.techniques[index]); + return get_technique_handle(&effect->techniques[index]); } static D3DXHANDLE WINAPI d3dx_effect_GetTechniqueByName(ID3DXEffect *iface, const char *name) @@ -3651,7 +3646,6 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D D3DXHANDLE *next_technique) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx9_base_effect *base = &effect->base_effect; struct d3dx_technique *prev_tech, *tech; unsigned int i; @@ -3664,7 +3658,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D for (i = 0; i < effect->technique_count; ++i) { - tech = &base->techniques[i]; + tech = &effect->techniques[i]; if (tech == prev_tech) { ++i; @@ -3679,7 +3673,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D for (; i < effect->technique_count; ++i) { - tech = &base->techniques[i]; + tech = &effect->techniques[i]; if (SUCCEEDED(d3dx_effect_ValidateTechnique(iface, get_technique_handle(tech)))) { *next_technique = get_technique_handle(tech); @@ -3687,7 +3681,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D } } - *next_technique = get_technique_handle(&base->techniques[0]); + *next_technique = get_technique_handle(&effect->techniques[0]); return S_FALSE; } @@ -5778,7 +5772,6 @@ static HRESULT d3dx_parse_array_selector(struct d3dx_effect *effect, struct d3dx static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, const char **ptr, const char **skip_constants, unsigned int skip_constants_count) { - struct d3dx9_base_effect *base = &effect->base_effect; DWORD technique_index; DWORD index, state_index, usage, element_index; struct d3dx_state *state; @@ -5846,7 +5839,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, return E_FAIL; } - technique = &base->techniques[technique_index]; + technique = &effect->techniques[technique_index]; if (index >= technique->pass_count) { FIXME("Index out of bounds: index %u >= pass_count %u\n", index, technique->pass_count); @@ -6019,8 +6012,8 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U if (effect->technique_count) { - base->techniques = heap_alloc_zero(sizeof(*base->techniques) * effect->technique_count); - if (!base->techniques) + effect->techniques = heap_alloc_zero(sizeof(*effect->techniques) * effect->technique_count); + if (!effect->techniques) { ERR("Out of memory.\n"); hr = E_OUTOFMEMORY; @@ -6030,7 +6023,7 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U for (i = 0; i < effect->technique_count; ++i) { TRACE("Parsing technique %u.\n", i); - hr = d3dx_parse_effect_technique(effect, &base->techniques[i], data, &ptr, effect->objects); + hr = d3dx_parse_effect_technique(effect, &effect->techniques[i], data, &ptr, effect->objects); if (hr != D3D_OK) { WARN("Failed to parse technique %u.\n", i); @@ -6085,12 +6078,12 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U err_out: - if (base->techniques) + if (effect->techniques) { for (i = 0; i < effect->technique_count; ++i) - free_technique(&base->techniques[i]); - HeapFree(GetProcessHeap(), 0, base->techniques); - base->techniques = NULL; + free_technique(&effect->techniques[i]); + heap_free(effect->techniques); + effect->techniques = NULL; } if (effect->parameters) @@ -6292,7 +6285,7 @@ static HRESULT d3dx9_base_effect_init(struct d3dx_effect *effect, const char *da { for (j = 0; j < effect->technique_count; ++j) { - if (is_parameter_used(param, &base->techniques[j])) + if (is_parameter_used(param, &effect->techniques[j])) { WARN("skip_constants parameter %s is used in technique %u.\n", debugstr_a(skip_constants[i]), j); @@ -6346,9 +6339,9 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev } /* initialize defaults - check because of unsupported ascii effects */ - if (effect->base_effect.techniques) + if (effect->techniques) { - effect->active_technique = &effect->base_effect.techniques[0]; + effect->active_technique = &effect->techniques[0]; effect->active_pass = NULL; } diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 59dd73fc3cb..918cf38d8be 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: 4c134a66b0c3c10d4ed334477385a91440069024} +tags: {wine: 5fa06bbc302c0fdbf8a5e087b7f18445475add2a}
3 years, 10 months
1
0
0
0
[reactos] 90/218: [WINESYNC] d3dx9: Move parameters out of struct d3dx9_base_effect.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f8ab5e6bfbda38854bca5…
commit f8ab5e6bfbda38854bca512bfb7e7252b2bca6cc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Sep 21 22:50:18 2020 +0200 Commit: Jérôme Gardou <jerome.gardou(a)reactos.org> CommitDate: Thu Feb 4 16:37:03 2021 +0100 [WINESYNC] d3dx9: Move parameters out of struct d3dx9_base_effect. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 4c134a66b0c3c10d4ed334477385a91440069024 by Michael Stefaniuc <mstefani(a)winehq.org> --- dll/directx/wine/d3dx9_36/effect.c | 53 ++++++++++++++++++-------------------- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c index 726f34b73ac..10a90ad394c 100644 --- a/dll/directx/wine/d3dx9_36/effect.c +++ b/dll/directx/wine/d3dx9_36/effect.c @@ -156,7 +156,6 @@ struct d3dx9_base_effect { struct d3dx_effect *effect; - struct d3dx_top_level_parameter *parameters; struct d3dx_technique *techniques; struct d3dx_effect_pool *pool; @@ -174,6 +173,7 @@ struct d3dx_effect unsigned int parameter_count; unsigned int technique_count; unsigned int object_count; + struct d3dx_top_level_parameter *parameters; struct d3dx_object *objects; struct wine_rb_tree param_tree; char *full_name_tmp; @@ -694,12 +694,12 @@ static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect) heap_free(effect->full_name_tmp); - if (base->parameters) + if (effect->parameters) { for (i = 0; i < effect->parameter_count; ++i) - free_top_level_parameter(&base->parameters[i]); - HeapFree(GetProcessHeap(), 0, base->parameters); - base->parameters = NULL; + free_top_level_parameter(&effect->parameters[i]); + heap_free(effect->parameters); + effect->parameters = NULL; } if (base->techniques) @@ -1988,8 +1988,8 @@ static D3DXHANDLE WINAPI d3dx_effect_GetParameter(ID3DXEffect *iface, D3DXHANDLE { if (index < effect->parameter_count) { - TRACE("Returning parameter %p.\n", &effect->base_effect.parameters[index]); - return get_parameter_handle(&effect->base_effect.parameters[index].param); + TRACE("Returning parameter %p.\n", &effect->parameters[index]); + return get_parameter_handle(&effect->parameters[index].param); } } else @@ -2042,7 +2042,7 @@ static D3DXHANDLE WINAPI d3dx_effect_GetParameterBySemantic(ID3DXEffect *iface, { for (i = 0; i < effect->parameter_count; ++i) { - temp_param = &effect->base_effect.parameters[i].param; + temp_param = &effect->parameters[i].param; if (!temp_param->semantic) { @@ -2101,8 +2101,8 @@ static D3DXHANDLE WINAPI d3dx_effect_GetParameterElement(ID3DXEffect *iface, D3D { if (index < effect->parameter_count) { - TRACE("Returning parameter %p.\n", &effect->base_effect.parameters[index]); - return get_parameter_handle(&effect->base_effect.parameters[index].param); + TRACE("Returning parameter %p.\n", &effect->parameters[index]); + return get_parameter_handle(&effect->parameters[index].param); } } else @@ -4023,13 +4023,12 @@ static BOOL param_on_lost_device(void *data, struct d3dx_parameter *param) static HRESULT WINAPI d3dx_effect_OnLostDevice(ID3DXEffect *iface) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx9_base_effect *base = &effect->base_effect; unsigned int i; TRACE("iface %p.\n", iface); for (i = 0; i < effect->parameter_count; ++i) - walk_parameter_tree(&base->parameters[i].param, param_on_lost_device, NULL); + walk_parameter_tree(&effect->parameters[i].param, param_on_lost_device, NULL); return D3D_OK; } @@ -5813,7 +5812,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, return E_FAIL; } - parameter = &base->parameters[index].param; + parameter = &effect->parameters[index].param; if (element_index != 0xffffffff) { if (element_index >= parameter->element_count && parameter->element_count != 0) @@ -5996,9 +5995,8 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U wine_rb_init(&effect->param_tree, param_rb_compare); if (effect->parameter_count) { - base->parameters = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(*base->parameters) * effect->parameter_count); - if (!base->parameters) + effect->parameters = heap_alloc_zero(sizeof(*effect->parameters) * effect->parameter_count); + if (!effect->parameters) { ERR("Out of memory.\n"); hr = E_OUTOFMEMORY; @@ -6007,16 +6005,15 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U for (i = 0; i < effect->parameter_count; ++i) { - param_set_magic_number(&base->parameters[i].param); - hr = d3dx_parse_effect_parameter(effect, &base->parameters[i], data, &ptr, effect->objects); + param_set_magic_number(&effect->parameters[i].param); + hr = d3dx_parse_effect_parameter(effect, &effect->parameters[i], data, &ptr, effect->objects); if (hr != D3D_OK) { WARN("Failed to parse parameter %u.\n", i); goto err_out; } - walk_parameter_tree(&base->parameters[i].param, param_set_top_level_param, - &base->parameters[i]); - add_param_to_tree(effect, &base->parameters[i].param, NULL, 0, 0); + walk_parameter_tree(&effect->parameters[i].param, param_set_top_level_param, &effect->parameters[i]); + add_param_to_tree(effect, &effect->parameters[i].param, NULL, 0, 0); } } @@ -6079,10 +6076,10 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U for (i = 0; i < effect->parameter_count; ++i) { - if (FAILED(hr = d3dx_pool_sync_shared_parameter(base->pool, &base->parameters[i]))) + if (FAILED(hr = d3dx_pool_sync_shared_parameter(base->pool, &effect->parameters[i]))) goto err_out; - base->parameters[i].version_counter = get_version_counter_ptr(effect); - set_dirty(&base->parameters[i].param); + effect->parameters[i].version_counter = get_version_counter_ptr(effect); + set_dirty(&effect->parameters[i].param); } return D3D_OK; @@ -6096,14 +6093,14 @@ err_out: base->techniques = NULL; } - if (base->parameters) + if (effect->parameters) { for (i = 0; i < effect->parameter_count; ++i) { - free_top_level_parameter(&base->parameters[i]); + free_top_level_parameter(&effect->parameters[i]); } - HeapFree(GetProcessHeap(), 0, base->parameters); - base->parameters = NULL; + heap_free(effect->parameters); + effect->parameters = NULL; } if (effect->objects) diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index a9237e77ff8..59dd73fc3cb 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: 9438d031277cce1a1c21e0739e12d4c37f365467} +tags: {wine: 4c134a66b0c3c10d4ed334477385a91440069024}
3 years, 10 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
44
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200