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
97eb3595
Commit
97eb3595
authored
Jun 22, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send query destruction through the command stream.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9ba058e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
28 deletions
+33
-28
query.c
dlls/wined3d/query.c
+33
-28
No files found.
dlls/wined3d/query.c
View file @
97eb3595
...
...
@@ -233,41 +233,46 @@ ULONG CDECL wined3d_query_incref(struct wined3d_query *query)
return
refcount
;
}
ULONG
CDECL
wined3d_query_decref
(
struct
wined3d_query
*
query
)
static
void
wined3d_query_destroy_object
(
void
*
object
)
{
ULONG
refcount
=
InterlockedDecrement
(
&
query
->
ref
)
;
struct
wined3d_query
*
query
=
object
;
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
query
,
refcount
);
/* Queries are specific to the GL context that created them. Not
* deleting the query will obviously leak it, but that's still better
* than potentially deleting a different query with the same id in this
* context, and (still) leaking the actual query. */
if
(
query
->
type
==
WINED3D_QUERY_TYPE_EVENT
)
{
struct
wined3d_event_query
*
event_query
=
query
->
extendedData
;
if
(
event_query
)
wined3d_event_query_destroy
(
event_query
);
}
else
if
(
query
->
type
==
WINED3D_QUERY_TYPE_OCCLUSION
)
{
struct
wined3d_occlusion_query
*
oq
=
query
->
extendedData
;
if
(
!
refcount
)
if
(
oq
->
context
)
context_free_occlusion_query
(
oq
);
HeapFree
(
GetProcessHeap
(),
0
,
query
->
extendedData
);
}
else
if
(
query
->
type
==
WINED3D_QUERY_TYPE_TIMESTAMP
)
{
/* Queries are specific to the GL context that created them. Not
* deleting the query will obviously leak it, but that's still better
* than potentially deleting a different query with the same id in this
* context, and (still) leaking the actual query. */
if
(
query
->
type
==
WINED3D_QUERY_TYPE_EVENT
)
{
struct
wined3d_event_query
*
event_query
=
query
->
extendedData
;
if
(
event_query
)
wined3d_event_query_destroy
(
event_query
);
}
else
if
(
query
->
type
==
WINED3D_QUERY_TYPE_OCCLUSION
)
{
struct
wined3d_occlusion_query
*
oq
=
query
->
extendedData
;
struct
wined3d_timestamp_query
*
tq
=
query
->
extendedData
;
if
(
oq
->
context
)
context_free_occlusion_query
(
oq
);
HeapFree
(
GetProcessHeap
(),
0
,
query
->
extendedData
);
}
else
if
(
query
->
type
==
WINED3D_QUERY_TYPE_TIMESTAMP
)
{
struct
wined3d_timestamp_query
*
tq
=
query
->
extendedData
;
if
(
tq
->
context
)
context_free_timestamp_query
(
tq
);
HeapFree
(
GetProcessHeap
(),
0
,
query
->
extendedData
);
}
if
(
tq
->
context
)
context_free_timestamp_query
(
tq
);
HeapFree
(
GetProcessHeap
(),
0
,
query
->
extendedData
);
}
HeapFree
(
GetProcessHeap
(),
0
,
query
);
}
HeapFree
(
GetProcessHeap
(),
0
,
query
);
}
ULONG
CDECL
wined3d_query_decref
(
struct
wined3d_query
*
query
)
{
ULONG
refcount
=
InterlockedDecrement
(
&
query
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
query
,
refcount
);
if
(
!
refcount
)
wined3d_cs_emit_destroy_object
(
query
->
device
->
cs
,
wined3d_query_destroy_object
,
query
);
return
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