Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
df9c6aa3
Commit
df9c6aa3
authored
Jun 12, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Get rid of IDirect3DVertexShader9Impl.
parent
9ea4543d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
40 deletions
+33
-40
d3d9_private.h
dlls/d3d9/d3d9_private.h
+9
-15
device.c
dlls/d3d9/device.c
+3
-3
shader.c
dlls/d3d9/shader.c
+21
-22
No files found.
dlls/d3d9/d3d9_private.h
View file @
df9c6aa3
...
...
@@ -272,23 +272,17 @@ HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device,
struct
d3d9_vertex_declaration
*
unsafe_impl_from_IDirect3DVertexDeclaration9
(
IDirect3DVertexDeclaration9
*
iface
)
DECLSPEC_HIDDEN
;
/* ---------------------- */
/* IDirect3DVertexShader9 */
/* ---------------------- */
struct
d3d9_vertexshader
{
IDirect3DVertexShader9
IDirect3DVertexShader9_iface
;
LONG
refcount
;
struct
wined3d_shader
*
wined3d_shader
;
IDirect3DDevice9Ex
*
parent_device
;
};
/*****************************************************************************
* IDirect3DVertexShader implementation structure
*/
typedef
struct
IDirect3DVertexShader9Impl
{
IDirect3DVertexShader9
IDirect3DVertexShader9_iface
;
LONG
ref
;
struct
wined3d_shader
*
wined3d_shader
;
IDirect3DDevice9Ex
*
parentDevice
;
}
IDirect3DVertexShader9Impl
;
HRESULT
vertexshader_init
(
IDirect3DVertexShader9Impl
*
shader
,
HRESULT
vertexshader_init
(
struct
d3d9_vertexshader
*
shader
,
struct
d3d9_device
*
device
,
const
DWORD
*
byte_code
)
DECLSPEC_HIDDEN
;
IDirect3DVertexShader9Impl
*
unsafe_impl_from_IDirect3DVertexShader9
(
IDirect3DVertexShader9
*
iface
)
DECLSPEC_HIDDEN
;
struct
d3d9_vertexshader
*
unsafe_impl_from_IDirect3DVertexShader9
(
IDirect3DVertexShader9
*
iface
)
DECLSPEC_HIDDEN
;
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
#define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
...
...
dlls/d3d9/device.c
View file @
df9c6aa3
...
...
@@ -2240,7 +2240,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexShader(IDirect3DDevice9Ex *iface,
const
DWORD
*
byte_code
,
IDirect3DVertexShader9
**
shader
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DVertexShader9Impl
*
object
;
struct
d3d9_vertexshader
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, byte_code %p, shader %p.
\n
"
,
iface
,
byte_code
,
shader
);
...
...
@@ -2269,7 +2269,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexShader(IDirect3DDevice9Ex *iface,
static
HRESULT
WINAPI
d3d9_device_SetVertexShader
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DVertexShader9
*
shader
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DVertexShader9Impl
*
shader_obj
=
unsafe_impl_from_IDirect3DVertexShader9
(
shader
);
struct
d3d9_vertexshader
*
shader_obj
=
unsafe_impl_from_IDirect3DVertexShader9
(
shader
);
HRESULT
hr
;
TRACE
(
"iface %p, shader %p.
\n
"
,
iface
,
shader
);
...
...
@@ -2285,7 +2285,7 @@ static HRESULT WINAPI d3d9_device_SetVertexShader(IDirect3DDevice9Ex *iface, IDi
static
HRESULT
WINAPI
d3d9_device_GetVertexShader
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DVertexShader9
**
shader
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DVertexShader9Impl
*
shader_impl
;
struct
d3d9_vertexshader
*
shader_impl
;
struct
wined3d_shader
*
wined3d_shader
;
TRACE
(
"iface %p, shader %p.
\n
"
,
iface
,
shader
);
...
...
dlls/d3d9/shader.c
View file @
df9c6aa3
...
...
@@ -22,39 +22,39 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d9
);
static
inline
IDirect3DVertexShader9Impl
*
impl_from_IDirect3DVertexShader9
(
IDirect3DVertexShader9
*
iface
)
static
inline
struct
d3d9_vertexshader
*
impl_from_IDirect3DVertexShader9
(
IDirect3DVertexShader9
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DVertexShader9Impl
,
IDirect3DVertexShader9_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d9_vertexshader
,
IDirect3DVertexShader9_iface
);
}
static
HRESULT
WINAPI
d3d9_vertexshader_QueryInterface
(
IDirect3DVertexShader9
*
iface
,
REFIID
riid
,
void
**
o
bjec
t
)
static
HRESULT
WINAPI
d3d9_vertexshader_QueryInterface
(
IDirect3DVertexShader9
*
iface
,
REFIID
riid
,
void
**
o
u
t
)
{
TRACE
(
"iface %p, riid %s, o
bject %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
objec
t
);
TRACE
(
"iface %p, riid %s, o
ut %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ou
t
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDirect3DVertexShader9
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IDirect3DVertexShader9_AddRef
(
iface
);
*
o
bjec
t
=
iface
;
*
o
u
t
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
o
bjec
t
=
NULL
;
*
o
u
t
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
d3d9_vertexshader_AddRef
(
IDirect3DVertexShader9
*
iface
)
{
IDirect3DVertexShader9Impl
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
shader
->
ref
);
struct
d3d9_vertexshader
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
shader
->
ref
count
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
refcount
==
1
)
{
IDirect3DDevice9Ex_AddRef
(
shader
->
parent
D
evice
);
IDirect3DDevice9Ex_AddRef
(
shader
->
parent
_d
evice
);
wined3d_mutex_lock
();
wined3d_shader_incref
(
shader
->
wined3d_shader
);
wined3d_mutex_unlock
();
...
...
@@ -65,14 +65,14 @@ static ULONG WINAPI d3d9_vertexshader_AddRef(IDirect3DVertexShader9 *iface)
static
ULONG
WINAPI
d3d9_vertexshader_Release
(
IDirect3DVertexShader9
*
iface
)
{
IDirect3DVertexShader9Impl
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
shader
->
ref
);
struct
d3d9_vertexshader
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
shader
->
ref
count
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
IDirect3DDevice9Ex
*
device
=
shader
->
parent
D
evice
;
IDirect3DDevice9Ex
*
device
=
shader
->
parent
_d
evice
;
wined3d_mutex_lock
();
wined3d_shader_decref
(
shader
->
wined3d_shader
);
...
...
@@ -87,11 +87,11 @@ static ULONG WINAPI d3d9_vertexshader_Release(IDirect3DVertexShader9 *iface)
static
HRESULT
WINAPI
d3d9_vertexshader_GetDevice
(
IDirect3DVertexShader9
*
iface
,
IDirect3DDevice9
**
device
)
{
IDirect3DVertexShader9Impl
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
struct
d3d9_vertexshader
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
IDirect3DDevice9
*
)
shader
->
parent
D
evice
;
*
device
=
(
IDirect3DDevice9
*
)
shader
->
parent
_d
evice
;
IDirect3DDevice9_AddRef
(
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
...
...
@@ -99,10 +99,9 @@ static HRESULT WINAPI d3d9_vertexshader_GetDevice(IDirect3DVertexShader9 *iface,
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d9_vertexshader_GetFunction
(
IDirect3DVertexShader9
*
iface
,
void
*
data
,
UINT
*
data_size
)
static
HRESULT
WINAPI
d3d9_vertexshader_GetFunction
(
IDirect3DVertexShader9
*
iface
,
void
*
data
,
UINT
*
data_size
)
{
IDirect3DVertexShader9Impl
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
struct
d3d9_vertexshader
*
shader
=
impl_from_IDirect3DVertexShader9
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, data %p, data_size %p.
\n
"
,
iface
,
data
,
data_size
);
...
...
@@ -135,11 +134,11 @@ static const struct wined3d_parent_ops d3d9_vertexshader_wined3d_parent_ops =
d3d9_vertexshader_wined3d_object_destroyed
,
};
HRESULT
vertexshader_init
(
IDirect3DVertexShader9Impl
*
shader
,
struct
d3d9_device
*
device
,
const
DWORD
*
byte_code
)
HRESULT
vertexshader_init
(
struct
d3d9_vertexshader
*
shader
,
struct
d3d9_device
*
device
,
const
DWORD
*
byte_code
)
{
HRESULT
hr
;
shader
->
ref
=
1
;
shader
->
ref
count
=
1
;
shader
->
IDirect3DVertexShader9_iface
.
lpVtbl
=
&
d3d9_vertexshader_vtbl
;
wined3d_mutex_lock
();
...
...
@@ -152,13 +151,13 @@ HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader, struct d3d9_device
return
hr
;
}
shader
->
parent
D
evice
=
&
device
->
IDirect3DDevice9Ex_iface
;
IDirect3DDevice9Ex_AddRef
(
shader
->
parent
D
evice
);
shader
->
parent
_d
evice
=
&
device
->
IDirect3DDevice9Ex_iface
;
IDirect3DDevice9Ex_AddRef
(
shader
->
parent
_d
evice
);
return
D3D_OK
;
}
IDirect3DVertexShader9Impl
*
unsafe_impl_from_IDirect3DVertexShader9
(
IDirect3DVertexShader9
*
iface
)
struct
d3d9_vertexshader
*
unsafe_impl_from_IDirect3DVertexShader9
(
IDirect3DVertexShader9
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
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