mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +00:00
[WINESYNC] d3dx9: Merge the d3dx_effect_GetPassDesc() 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 52c2092fa92cd06ea2c1074072be4cadd872f083 by Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
2b9f231acf
commit
bd5f74314c
2 changed files with 45 additions and 52 deletions
|
@ -1114,55 +1114,6 @@ static HRESULT d3dx9_get_param_value_ptr(struct d3dx_pass *pass, struct d3dx_sta
|
||||||
return E_NOTIMPL;
|
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,
|
static unsigned int get_annotation_from_object(struct d3dx_effect *effect, D3DXHANDLE object,
|
||||||
struct d3dx_parameter **annotations)
|
struct d3dx_parameter **annotations)
|
||||||
{
|
{
|
||||||
|
@ -3184,13 +3135,55 @@ static HRESULT WINAPI d3dx_effect_GetTechniqueDesc(ID3DXEffect *iface, D3DXHANDL
|
||||||
return D3D_OK;
|
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_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);
|
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,
|
static HRESULT WINAPI d3dx_effect_GetFunctionDesc(ID3DXEffect *iface, D3DXHANDLE shader,
|
||||||
|
|
|
@ -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/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/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}
|
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h}
|
||||||
tags: {wine: 26b9b04e7f40c7a2011684f01ff07be91047b492}
|
tags: {wine: 52c2092fa92cd06ea2c1074072be4cadd872f083}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue