[WINESYNC] d3dx9: Merge the d3dx_effect_GetParameterDesc() helper.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 262238d46752700c2041cb9548724c66bd017eca by Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
winesync 2020-09-21 22:40:28 +02:00 committed by Jérôme Gardou
parent 6d27669ad3
commit 2a0486d854
2 changed files with 22 additions and 29 deletions

View file

@ -993,33 +993,6 @@ static inline DWORD d3dx9_effect_version(DWORD major, DWORD minor)
return (0xfeff0000 | ((major) << 8) | (minor));
}
static HRESULT d3dx9_base_effect_get_parameter_desc(struct d3dx9_base_effect *base,
D3DXHANDLE parameter, D3DXPARAMETER_DESC *desc)
{
struct d3dx_parameter *param = get_valid_parameter(base, parameter);
if (!desc || !param)
{
WARN("Invalid argument specified.\n");
return D3DERR_INVALIDCALL;
}
desc->Name = param->name;
desc->Semantic = param->semantic;
desc->Class = param->class;
desc->Type = param->type;
desc->Rows = param->rows;
desc->Columns = param->columns;
desc->Elements = param->element_count;
desc->Annotations = is_top_level_parameter(param)
? top_level_parameter_from_parameter(param)->annotation_count : 0;
desc->StructMembers = param->member_count;
desc->Flags = param->flags;
desc->Bytes = param->bytes;
return D3D_OK;
}
static HRESULT d3dx9_get_param_value_ptr(struct d3dx_pass *pass, struct d3dx_state *state,
void **param_value, struct d3dx_parameter **out_param,
BOOL update_all, BOOL *param_dirty)
@ -2339,10 +2312,30 @@ static HRESULT WINAPI d3dx_effect_GetParameterDesc(ID3DXEffect *iface, D3DXHANDL
D3DXPARAMETER_DESC *desc)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
struct d3dx_parameter *param = get_valid_parameter(&effect->base_effect, parameter);
TRACE("iface %p, parameter %p, desc %p.\n", iface, parameter, desc);
return d3dx9_base_effect_get_parameter_desc(&effect->base_effect, parameter, desc);
if (!desc || !param)
{
WARN("Invalid argument specified.\n");
return D3DERR_INVALIDCALL;
}
desc->Name = param->name;
desc->Semantic = param->semantic;
desc->Class = param->class;
desc->Type = param->type;
desc->Rows = param->rows;
desc->Columns = param->columns;
desc->Elements = param->element_count;
desc->Annotations = is_top_level_parameter(param)
? top_level_parameter_from_parameter(param)->annotation_count : 0;
desc->StructMembers = param->member_count;
desc->Flags = param->flags;
desc->Bytes = param->bytes;
return D3D_OK;
}
static HRESULT WINAPI d3dx_effect_GetTechniqueDesc(ID3DXEffect *iface, D3DXHANDLE technique,

View file

@ -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: f34f13825fd060fda40f0a5b02dc1b420e3a8e1e}
tags: {wine: 262238d46752700c2041cb9548724c66bd017eca}