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
16e570f4
Commit
16e570f4
authored
Oct 02, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Oct 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement ID3D11DepthStencilState interface.
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
parent
ce0c0942
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
132 additions
and
22 deletions
+132
-22
d3d11_private.h
dlls/d3d11/d3d11_private.h
+3
-2
state.c
dlls/d3d11/state.c
+129
-20
No files found.
dlls/d3d11/d3d11_private.h
View file @
16e570f4
...
...
@@ -291,16 +291,17 @@ HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, struct d3d_devic
const
D3D10_BLEND_DESC
*
desc
)
DECLSPEC_HIDDEN
;
struct
d3d10_blend_state
*
unsafe_impl_from_ID3D10BlendState
(
ID3D10BlendState
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10DepthStencilState */
/* ID3D1
1DepthStencilState, ID3D1
0DepthStencilState */
struct
d3d_depthstencil_state
{
ID3D11DepthStencilState
ID3D11DepthStencilState_iface
;
ID3D10DepthStencilState
ID3D10DepthStencilState_iface
;
LONG
refcount
;
struct
wined3d_private_store
private_store
;
D3D10_DEPTH_STENCIL_DESC
desc
;
struct
wine_rb_entry
entry
;
ID3D1
0Device1
*
device
;
ID3D1
1Device
*
device
;
};
HRESULT
d3d_depthstencil_state_init
(
struct
d3d_depthstencil_state
*
state
,
struct
d3d_device
*
device
,
...
...
dlls/d3d11/state.c
View file @
16e570f4
...
...
@@ -192,56 +192,66 @@ struct d3d10_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *if
return
impl_from_ID3D10BlendState
(
iface
);
}
static
inline
struct
d3d_depthstencil_state
*
impl_from_ID3D10DepthStencilState
(
ID3D10DepthStencilState
*
iface
)
/* ID3D11DepthStencilState methods */
static
inline
struct
d3d_depthstencil_state
*
impl_from_ID3D11DepthStencilState
(
ID3D11DepthStencilState
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d_depthstencil_state
,
ID3D1
0
DepthStencilState_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d_depthstencil_state
,
ID3D1
1
DepthStencilState_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_depthstencil_state_QueryInterface
(
ID3D10DepthStencilState
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
d3d11_depthstencil_state_QueryInterface
(
ID3D11DepthStencilState
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D11DepthStencilState
(
iface
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D1
0
DepthStencilState
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D1
0
DeviceChild
)
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D1
1
DepthStencilState
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D1
1
DeviceChild
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
I
Unknown
_AddRef
(
iface
);
I
D3D11DepthStencilState
_AddRef
(
iface
);
*
object
=
iface
;
return
S_OK
;
}
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D10DepthStencilState
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10DeviceChild
))
{
ID3D10DepthStencilState_AddRef
(
&
state
->
ID3D10DepthStencilState_iface
);
*
object
=
&
state
->
ID3D10DepthStencilState_iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
object
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d3d1
0_depthstencil_state_AddRef
(
ID3D10
DepthStencilState
*
iface
)
static
ULONG
STDMETHODCALLTYPE
d3d1
1_depthstencil_state_AddRef
(
ID3D11
DepthStencilState
*
iface
)
{
struct
d3d_depthstencil_state
*
This
=
impl_from_ID3D10
DepthStencilState
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D11
DepthStencilState
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
state
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
This
,
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
state
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
d3d1
0_depthstencil_state_Release
(
ID3D10
DepthStencilState
*
iface
)
static
ULONG
STDMETHODCALLTYPE
d3d1
1_depthstencil_state_Release
(
ID3D11
DepthStencilState
*
iface
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D1
0
DepthStencilState
(
iface
);
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D1
1
DepthStencilState
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
state
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
state
,
refcount
);
if
(
!
refcount
)
{
struct
d3d_device
*
device
=
impl_from_ID3D1
0
Device
(
state
->
device
);
struct
d3d_device
*
device
=
impl_from_ID3D1
1
Device
(
state
->
device
);
wined3d_mutex_lock
();
wine_rb_remove
(
&
device
->
depthstencil_states
,
&
state
->
desc
);
ID3D1
0Device1
_Release
(
state
->
device
);
ID3D1
1Device
_Release
(
state
->
device
);
wined3d_private_store_cleanup
(
&
state
->
private_store
);
wined3d_mutex_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
state
);
...
...
@@ -250,6 +260,105 @@ static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_Release(ID3D10DepthStenc
return
refcount
;
}
static
void
STDMETHODCALLTYPE
d3d11_depthstencil_state_GetDevice
(
ID3D11DepthStencilState
*
iface
,
ID3D11Device
**
device
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D11DepthStencilState
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
state
->
device
;
ID3D11Device_AddRef
(
*
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_depthstencil_state_GetPrivateData
(
ID3D11DepthStencilState
*
iface
,
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D11DepthStencilState
(
iface
);
TRACE
(
"iface %p, guid %s, data_size %p, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d_get_private_data
(
&
state
->
private_store
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_depthstencil_state_SetPrivateData
(
ID3D11DepthStencilState
*
iface
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D11DepthStencilState
(
iface
);
TRACE
(
"iface %p, guid %s, data_size %u, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d_set_private_data
(
&
state
->
private_store
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_depthstencil_state_SetPrivateDataInterface
(
ID3D11DepthStencilState
*
iface
,
REFGUID
guid
,
const
IUnknown
*
data
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D11DepthStencilState
(
iface
);
TRACE
(
"iface %p, guid %s, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
);
return
d3d_set_private_data_interface
(
&
state
->
private_store
,
guid
,
data
);
}
static
void
STDMETHODCALLTYPE
d3d11_depthstencil_state_GetDesc
(
ID3D11DepthStencilState
*
iface
,
D3D11_DEPTH_STENCIL_DESC
*
desc
)
{
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
);
}
static
const
struct
ID3D11DepthStencilStateVtbl
d3d11_depthstencil_state_vtbl
=
{
/* IUnknown methods */
d3d11_depthstencil_state_QueryInterface
,
d3d11_depthstencil_state_AddRef
,
d3d11_depthstencil_state_Release
,
/* ID3D11DeviceChild methods */
d3d11_depthstencil_state_GetDevice
,
d3d11_depthstencil_state_GetPrivateData
,
d3d11_depthstencil_state_SetPrivateData
,
d3d11_depthstencil_state_SetPrivateDataInterface
,
/* ID3D11DepthStencilState methods */
d3d11_depthstencil_state_GetDesc
,
};
/* ID3D10DepthStencilState methods */
static
inline
struct
d3d_depthstencil_state
*
impl_from_ID3D10DepthStencilState
(
ID3D10DepthStencilState
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d_depthstencil_state
,
ID3D10DepthStencilState_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_depthstencil_state_QueryInterface
(
ID3D10DepthStencilState
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D10DepthStencilState
(
iface
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
return
d3d11_depthstencil_state_QueryInterface
(
&
state
->
ID3D11DepthStencilState_iface
,
riid
,
object
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_depthstencil_state_AddRef
(
ID3D10DepthStencilState
*
iface
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D10DepthStencilState
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
d3d11_depthstencil_state_AddRef
(
&
state
->
ID3D11DepthStencilState_iface
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_depthstencil_state_Release
(
ID3D10DepthStencilState
*
iface
)
{
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D10DepthStencilState
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
d3d11_depthstencil_state_Release
(
&
state
->
ID3D11DepthStencilState_iface
);
}
/* ID3D10DeviceChild methods */
static
void
STDMETHODCALLTYPE
d3d10_depthstencil_state_GetDevice
(
ID3D10DepthStencilState
*
iface
,
ID3D10Device
**
device
)
...
...
@@ -258,8 +367,7 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDevice(ID3D10DepthSten
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
ID3D10Device
*
)
state
->
device
;
ID3D10Device_AddRef
(
*
device
);
ID3D11Device_QueryInterface
(
state
->
device
,
&
IID_ID3D10Device
,
(
void
**
)
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_depthstencil_state_GetPrivateData
(
ID3D10DepthStencilState
*
iface
,
...
...
@@ -324,6 +432,7 @@ static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
HRESULT
d3d_depthstencil_state_init
(
struct
d3d_depthstencil_state
*
state
,
struct
d3d_device
*
device
,
const
D3D10_DEPTH_STENCIL_DESC
*
desc
)
{
state
->
ID3D11DepthStencilState_iface
.
lpVtbl
=
&
d3d11_depthstencil_state_vtbl
;
state
->
ID3D10DepthStencilState_iface
.
lpVtbl
=
&
d3d10_depthstencil_state_vtbl
;
state
->
refcount
=
1
;
wined3d_mutex_lock
();
...
...
@@ -339,8 +448,8 @@ HRESULT d3d_depthstencil_state_init(struct d3d_depthstencil_state *state, struct
}
wined3d_mutex_unlock
();
state
->
device
=
&
device
->
ID3D1
0Device1
_iface
;
ID3D1
0Device1
_AddRef
(
state
->
device
);
state
->
device
=
&
device
->
ID3D1
1Device
_iface
;
ID3D1
1Device
_AddRef
(
state
->
device
);
return
S_OK
;
}
...
...
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