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
b8bcac51
Commit
b8bcac51
authored
Sep 27, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Oct 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement d3d11_device_CreateRasterizerState().
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
parent
e006be15
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
42 deletions
+56
-42
d3d11_private.h
dlls/d3d11/d3d11_private.h
+2
-2
device.c
dlls/d3d11/device.c
+47
-37
state.c
dlls/d3d11/state.c
+7
-3
No files found.
dlls/d3d11/d3d11_private.h
View file @
b8bcac51
...
...
@@ -314,13 +314,13 @@ struct d3d_rasterizer_state
LONG
refcount
;
struct
wined3d_private_store
private_store
;
D3D1
0
_RASTERIZER_DESC
desc
;
D3D1
1
_RASTERIZER_DESC
desc
;
struct
wine_rb_entry
entry
;
ID3D11Device
*
device
;
};
HRESULT
d3d_rasterizer_state_init
(
struct
d3d_rasterizer_state
*
state
,
struct
d3d_device
*
device
,
const
D3D1
0
_RASTERIZER_DESC
*
desc
)
DECLSPEC_HIDDEN
;
const
D3D1
1
_RASTERIZER_DESC
*
desc
)
DECLSPEC_HIDDEN
;
struct
d3d_rasterizer_state
*
unsafe_impl_from_ID3D10RasterizerState
(
ID3D10RasterizerState
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10SamplerState */
...
...
dlls/d3d11/device.c
View file @
b8bcac51
...
...
@@ -309,9 +309,44 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilState(ID3D11Devi
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateRasterizerState
(
ID3D11Device
*
iface
,
const
D3D11_RASTERIZER_DESC
*
desc
,
ID3D11RasterizerState
**
rasterizer_state
)
{
FIXME
(
"iface %p, desc %p, rasterizer_state %p stub!
\n
"
,
iface
,
desc
,
rasterizer_state
);
struct
d3d_device
*
device
=
impl_from_ID3D11Device
(
iface
);
struct
d3d_rasterizer_state
*
object
;
struct
wine_rb_entry
*
entry
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, desc %p, rasterizer_state %p.
\n
"
,
iface
,
desc
,
rasterizer_state
);
if
(
!
desc
)
return
E_INVALIDARG
;
wined3d_mutex_lock
();
if
((
entry
=
wine_rb_get
(
&
device
->
rasterizer_states
,
desc
)))
{
object
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
d3d_rasterizer_state
,
entry
);
TRACE
(
"Returning existing rasterizer state %p.
\n
"
,
object
);
*
rasterizer_state
=
&
object
->
ID3D11RasterizerState_iface
;
ID3D11RasterizerState_AddRef
(
*
rasterizer_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_rasterizer_state_init
(
object
,
device
,
desc
)))
{
WARN
(
"Failed to initialize rasterizer state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created rasterizer state %p.
\n
"
,
object
);
*
rasterizer_state
=
&
object
->
ID3D11RasterizerState_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateSamplerState
(
ID3D11Device
*
iface
,
...
...
@@ -1106,7 +1141,7 @@ static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device1 *iface)
static
void
STDMETHODCALLTYPE
d3d10_device_RSSetState
(
ID3D10Device1
*
iface
,
ID3D10RasterizerState
*
rasterizer_state
)
{
struct
d3d_device
*
device
=
impl_from_ID3D10Device
(
iface
);
const
D3D1
0
_RASTERIZER_DESC
*
desc
;
const
D3D1
1
_RASTERIZER_DESC
*
desc
;
TRACE
(
"iface %p, rasterizer_state %p.
\n
"
,
iface
,
rasterizer_state
);
...
...
@@ -2434,44 +2469,19 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device
const
D3D10_RASTERIZER_DESC
*
desc
,
ID3D10RasterizerState
**
rasterizer_state
)
{
struct
d3d_device
*
device
=
impl_from_ID3D10Device
(
iface
);
struct
d3d_rasterizer_state
*
object
;
struct
wine_rb_entry
*
entry
;
ID3D11RasterizerState
*
d3d11_rasterizer_state
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p, rasterizer_state %p.
\n
"
,
iface
,
desc
,
rasterizer_state
);
if
(
!
desc
)
return
E_INVALIDARG
;
wined3d_mutex_lock
();
if
((
entry
=
wine_rb_get
(
&
device
->
rasterizer_states
,
desc
)))
{
object
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
d3d_rasterizer_state
,
entry
);
TRACE
(
"Returning existing rasterizer state %p.
\n
"
,
object
);
*
rasterizer_state
=
&
object
->
ID3D10RasterizerState_iface
;
ID3D10RasterizerState_AddRef
(
*
rasterizer_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_rasterizer_state_init
(
object
,
device
,
desc
)))
{
WARN
(
"Failed to initialize rasterizer state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
if
(
FAILED
(
hr
=
d3d11_device_CreateRasterizerState
(
&
device
->
ID3D11Device_iface
,
(
const
D3D11_RASTERIZER_DESC
*
)
desc
,
&
d3d11_rasterizer_state
)))
return
hr
;
}
TRACE
(
"Created rasterizer state %p.
\n
"
,
object
);
*
rasterizer_state
=
&
object
->
ID3D10RasterizerState_iface
;
return
S_OK
;
hr
=
ID3D11RasterizerState_QueryInterface
(
d3d11_rasterizer_state
,
&
IID_ID3D10RasterizerState
,
(
void
**
)
rasterizer_state
)
;
ID3D11RasterizerState_Release
(
d3d11_rasterizer_state
);
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateSamplerState
(
ID3D10Device1
*
iface
,
...
...
@@ -3099,8 +3109,8 @@ static const struct wine_rb_functions d3d10_depthstencil_state_rb_ops =
static
int
d3d_rasterizer_state_compare
(
const
void
*
key
,
const
struct
wine_rb_entry
*
entry
)
{
const
D3D1
0
_RASTERIZER_DESC
*
ka
=
key
;
const
D3D1
0
_RASTERIZER_DESC
*
kb
=
&
WINE_RB_ENTRY_VALUE
(
entry
,
const
struct
d3d_rasterizer_state
,
entry
)
->
desc
;
const
D3D1
1
_RASTERIZER_DESC
*
ka
=
key
;
const
D3D1
1
_RASTERIZER_DESC
*
kb
=
&
WINE_RB_ENTRY_VALUE
(
entry
,
const
struct
d3d_rasterizer_state
,
entry
)
->
desc
;
return
memcmp
(
ka
,
kb
,
sizeof
(
*
ka
));
}
...
...
dlls/d3d11/state.c
View file @
b8bcac51
...
...
@@ -466,7 +466,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_SetPrivateDataInterface(
static
void
STDMETHODCALLTYPE
d3d11_rasterizer_state_GetDesc
(
ID3D11RasterizerState
*
iface
,
D3D11_RASTERIZER_DESC
*
desc
)
{
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
);
struct
d3d_rasterizer_state
*
state
=
impl_from_ID3D11RasterizerState
(
iface
);
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
*
desc
=
state
->
desc
;
}
static
const
struct
ID3D11RasterizerStateVtbl
d3d11_rasterizer_state_vtbl
=
...
...
@@ -573,7 +577,7 @@ static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDesc(ID3D10RasterizerSta
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
*
desc
=
state
->
desc
;
memcpy
(
desc
,
&
state
->
desc
,
sizeof
(
*
desc
))
;
}
static
const
struct
ID3D10RasterizerStateVtbl
d3d10_rasterizer_state_vtbl
=
...
...
@@ -592,7 +596,7 @@ static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl =
};
HRESULT
d3d_rasterizer_state_init
(
struct
d3d_rasterizer_state
*
state
,
struct
d3d_device
*
device
,
const
D3D1
0
_RASTERIZER_DESC
*
desc
)
const
D3D1
1
_RASTERIZER_DESC
*
desc
)
{
state
->
ID3D11RasterizerState_iface
.
lpVtbl
=
&
d3d11_rasterizer_state_vtbl
;
state
->
ID3D10RasterizerState_iface
.
lpVtbl
=
&
d3d10_rasterizer_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