Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4704e783
Commit
4704e783
authored
Oct 23, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Avoid LPDIRECT3DPIXELSHADER9.
parent
672ad061
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
33 deletions
+26
-33
effect.c
dlls/d3dx9_36/effect.c
+15
-22
effect.c
dlls/d3dx9_36/tests/effect.c
+7
-7
d3dx9effect.h
include/d3dx9effect.h
+4
-4
No files found.
dlls/d3dx9_36/effect.c
View file @
4704e783
...
...
@@ -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
,
p
shader
);
TRACE
(
"iface %p, parameter %p,
shader %p.
\n
"
,
This
,
parameter
,
shader
);
if
(
p
shader
&&
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
(
*
p
shader
);
TRACE
(
"Returning %p
\n
"
,
*
p
shader
);
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
,
p
shader
);
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
,
p
shader
);
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
:
...
...
dlls/d3dx9_36/tests/effect.c
View file @
4704e783
...
...
@@ -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
},
};
/*
...
...
include/d3dx9effect.h
View file @
4704e783
...
...
@@ -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
*
p
shader
)
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
*
p
shader
)
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
*
p
shader
)
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 ***/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment