mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 02:03:37 +00:00
d3dx9: Avoid LPDIRECT3DPIXELSHADER9.
This commit is contained in:
parent
672ad06108
commit
4704e78337
|
@ -2696,18 +2696,19 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetTexture(ID3DXBaseEffect *iface, D3D
|
|||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ID3DXBaseEffectImpl_GetPixelShader(ID3DXBaseEffect *iface, D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9 *pshader)
|
||||
static HRESULT WINAPI ID3DXBaseEffectImpl_GetPixelShader(ID3DXBaseEffect *iface,
|
||||
D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader)
|
||||
{
|
||||
struct ID3DXBaseEffectImpl *This = impl_from_ID3DXBaseEffect(iface);
|
||||
struct d3dx_parameter *param = get_valid_parameter(This, parameter);
|
||||
|
||||
TRACE("iface %p, parameter %p, pshader %p\n", This, parameter, pshader);
|
||||
TRACE("iface %p, parameter %p, shader %p.\n", This, parameter, shader);
|
||||
|
||||
if (pshader && param && !param->element_count && param->type == D3DXPT_PIXELSHADER)
|
||||
if (shader && param && !param->element_count && param->type == D3DXPT_PIXELSHADER)
|
||||
{
|
||||
*pshader = *(LPDIRECT3DPIXELSHADER9 *)param->data;
|
||||
if (*pshader) IDirect3DPixelShader9_AddRef(*pshader);
|
||||
TRACE("Returning %p\n", *pshader);
|
||||
if ((*shader = *(struct IDirect3DPixelShader9 **)param->data))
|
||||
IDirect3DPixelShader9_AddRef(*shader);
|
||||
TRACE("Returning %p.\n", *shader);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
@ -3367,14 +3368,15 @@ static HRESULT WINAPI ID3DXEffectImpl_GetTexture(ID3DXEffect *iface, D3DXHANDLE
|
|||
return ID3DXBaseEffectImpl_GetTexture(base, parameter, texture);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ID3DXEffectImpl_GetPixelShader(ID3DXEffect *iface, D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9 *pshader)
|
||||
static HRESULT WINAPI ID3DXEffectImpl_GetPixelShader(ID3DXEffect *iface,
|
||||
D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader)
|
||||
{
|
||||
struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
|
||||
ID3DXBaseEffect *base = This->base_effect;
|
||||
|
||||
TRACE("Forward iface %p, base %p\n", This, base);
|
||||
|
||||
return ID3DXBaseEffectImpl_GetPixelShader(base, parameter, pshader);
|
||||
return ID3DXBaseEffectImpl_GetPixelShader(base, parameter, shader);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ID3DXEffectImpl_GetVertexShader(ID3DXEffect *iface, D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9 *vshader)
|
||||
|
@ -4332,14 +4334,15 @@ static HRESULT WINAPI ID3DXEffectCompilerImpl_GetTexture(ID3DXEffectCompiler *if
|
|||
return ID3DXBaseEffectImpl_GetTexture(base, parameter, texture);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetPixelShader(ID3DXEffectCompiler *iface, D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9 *pshader)
|
||||
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetPixelShader(ID3DXEffectCompiler *iface,
|
||||
D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader)
|
||||
{
|
||||
struct ID3DXEffectCompilerImpl *This = impl_from_ID3DXEffectCompiler(iface);
|
||||
ID3DXBaseEffect *base = This->base_effect;
|
||||
|
||||
TRACE("Forward iface %p, base %p\n", This, base);
|
||||
|
||||
return ID3DXBaseEffectImpl_GetPixelShader(base, parameter, pshader);
|
||||
return ID3DXBaseEffectImpl_GetPixelShader(base, parameter, shader);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ID3DXEffectCompilerImpl_GetVertexShader(ID3DXEffectCompiler *iface, D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9 *vshader)
|
||||
|
@ -4743,8 +4746,7 @@ static HRESULT d3dx9_parse_data(struct d3dx_parameter *param, const char **ptr,
|
|||
break;
|
||||
|
||||
case D3DXPT_PIXELSHADER:
|
||||
hr = IDirect3DDevice9_CreatePixelShader(device, (DWORD *)*ptr, (LPDIRECT3DPIXELSHADER9 *)param->data);
|
||||
if (hr != D3D_OK)
|
||||
if (FAILED(hr = IDirect3DDevice9_CreatePixelShader(device, (DWORD *)*ptr, param->data)))
|
||||
{
|
||||
WARN("Failed to create pixel shader\n");
|
||||
return hr;
|
||||
|
@ -4836,23 +4838,14 @@ static HRESULT d3dx9_parse_effect_typedef(struct d3dx_parameter *param, const ch
|
|||
switch (param->type)
|
||||
{
|
||||
case D3DXPT_STRING:
|
||||
param->bytes = sizeof(LPCSTR);
|
||||
break;
|
||||
|
||||
case D3DXPT_PIXELSHADER:
|
||||
param->bytes = sizeof(LPDIRECT3DPIXELSHADER9);
|
||||
break;
|
||||
|
||||
case D3DXPT_VERTEXSHADER:
|
||||
param->bytes = sizeof(LPDIRECT3DVERTEXSHADER9);
|
||||
break;
|
||||
|
||||
case D3DXPT_TEXTURE:
|
||||
case D3DXPT_TEXTURE1D:
|
||||
case D3DXPT_TEXTURE2D:
|
||||
case D3DXPT_TEXTURE3D:
|
||||
case D3DXPT_TEXTURECUBE:
|
||||
param->bytes = sizeof(LPDIRECT3DBASETEXTURE9);
|
||||
param->bytes = sizeof(void *);
|
||||
break;
|
||||
|
||||
case D3DXPT_SAMPLER:
|
||||
|
|
|
@ -810,13 +810,13 @@ static const DWORD test_effect_parameter_value_blob_object[] =
|
|||
|
||||
struct test_effect_parameter_value_result test_effect_parameter_value_result_object[] =
|
||||
{
|
||||
{"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(LPCSTR)}, 0},
|
||||
{"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(LPCSTR)}, 0},
|
||||
{"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(LPDIRECT3DBASETEXTURE9)}, 0},
|
||||
{"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(LPDIRECT3DVERTEXSHADER9)}, 0},
|
||||
{"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(LPDIRECT3DVERTEXSHADER9)}, 0},
|
||||
{"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(LPDIRECT3DPIXELSHADER9)}, 0},
|
||||
{"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(LPDIRECT3DPIXELSHADER9)}, 0},
|
||||
{"s", {"s", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
|
||||
{"s_2", {"s_2", NULL, D3DXPC_OBJECT, D3DXPT_STRING, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
|
||||
{"tex", {"tex", NULL, D3DXPC_OBJECT, D3DXPT_TEXTURE2D, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
|
||||
{"v", {"v", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
|
||||
{"v_2", {"v_2", NULL, D3DXPC_OBJECT, D3DXPT_VERTEXSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
|
||||
{"p", {"p", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 0, 0, 0, 0, sizeof(void *)}, 0},
|
||||
{"p_2", {"p_2", NULL, D3DXPC_OBJECT, D3DXPT_PIXELSHADER, 0, 0, 2, 0, 0, 0, 2 * sizeof(void *)}, 0},
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -150,7 +150,7 @@ DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown)
|
|||
STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
|
||||
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
|
||||
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE;
|
||||
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader) PURE;
|
||||
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
|
||||
};
|
||||
|
@ -183,7 +183,7 @@ DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
|
|||
STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT register_index, CONST FLOAT* constant_data, UINT register_count) PURE;
|
||||
STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT register_index, CONST INT* constant_data, UINT register_count) PURE;
|
||||
STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT register_index, CONST BOOL* constant_data, UINT register_count) PURE;
|
||||
STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 shader) PURE;
|
||||
STDMETHOD(SetPixelShader)(THIS_ struct IDirect3DPixelShader9 *shader) PURE;
|
||||
STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT register_index, CONST FLOAT* constant_data, UINT register_count) PURE;
|
||||
STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT register_index, CONST INT * constant_data, UINT register_count) PURE;
|
||||
STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT register_index, CONST BOOL* constant_data, UINT register_count) PURE;
|
||||
|
@ -254,7 +254,7 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
|
|||
STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
|
||||
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
|
||||
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE;
|
||||
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader) PURE;
|
||||
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
|
||||
/*** ID3DXEffect methods ***/
|
||||
|
@ -347,7 +347,7 @@ DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect)
|
|||
STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
|
||||
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
|
||||
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE;
|
||||
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader) PURE;
|
||||
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
|
||||
/*** ID3DXEffectCompiler methods ***/
|
||||
|
|
Loading…
Reference in a new issue