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
a77015c7
Commit
a77015c7
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 d3d11_device_CreateDepthStencilState().
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
parent
16e570f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
54 deletions
+68
-54
d3d11_private.h
dlls/d3d11/d3d11_private.h
+2
-2
device.c
dlls/d3d11/device.c
+59
-49
state.c
dlls/d3d11/state.c
+7
-3
No files found.
dlls/d3d11/d3d11_private.h
View file @
a77015c7
...
...
@@ -299,13 +299,13 @@ struct d3d_depthstencil_state
LONG
refcount
;
struct
wined3d_private_store
private_store
;
D3D1
0
_DEPTH_STENCIL_DESC
desc
;
D3D1
1
_DEPTH_STENCIL_DESC
desc
;
struct
wine_rb_entry
entry
;
ID3D11Device
*
device
;
};
HRESULT
d3d_depthstencil_state_init
(
struct
d3d_depthstencil_state
*
state
,
struct
d3d_device
*
device
,
const
D3D1
0
_DEPTH_STENCIL_DESC
*
desc
)
DECLSPEC_HIDDEN
;
const
D3D1
1
_DEPTH_STENCIL_DESC
*
desc
)
DECLSPEC_HIDDEN
;
struct
d3d_depthstencil_state
*
unsafe_impl_from_ID3D10DepthStencilState
(
ID3D10DepthStencilState
*
iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3d11/device.c
View file @
a77015c7
...
...
@@ -313,9 +313,57 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState(ID3D11Device *ifa
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateDepthStencilState
(
ID3D11Device
*
iface
,
const
D3D11_DEPTH_STENCIL_DESC
*
desc
,
ID3D11DepthStencilState
**
depth_stencil_state
)
{
FIXME
(
"iface %p, desc %p, depth_stencil_state %p stub!
\n
"
,
iface
,
desc
,
depth_stencil_state
);
struct
d3d_device
*
device
=
impl_from_ID3D11Device
(
iface
);
struct
d3d_depthstencil_state
*
object
;
D3D11_DEPTH_STENCIL_DESC
tmp_desc
;
struct
wine_rb_entry
*
entry
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, desc %p, depth_stencil_state %p.
\n
"
,
iface
,
desc
,
depth_stencil_state
);
if
(
!
desc
)
return
E_INVALIDARG
;
/* D3D11_DEPTH_STENCIL_DESC has a hole, which is a problem because we use
* it as a key in the rbtree. */
memset
(
&
tmp_desc
,
0
,
sizeof
(
tmp_desc
));
tmp_desc
.
DepthEnable
=
desc
->
DepthEnable
;
tmp_desc
.
DepthWriteMask
=
desc
->
DepthWriteMask
;
tmp_desc
.
DepthFunc
=
desc
->
DepthFunc
;
tmp_desc
.
StencilEnable
=
desc
->
StencilEnable
;
tmp_desc
.
StencilReadMask
=
desc
->
StencilReadMask
;
tmp_desc
.
StencilWriteMask
=
desc
->
StencilWriteMask
;
tmp_desc
.
FrontFace
=
desc
->
FrontFace
;
tmp_desc
.
BackFace
=
desc
->
BackFace
;
wined3d_mutex_lock
();
if
((
entry
=
wine_rb_get
(
&
device
->
depthstencil_states
,
&
tmp_desc
)))
{
object
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
d3d_depthstencil_state
,
entry
);
TRACE
(
"Returning existing depthstencil state %p.
\n
"
,
object
);
*
depth_stencil_state
=
&
object
->
ID3D11DepthStencilState_iface
;
ID3D11DepthStencilState_AddRef
(
*
depth_stencil_state
);
wined3d_mutex_unlock
();
return
S_OK
;
}
wined3d_mutex_unlock
();
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_depthstencil_state_init
(
object
,
device
,
&
tmp_desc
)))
{
WARN
(
"Failed to initialize depthstencil state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created depthstencil state %p.
\n
"
,
object
);
*
depth_stencil_state
=
&
object
->
ID3D11DepthStencilState_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateRasterizerState
(
ID3D11Device
*
iface
,
...
...
@@ -2414,57 +2462,19 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Devi
const
D3D10_DEPTH_STENCIL_DESC
*
desc
,
ID3D10DepthStencilState
**
depth_stencil_state
)
{
struct
d3d_device
*
device
=
impl_from_ID3D10Device
(
iface
);
struct
d3d_depthstencil_state
*
object
;
D3D10_DEPTH_STENCIL_DESC
tmp_desc
;
struct
wine_rb_entry
*
entry
;
ID3D11DepthStencilState
*
d3d11_depth_stencil_state
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p, depth_stencil_state %p.
\n
"
,
iface
,
desc
,
depth_stencil_state
);
if
(
!
desc
)
return
E_INVALIDARG
;
/* D3D10_DEPTH_STENCIL_DESC has a hole, which is a problem because we use
* it as a key in the rbtree. */
memset
(
&
tmp_desc
,
0
,
sizeof
(
tmp_desc
));
tmp_desc
.
DepthEnable
=
desc
->
DepthEnable
;
tmp_desc
.
DepthWriteMask
=
desc
->
DepthWriteMask
;
tmp_desc
.
DepthFunc
=
desc
->
DepthFunc
;
tmp_desc
.
StencilEnable
=
desc
->
StencilEnable
;
tmp_desc
.
StencilReadMask
=
desc
->
StencilReadMask
;
tmp_desc
.
StencilWriteMask
=
desc
->
StencilWriteMask
;
tmp_desc
.
FrontFace
=
desc
->
FrontFace
;
tmp_desc
.
BackFace
=
desc
->
BackFace
;
wined3d_mutex_lock
();
if
((
entry
=
wine_rb_get
(
&
device
->
depthstencil_states
,
&
tmp_desc
)))
{
object
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
d3d_depthstencil_state
,
entry
);
TRACE
(
"Returning existing depthstencil state %p.
\n
"
,
object
);
*
depth_stencil_state
=
&
object
->
ID3D10DepthStencilState_iface
;
ID3D10DepthStencilState_AddRef
(
*
depth_stencil_state
);
wined3d_mutex_unlock
();
return
S_OK
;
}
wined3d_mutex_unlock
();
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_depthstencil_state_init
(
object
,
device
,
&
tmp_desc
)))
{
WARN
(
"Failed to initialize depthstencil state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
if
(
FAILED
(
hr
=
d3d11_device_CreateDepthStencilState
(
&
device
->
ID3D11Device_iface
,
(
const
D3D11_DEPTH_STENCIL_DESC
*
)
desc
,
&
d3d11_depth_stencil_state
)))
return
hr
;
}
TRACE
(
"Created depthstencil state %p.
\n
"
,
object
);
*
depth_stencil_state
=
&
object
->
ID3D10DepthStencilState_iface
;
return
S_OK
;
hr
=
ID3D11DepthStencilState_QueryInterface
(
d3d11_depth_stencil_state
,
&
IID_ID3D10DepthStencilState
,
(
void
**
)
depth_stencil_state
);
ID3D11DepthStencilState_Release
(
d3d11_depth_stencil_state
);
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateRasterizerState
(
ID3D10Device1
*
iface
,
...
...
@@ -3094,8 +3104,8 @@ static const struct wine_rb_functions d3d10_blend_state_rb_ops =
static
int
d3d_depthstencil_state_compare
(
const
void
*
key
,
const
struct
wine_rb_entry
*
entry
)
{
const
D3D1
0
_DEPTH_STENCIL_DESC
*
ka
=
key
;
const
D3D1
0
_DEPTH_STENCIL_DESC
*
kb
=
&
WINE_RB_ENTRY_VALUE
(
entry
,
const
D3D1
1
_DEPTH_STENCIL_DESC
*
ka
=
key
;
const
D3D1
1
_DEPTH_STENCIL_DESC
*
kb
=
&
WINE_RB_ENTRY_VALUE
(
entry
,
const
struct
d3d_depthstencil_state
,
entry
)
->
desc
;
return
memcmp
(
ka
,
kb
,
sizeof
(
*
ka
));
...
...
dlls/d3d11/state.c
View file @
a77015c7
...
...
@@ -304,7 +304,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_SetPrivateDataInterfac
static
void
STDMETHODCALLTYPE
d3d11_depthstencil_state_GetDesc
(
ID3D11DepthStencilState
*
iface
,
D3D11_DEPTH_STENCIL_DESC
*
desc
)
{
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
);
struct
d3d_depthstencil_state
*
state
=
impl_from_ID3D11DepthStencilState
(
iface
);
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
*
desc
=
state
->
desc
;
}
static
const
struct
ID3D11DepthStencilStateVtbl
d3d11_depthstencil_state_vtbl
=
...
...
@@ -411,7 +415,7 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDesc(ID3D10DepthStenci
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
*
desc
=
state
->
desc
;
memcpy
(
desc
,
&
state
->
desc
,
sizeof
(
*
desc
))
;
}
static
const
struct
ID3D10DepthStencilStateVtbl
d3d10_depthstencil_state_vtbl
=
...
...
@@ -430,7 +434,7 @@ static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
};
HRESULT
d3d_depthstencil_state_init
(
struct
d3d_depthstencil_state
*
state
,
struct
d3d_device
*
device
,
const
D3D1
0
_DEPTH_STENCIL_DESC
*
desc
)
const
D3D1
1
_DEPTH_STENCIL_DESC
*
desc
)
{
state
->
ID3D11DepthStencilState_iface
.
lpVtbl
=
&
d3d11_depthstencil_state_vtbl
;
state
->
ID3D10DepthStencilState_iface
.
lpVtbl
=
&
d3d10_depthstencil_state_vtbl
;
...
...
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