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
f38b36ee
Commit
f38b36ee
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_query_GetDevice().
parent
569a2e75
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
9 deletions
+29
-9
async.c
dlls/d3d10core/async.c
+10
-2
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+2
-1
device.c
dlls/d3d10core/device.c
+5
-4
device.c
dlls/d3d10core/tests/device.c
+12
-2
No files found.
dlls/d3d10core/async.c
View file @
f38b36ee
...
...
@@ -73,6 +73,7 @@ static ULONG STDMETHODCALLTYPE d3d10_query_Release(ID3D10Query *iface)
if
(
!
refcount
)
{
ID3D10Device1_Release
(
This
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -83,7 +84,12 @@ static ULONG STDMETHODCALLTYPE d3d10_query_Release(ID3D10Query *iface)
static
void
STDMETHODCALLTYPE
d3d10_query_GetDevice
(
ID3D10Query
*
iface
,
ID3D10Device
**
device
)
{
FIXME
(
"iface %p, device %p stub!
\n
"
,
iface
,
device
);
struct
d3d10_query
*
query
=
impl_from_ID3D10Query
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
ID3D10Device
*
)
query
->
device
;
ID3D10Device_AddRef
(
*
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_query_GetPrivateData
(
ID3D10Query
*
iface
,
...
...
@@ -165,11 +171,13 @@ static const struct ID3D10QueryVtbl d3d10_query_vtbl =
d3d10_query_GetDesc
,
};
HRESULT
d3d10_query_init
(
struct
d3d10_query
*
query
,
BOOL
predicate
)
HRESULT
d3d10_query_init
(
struct
d3d10_query
*
query
,
struct
d3d10_device
*
device
,
BOOL
predicate
)
{
query
->
ID3D10Query_iface
.
lpVtbl
=
&
d3d10_query_vtbl
;
query
->
refcount
=
1
;
query
->
predicate
=
predicate
;
query
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
query
->
device
);
return
S_OK
;
}
dlls/d3d10core/d3d10core_private.h
View file @
f38b36ee
...
...
@@ -289,9 +289,10 @@ struct d3d10_query
LONG
refcount
;
BOOL
predicate
;
ID3D10Device1
*
device
;
};
HRESULT
d3d10_query_init
(
struct
d3d10_query
*
query
,
BOOL
predicate
)
DECLSPEC_HIDDEN
;
HRESULT
d3d10_query_init
(
struct
d3d10_query
*
query
,
struct
d3d10_device
*
device
,
BOOL
predicate
)
DECLSPEC_HIDDEN
;
/* IDirect3D10Device1 */
struct
d3d10_device
...
...
dlls/d3d10core/device.c
View file @
f38b36ee
...
...
@@ -1527,16 +1527,16 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 *
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateQuery
(
ID3D10Device1
*
iface
,
const
D3D10_QUERY_DESC
*
desc
,
ID3D10Query
**
query
)
{
struct
d3d10_device
*
device
=
impl_from_ID3D10Device
(
iface
);
struct
d3d10_query
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p, query %p.
\n
"
,
iface
,
desc
,
query
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d10_query_init
(
object
,
FALSE
)))
if
(
FAILED
(
hr
=
d3d10_query_init
(
object
,
device
,
FALSE
)))
{
WARN
(
"Failed to initialize query, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
...
...
@@ -1552,6 +1552,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device1 *iface,
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreatePredicate
(
ID3D10Device1
*
iface
,
const
D3D10_QUERY_DESC
*
desc
,
ID3D10Predicate
**
predicate
)
{
struct
d3d10_device
*
device
=
impl_from_ID3D10Device
(
iface
);
struct
d3d10_query
*
object
;
HRESULT
hr
;
...
...
@@ -1569,7 +1570,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device1 *ifa
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d10_query_init
(
object
,
TRUE
)))
if
(
FAILED
(
hr
=
d3d10_query_init
(
object
,
device
,
TRUE
)))
{
WARN
(
"Failed to initialize predicate, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
...
...
dlls/d3d10core/tests/device.c
View file @
f38b36ee
...
...
@@ -836,10 +836,10 @@ static void test_create_rasterizer_state(void)
static
void
test_create_predicate
(
void
)
{
ULONG
refcount
,
expected_refcount
;
D3D10_QUERY_DESC
query_desc
;
ID3D10Predicate
*
predicate
;
ID3D10Device
*
device
;
ULONG
refcount
;
ID3D10Device
*
device
,
*
tmp
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
...
...
@@ -857,8 +857,18 @@ static void test_create_predicate(void)
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#x.
\n
"
,
hr
);
query_desc
.
Query
=
D3D10_QUERY_OCCLUSION_PREDICATE
;
expected_refcount
=
get_refcount
((
IUnknown
*
)
device
)
+
1
;
hr
=
ID3D10Device_CreatePredicate
(
device
,
&
query_desc
,
&
predicate
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create predicate, hr %#x.
\n
"
,
hr
);
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
;
ID3D10Predicate_GetDevice
(
predicate
,
&
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
);
ID3D10Predicate_Release
(
predicate
);
query_desc
.
Query
=
D3D10_QUERY_SO_OVERFLOW_PREDICATE
;
...
...
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