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
a99907d1
Commit
a99907d1
authored
Aug 14, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Deal with multithreading in event queries.
parent
50c10113
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
device.c
dlls/wined3d/device.c
+2
-1
query.c
dlls/wined3d/query.c
+17
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/device.c
View file @
a99907d1
...
...
@@ -1143,15 +1143,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
break
;
}
case
WINED3DQUERYTYPE_EVENT
:
/* TODO: GL_APPLE_fence */
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
object
->
extendedData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WineQueryEventData
));
GL_EXTCALL
(
glGenFencesAPPLE
(
1
,
&
((
WineQueryEventData
*
)(
object
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glGenFencesAPPLE"
);
((
WineQueryEventData
*
)(
object
->
extendedData
))
->
ctx
=
This
->
activeContext
;
}
else
if
(
GL_SUPPORT
(
NV_FENCE
))
{
object
->
extendedData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WineQueryEventData
));
GL_EXTCALL
(
glGenFencesNV
(
1
,
&
((
WineQueryEventData
*
)(
object
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glGenFencesNV"
);
((
WineQueryEventData
*
)(
object
->
extendedData
))
->
ctx
=
This
->
activeContext
;
}
break
;
...
...
dlls/wined3d/query.c
View file @
a99907d1
...
...
@@ -167,7 +167,12 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
case
WINED3DQUERYTYPE_EVENT
:
{
BOOL
*
data
=
pData
;
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
WineD3DContext
*
ctx
=
((
WineQueryEventData
*
)
This
->
extendedData
)
->
ctx
;
if
(
ctx
!=
This
->
wineD3DDevice
->
activeContext
||
ctx
->
tid
!=
GetCurrentThreadId
())
{
/* See comment in IWineD3DQuery::Issue, event query codeblock */
WARN
(
"Query context not active, reporting GPU idle
\n
"
);
*
data
=
TRUE
;
}
else
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
*
data
=
GL_EXTCALL
(
glTestFenceAPPLE
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
));
checkGLcall
(
"glTestFenceAPPLE"
);
}
else
if
(
GL_SUPPORT
(
NV_FENCE
))
{
...
...
@@ -390,7 +395,17 @@ static HRESULT WINAPI IWineD3DQueryImpl_Issue(IWineD3DQuery* iface, DWORD dwIs
case
WINED3DQUERYTYPE_EVENT
:
{
if
(
dwIssueFlags
&
WINED3DISSUE_END
)
{
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
WineD3DContext
*
ctx
=
((
WineQueryEventData
*
)
This
->
extendedData
)
->
ctx
;
if
(
ctx
!=
This
->
wineD3DDevice
->
activeContext
||
ctx
->
tid
!=
GetCurrentThreadId
())
{
/* GL fences can be used only from the context that created them,
* so if a different context is active, don't bother setting the query. The penalty
* of a context switch is most likely higher than the gain of a correct query result
*
* If the query is used from a different thread, don't bother creating a multithread
* context - there's no point in doing that as the query would be unusable anyway
*/
WARN
(
"Query context not active
\n
"
);
}
else
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
GL_EXTCALL
(
glSetFenceAPPLE
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
));
checkGLcall
(
"glSetFenceAPPLE"
);
}
else
if
(
GL_SUPPORT
(
NV_FENCE
))
{
...
...
dlls/wined3d/wined3d_private.h
View file @
a99907d1
...
...
@@ -1464,6 +1464,7 @@ typedef struct WineQueryOcclusionData {
typedef
struct
WineQueryEventData
{
GLuint
fenceId
;
WineD3DContext
*
ctx
;
}
WineQueryEventData
;
/*****************************************************************************
...
...
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