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
76b60b05
Commit
76b60b05
authored
Mar 01, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Support event queries using GL_NV_fence.
parent
be8e9e17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
7 deletions
+44
-7
device.c
dlls/wined3d/device.c
+15
-5
query.c
dlls/wined3d/query.c
+26
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-0
No files found.
dlls/wined3d/device.c
View file @
76b60b05
...
...
@@ -1075,10 +1075,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
break
;
case
WINED3DQUERYTYPE_EVENT
:
/* Half-Life 2 needs this query. It does not render the main menu correctly otherwise
* Pretend to support it, faking this query does not do much harm except potentially lowering performance
*/
FIXME
(
"(%p) Event query: Unimplemented, but pretending to be supported
\n
"
,
This
);
if
(
!
GL_SUPPORT
(
NV_FENCE
))
{
/* Half-Life 2 needs this query. It does not render the main menu correctly otherwise
* Pretend to support it, faking this query does not do much harm except potentially lowering performance
*/
FIXME
(
"(%p) Event query: Unimplemented, but pretending to be supported
\n
"
,
This
);
}
hr
=
WINED3D_OK
;
break
;
...
...
@@ -1112,10 +1114,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
GL_EXTCALL
(
glGenQueriesARB
(
1
,
&
((
WineQueryOcclusionData
*
)(
object
->
extendedData
))
->
queryId
));
break
;
}
case
WINED3DQUERYTYPE_EVENT
:
/* TODO: GL_APPLE_fence */
if
(
GL_SUPPORT
(
NV_FENCE
))
{
object
->
extendedData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WineQueryEventData
));
GL_EXTCALL
(
glGenFencesNV
(
1
,
&
((
WineQueryEventData
*
)(
object
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glGenFencesNV"
);
}
break
;
case
WINED3DQUERYTYPE_VCACHE
:
case
WINED3DQUERYTYPE_RESOURCEMANAGER
:
case
WINED3DQUERYTYPE_VERTEXSTATS
:
case
WINED3DQUERYTYPE_EVENT
:
case
WINED3DQUERYTYPE_TIMESTAMP
:
case
WINED3DQUERYTYPE_TIMESTAMPDISJOINT
:
case
WINED3DQUERYTYPE_TIMESTAMPFREQ
:
...
...
dlls/wined3d/query.c
View file @
76b60b05
...
...
@@ -65,6 +65,14 @@ static ULONG WINAPI IWineD3DQueryImpl_Release(IWineD3DQuery *iface) {
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
This
->
ref
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
This
->
type
==
WINED3DQUERYTYPE_EVENT
&&
GL_SUPPORT
(
NV_FENCE
))
{
GL_EXTCALL
(
glDeleteFencesNV
(
1
,
&
((
WineQueryEventData
*
)(
This
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glDeleteFencesNV"
);
}
else
if
(
This
->
type
==
WINED3DQUERYTYPE_OCCLUSION
&&
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
{
GL_EXTCALL
(
glDeleteQueriesARB
(
1
,
&
((
WineQueryOcclusionData
*
)(
This
->
extendedData
))
->
queryId
));
checkGLcall
(
"glDeleteQueriesARB"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
extendedData
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -154,8 +162,13 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
case
WINED3DQUERYTYPE_EVENT
:
{
BOOL
*
data
=
pData
;
FIXME
(
"(%p): Unimplemented query WINED3DQUERYTYPE_EVENT
\n
"
,
This
);
*
data
=
TRUE
;
/*Don't know what this is supposed to be*/
if
(
GL_SUPPORT
(
NV_FENCE
))
{
*
data
=
GL_EXTCALL
(
glTestFenceNV
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
));
checkGLcall
(
"glTestFenceNV"
);
}
else
{
WARN
(
"(%p): reporting GPU idle
\n
"
,
This
);
*
data
=
TRUE
;
}
}
break
;
case
WINED3DQUERYTYPE_OCCLUSION
:
...
...
@@ -367,6 +380,17 @@ static HRESULT WINAPI IWineD3DQueryImpl_Issue(IWineD3DQuery* iface, DWORD dwIs
}
break
;
case
WINED3DQUERYTYPE_EVENT
:
{
if
(
GL_SUPPORT
(
GL_NV_fence
))
{
if
(
dwIssueFlags
&
WINED3DISSUE_END
)
{
GL_EXTCALL
(
glSetFenceNV
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
,
GL_ALL_COMPLETED_NV
));
}
else
if
(
dwIssueFlags
&
WINED3DISSUE_BEGIN
)
{
/* Started implicitly at device creation */
ERR
(
"Event query issued with START flag - what to do?
\n
"
);
}
}
}
default
:
/* The fixme is printed when the app asks for the resulting data */
WARN
(
"(%p) : Unhandled query type %#x
\n
"
,
This
,
This
->
type
);
...
...
dlls/wined3d/wined3d_private.h
View file @
76b60b05
...
...
@@ -1339,6 +1339,9 @@ typedef struct WineQueryOcclusionData {
GLuint
queryId
;
}
WineQueryOcclusionData
;
typedef
struct
WineQueryEventData
{
GLuint
fenceId
;
}
WineQueryEventData
;
/*****************************************************************************
* IWineD3DSwapChainImpl implementation structure (extends IUnknown)
...
...
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