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
dbc4bcd6
Commit
dbc4bcd6
authored
Feb 17, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Implement d3d10_blend_state_GetDevice().
parent
3363d492
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+1
-1
state.c
dlls/d3d10core/state.c
+12
-3
device.c
dlls/d3d10core/tests/device.c
+12
-2
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
dbc4bcd6
...
@@ -226,9 +226,9 @@ struct d3d10_blend_state
...
@@ -226,9 +226,9 @@ struct d3d10_blend_state
ID3D10BlendState
ID3D10BlendState_iface
;
ID3D10BlendState
ID3D10BlendState_iface
;
LONG
refcount
;
LONG
refcount
;
struct
d3d10_device
*
device
;
D3D10_BLEND_DESC
desc
;
D3D10_BLEND_DESC
desc
;
struct
wine_rb_entry
entry
;
struct
wine_rb_entry
entry
;
ID3D10Device1
*
device
;
};
};
HRESULT
d3d10_blend_state_init
(
struct
d3d10_blend_state
*
state
,
struct
d3d10_device
*
device
,
HRESULT
d3d10_blend_state_init
(
struct
d3d10_blend_state
*
state
,
struct
d3d10_device
*
device
,
...
...
dlls/d3d10core/state.c
View file @
dbc4bcd6
...
@@ -70,7 +70,9 @@ static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface
...
@@ -70,7 +70,9 @@ static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface
if
(
!
refcount
)
if
(
!
refcount
)
{
{
wine_rb_remove
(
&
state
->
device
->
blend_states
,
&
state
->
desc
);
struct
d3d10_device
*
device
=
impl_from_ID3D10Device
(
state
->
device
);
wine_rb_remove
(
&
device
->
blend_states
,
&
state
->
desc
);
ID3D10Device1_Release
(
state
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
state
);
HeapFree
(
GetProcessHeap
(),
0
,
state
);
}
}
...
@@ -81,7 +83,12 @@ static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface
...
@@ -81,7 +83,12 @@ static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface
static
void
STDMETHODCALLTYPE
d3d10_blend_state_GetDevice
(
ID3D10BlendState
*
iface
,
ID3D10Device
**
device
)
static
void
STDMETHODCALLTYPE
d3d10_blend_state_GetDevice
(
ID3D10BlendState
*
iface
,
ID3D10Device
**
device
)
{
{
FIXME
(
"iface %p, device %p stub!
\n
"
,
iface
,
device
);
struct
d3d10_blend_state
*
state
=
impl_from_ID3D10BlendState
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
ID3D10Device
*
)
state
->
device
;
ID3D10Device_AddRef
(
*
device
);
}
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_blend_state_GetPrivateData
(
ID3D10BlendState
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
d3d10_blend_state_GetPrivateData
(
ID3D10BlendState
*
iface
,
...
@@ -142,7 +149,6 @@ HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, struct d3d10_dev
...
@@ -142,7 +149,6 @@ HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, struct d3d10_dev
{
{
state
->
ID3D10BlendState_iface
.
lpVtbl
=
&
d3d10_blend_state_vtbl
;
state
->
ID3D10BlendState_iface
.
lpVtbl
=
&
d3d10_blend_state_vtbl
;
state
->
refcount
=
1
;
state
->
refcount
=
1
;
state
->
device
=
device
;
state
->
desc
=
*
desc
;
state
->
desc
=
*
desc
;
if
(
wine_rb_put
(
&
device
->
blend_states
,
desc
,
&
state
->
entry
)
==
-
1
)
if
(
wine_rb_put
(
&
device
->
blend_states
,
desc
,
&
state
->
entry
)
==
-
1
)
...
@@ -151,6 +157,9 @@ HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, struct d3d10_dev
...
@@ -151,6 +157,9 @@ HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, struct d3d10_dev
return
E_FAIL
;
return
E_FAIL
;
}
}
state
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
state
->
device
);
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/d3d10core/tests/device.c
View file @
dbc4bcd6
...
@@ -661,9 +661,9 @@ static void test_create_sampler_state(void)
...
@@ -661,9 +661,9 @@ static void test_create_sampler_state(void)
static
void
test_create_blend_state
(
void
)
static
void
test_create_blend_state
(
void
)
{
{
ID3D10BlendState
*
blend_state1
,
*
blend_state2
;
ID3D10BlendState
*
blend_state1
,
*
blend_state2
;
ULONG
refcount
,
expected_refcount
;
D3D10_BLEND_DESC
blend_desc
;
D3D10_BLEND_DESC
blend_desc
;
ID3D10Device
*
device
;
ID3D10Device
*
device
,
*
tmp
;
ULONG
refcount
;
HRESULT
hr
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
if
(
!
(
device
=
create_device
()))
...
@@ -699,11 +699,21 @@ static void test_create_blend_state(void)
...
@@ -699,11 +699,21 @@ static void test_create_blend_state(void)
blend_desc
.
RenderTargetWriteMask
[
6
]
=
D3D10_COLOR_WRITE_ENABLE_ALL
;
blend_desc
.
RenderTargetWriteMask
[
6
]
=
D3D10_COLOR_WRITE_ENABLE_ALL
;
blend_desc
.
RenderTargetWriteMask
[
7
]
=
D3D10_COLOR_WRITE_ENABLE_ALL
;
blend_desc
.
RenderTargetWriteMask
[
7
]
=
D3D10_COLOR_WRITE_ENABLE_ALL
;
expected_refcount
=
get_refcount
((
IUnknown
*
)
device
)
+
1
;
hr
=
ID3D10Device_CreateBlendState
(
device
,
&
blend_desc
,
&
blend_state1
);
hr
=
ID3D10Device_CreateBlendState
(
device
,
&
blend_desc
,
&
blend_state1
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create blend state, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create blend state, hr %#x.
\n
"
,
hr
);
hr
=
ID3D10Device_CreateBlendState
(
device
,
&
blend_desc
,
&
blend_state2
);
hr
=
ID3D10Device_CreateBlendState
(
device
,
&
blend_desc
,
&
blend_state2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create blend state, hr %#x.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create blend state, hr %#x.
\n
"
,
hr
);
ok
(
blend_state1
==
blend_state2
,
"Got different blend state objects.
\n
"
);
ok
(
blend_state1
==
blend_state2
,
"Got different blend state objects.
\n
"
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
>=
expected_refcount
,
"Got unexpected refcount %u, expected >= %u.
\n
"
,
refcount
,
expected_refcount
);
tmp
=
NULL
;
expected_refcount
=
refcount
+
1
;
ID3D10BlendState_GetDevice
(
blend_state1
,
&
tmp
);
ok
(
tmp
==
device
,
"Got unexpected device %p, expected %p.
\n
"
,
tmp
,
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ID3D10Device_Release
(
tmp
);
refcount
=
ID3D10BlendState_Release
(
blend_state2
);
refcount
=
ID3D10BlendState_Release
(
blend_state2
);
ok
(
refcount
==
1
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
ok
(
refcount
==
1
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
...
...
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