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
0e8ed9be
Commit
0e8ed9be
authored
Jan 07, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simplify IWineD3DOcclusionQueryImpl_GetData().
parent
ab275ab4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
39 deletions
+47
-39
query.c
dlls/wined3d/query.c
+47
-39
No files found.
dlls/wined3d/query.c
View file @
0e8ed9be
...
...
@@ -268,60 +268,68 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
static
HRESULT
WINAPI
IWineD3DOcclusionQueryImpl_GetData
(
IWineD3DQuery
*
iface
,
void
*
pData
,
DWORD
dwSize
,
DWORD
dwGetDataFlags
)
{
IWineD3DQueryImpl
*
This
=
(
IWineD3DQueryImpl
*
)
iface
;
GLuint
queryId
=
((
WineQueryOcclusionData
*
)
This
->
extendedData
)
->
queryId
;
DWORD
*
data
=
pData
;
GLuint
available
;
GLuint
samples
;
HRESULT
res
;
TRACE
(
"(%p) : type D3DQUERY_OCCLUSION, pData %p, dwSize %#x, dwGetDataFlags %#x
\n
"
,
This
,
pData
,
dwSize
,
dwGetDataFlags
);
if
(
This
->
state
==
QUERY_CREATED
)
{
if
(
This
->
state
==
QUERY_CREATED
)
{
/* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */
TRACE
(
"Query wasn't yet started, returning S_OK
\n
"
);
res
=
S_OK
;
if
(
data
)
*
data
=
0
;
}
else
if
(
This
->
state
==
QUERY_BUILDING
)
{
return
S_OK
;
}
if
(
This
->
state
==
QUERY_BUILDING
)
{
/* Msdn says this returns an error, but our tests show that S_FALSE is returned */
TRACE
(
"Query is building, returning S_FALSE
\n
"
);
re
s
=
S_FALSE
;
re
turn
S_FALSE
;
}
else
if
(
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
{
if
(((
WineQueryOcclusionData
*
)
This
->
extendedData
)
->
ctx
!=
This
->
wineD3DDevice
->
activeContext
||
This
->
wineD3DDevice
->
activeContext
->
tid
!=
GetCurrentThreadId
())
{
FIXME
(
"%p Wrong context, returning 1.
\n
"
,
This
);
*
data
=
1
;
res
=
S_OK
;
}
else
{
GLuint
available
;
GLuint
samples
;
GLuint
queryId
=
((
WineQueryOcclusionData
*
)
This
->
extendedData
)
->
queryId
;
ENTER_GL
();
GL_EXTCALL
(
glGetQueryObjectuivARB
(
queryId
,
GL_QUERY_RESULT_AVAILABLE_ARB
,
&
available
));
checkGLcall
(
"glGetQueryObjectuivARB(GL_QUERY_RESULT_AVAILABLE)
\n
"
);
TRACE
(
"(%p) : available %d.
\n
"
,
This
,
available
);
if
(
available
)
{
if
(
data
)
{
GL_EXTCALL
(
glGetQueryObjectuivARB
(
queryId
,
GL_QUERY_RESULT_ARB
,
&
samples
));
checkGLcall
(
"glGetQueryObjectuivARB(GL_QUERY_RESULT)
\n
"
);
TRACE
(
"(%p) : Returning %d samples.
\n
"
,
This
,
samples
);
*
data
=
samples
;
}
res
=
S_OK
;
}
else
{
res
=
S_FALSE
;
}
LEAVE_GL
();
}
}
else
{
if
(
!
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
{
WARN
(
"(%p) : Occlusion queries not supported. Returning 1.
\n
"
,
This
);
*
data
=
1
;
return
S_OK
;
}
if
(((
WineQueryOcclusionData
*
)
This
->
extendedData
)
->
ctx
!=
This
->
wineD3DDevice
->
activeContext
||
This
->
wineD3DDevice
->
activeContext
->
tid
!=
GetCurrentThreadId
())
{
FIXME
(
"%p Wrong context, returning 1.
\n
"
,
This
);
*
data
=
1
;
return
S_OK
;
}
ENTER_GL
();
GL_EXTCALL
(
glGetQueryObjectuivARB
(
queryId
,
GL_QUERY_RESULT_AVAILABLE_ARB
,
&
available
));
checkGLcall
(
"glGetQueryObjectuivARB(GL_QUERY_RESULT_AVAILABLE)
\n
"
);
TRACE
(
"(%p) : available %d.
\n
"
,
This
,
available
);
if
(
available
)
{
if
(
data
)
{
GL_EXTCALL
(
glGetQueryObjectuivARB
(
queryId
,
GL_QUERY_RESULT_ARB
,
&
samples
));
checkGLcall
(
"glGetQueryObjectuivARB(GL_QUERY_RESULT)
\n
"
);
TRACE
(
"(%p) : Returning %d samples.
\n
"
,
This
,
samples
);
*
data
=
samples
;
}
res
=
S_OK
;
}
else
{
res
=
S_FALSE
;
}
LEAVE_GL
();
return
res
;
}
...
...
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