https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bd5f74314cc3e15eb8776…
commit bd5f74314cc3e15eb87764ba3c7d2f1c24eedbb3
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Sep 21 22:40:26 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:02 2021 +0100
[WINESYNC] d3dx9: Merge the d3dx_effect_GetPassDesc() helper.
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 52c2092fa92cd06ea2c1074072be4cadd872f083 by Michael Stefaniuc
<mstefani(a)winehq.org>
---
dll/directx/wine/d3dx9_36/effect.c | 95 ++++++++++++++++++--------------------
sdk/tools/winesync/d3dx9.cfg | 2 +-
2 files changed, 45 insertions(+), 52 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c
index 2a16ecd680b..7f5c69364f9 100644
--- a/dll/directx/wine/d3dx9_36/effect.c
+++ b/dll/directx/wine/d3dx9_36/effect.c
@@ -1114,55 +1114,6 @@ static HRESULT d3dx9_get_param_value_ptr(struct d3dx_pass *pass,
struct d3dx_sta
return E_NOTIMPL;
}
-static HRESULT d3dx9_base_effect_get_pass_desc(struct d3dx9_base_effect *base,
- D3DXHANDLE pass_handle, D3DXPASS_DESC *desc)
-{
- struct d3dx_pass *pass = get_valid_pass(base, pass_handle);
- unsigned int i;
-
- if (!desc || !pass)
- {
- WARN("Invalid argument specified.\n");
- return D3DERR_INVALIDCALL;
- }
-
- desc->Name = pass->name;
- desc->Annotations = pass->annotation_count;
-
- desc->pVertexShaderFunction = NULL;
- desc->pPixelShaderFunction = NULL;
-
- if (base->flags & D3DXFX_NOT_CLONEABLE)
- return D3D_OK;
-
- for (i = 0; i < pass->state_count; ++i)
- {
- struct d3dx_state *state = &pass->states[i];
-
- if (state_table[state->operation].class == SC_VERTEXSHADER
- || state_table[state->operation].class == SC_PIXELSHADER)
- {
- struct d3dx_parameter *param;
- void *param_value;
- BOOL param_dirty;
- HRESULT hr;
- void *data;
-
- if (FAILED(hr = d3dx9_get_param_value_ptr(pass, &pass->states[i],
¶m_value, ¶m,
- FALSE, ¶m_dirty)))
- return hr;
-
- data = param->object_id ? base->objects[param->object_id].data :
NULL;
- if (state_table[state->operation].class == SC_VERTEXSHADER)
- desc->pVertexShaderFunction = data;
- else
- desc->pPixelShaderFunction = data;
- }
- }
-
- return D3D_OK;
-}
-
static unsigned int get_annotation_from_object(struct d3dx_effect *effect, D3DXHANDLE
object,
struct d3dx_parameter **annotations)
{
@@ -3184,13 +3135,55 @@ static HRESULT WINAPI d3dx_effect_GetTechniqueDesc(ID3DXEffect
*iface, D3DXHANDL
return D3D_OK;
}
-static HRESULT WINAPI d3dx_effect_GetPassDesc(ID3DXEffect *iface, D3DXHANDLE pass,
D3DXPASS_DESC *desc)
+static HRESULT WINAPI d3dx_effect_GetPassDesc(ID3DXEffect *iface, D3DXHANDLE pass_handle,
D3DXPASS_DESC *desc)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
+ struct d3dx_pass *pass = get_valid_pass(&effect->base_effect, pass_handle);
+ unsigned int i;
TRACE("iface %p, pass %p, desc %p.\n", iface, pass, desc);
- return d3dx9_base_effect_get_pass_desc(&effect->base_effect, pass, desc);
+ if (!desc || !pass)
+ {
+ WARN("Invalid argument specified.\n");
+ return D3DERR_INVALIDCALL;
+ }
+
+ desc->Name = pass->name;
+ desc->Annotations = pass->annotation_count;
+
+ desc->pVertexShaderFunction = NULL;
+ desc->pPixelShaderFunction = NULL;
+
+ if (effect->base_effect.flags & D3DXFX_NOT_CLONEABLE)
+ return D3D_OK;
+
+ for (i = 0; i < pass->state_count; ++i)
+ {
+ struct d3dx_state *state = &pass->states[i];
+
+ if (state_table[state->operation].class == SC_VERTEXSHADER
+ || state_table[state->operation].class == SC_PIXELSHADER)
+ {
+ struct d3dx_parameter *param;
+ void *param_value;
+ BOOL param_dirty;
+ HRESULT hr;
+ void *data;
+
+ if (FAILED(hr = d3dx9_get_param_value_ptr(pass, &pass->states[i],
¶m_value, ¶m,
+ FALSE, ¶m_dirty)))
+ return hr;
+
+ data = param->object_id ?
effect->base_effect.objects[param->object_id].data : NULL;
+ if (state_table[state->operation].class == SC_VERTEXSHADER)
+ desc->pVertexShaderFunction = data;
+ else
+ desc->pPixelShaderFunction = data;
+ }
+ }
+
+ return D3D_OK;
}
static HRESULT WINAPI d3dx_effect_GetFunctionDesc(ID3DXEffect *iface, D3DXHANDLE shader,
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index f249ca06f78..8944dd0b7da 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: 26b9b04e7f40c7a2011684f01ff07be91047b492}
+tags: {wine: 52c2092fa92cd06ea2c1074072be4cadd872f083}