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
a02c7ce7
Commit
a02c7ce7
authored
Jul 21, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of redundant ARB_occlusion_query checks.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d18ff87a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
60 deletions
+45
-60
query.c
dlls/wined3d/query.c
+45
-60
No files found.
dlls/wined3d/query.c
View file @
a02c7ce7
...
...
@@ -337,14 +337,6 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
return
S_FALSE
;
}
if
(
!
gl_info
->
supported
[
ARB_OCCLUSION_QUERY
])
{
WARN
(
"%p Occlusion queries not supported. Returning 1.
\n
"
,
query
);
samples
=
1
;
fill_query_data
(
data
,
size
,
&
samples
,
sizeof
(
samples
));
return
S_OK
;
}
if
(
oq
->
context
->
tid
!=
GetCurrentThreadId
())
{
FIXME
(
"%p Wrong thread, returning 1.
\n
"
,
query
);
...
...
@@ -461,77 +453,70 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
static
HRESULT
wined3d_occlusion_query_ops_issue
(
struct
wined3d_query
*
query
,
DWORD
flags
)
{
struct
wined3d_occlusion_query
*
oq
=
query
->
extendedData
;
struct
wined3d_device
*
device
=
query
->
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
struct
wined3d_context
*
context
;
TRACE
(
"query %p, flags %#x.
\n
"
,
query
,
flags
);
if
(
gl_info
->
supported
[
ARB_OCCLUSION_QUERY
])
/* This is allowed according to MSDN and our tests. Reset the query and
* restart. */
if
(
flags
&
WINED3DISSUE_BEGIN
)
{
struct
wined3d_occlusion_query
*
oq
=
query
->
extendedData
;
struct
wined3d_context
*
context
;
/* This is allowed according to msdn and our tests. Reset the query and restart */
if
(
flags
&
WINED3DISSUE_BEGIN
)
if
(
query
->
state
==
QUERY_BUILDING
)
{
if
(
query
->
state
==
QUERY_BUILDING
)
if
(
oq
->
context
->
tid
!=
GetCurrentThreadId
()
)
{
if
(
oq
->
context
->
tid
!=
GetCurrentThreadId
())
{
FIXME
(
"Wrong thread, can't restart query.
\n
"
);
context_free_occlusion_query
(
oq
);
context
=
context_acquire
(
query
->
device
,
NULL
);
context_alloc_occlusion_query
(
context
,
oq
);
}
else
{
context
=
context_acquire
(
device
,
context_get_rt_surface
(
oq
->
context
));
GL_EXTCALL
(
glEndQuery
(
GL_SAMPLES_PASSED
));
checkGLcall
(
"glEndQuery()"
);
}
FIXME
(
"Wrong thread, can't restart query.
\n
"
);
context_free_occlusion_query
(
oq
);
context
=
context_acquire
(
query
->
device
,
NULL
);
context_alloc_occlusion_query
(
context
,
oq
);
}
else
{
if
(
oq
->
context
)
context_free_occlusion_query
(
oq
);
context
=
context_acquire
(
query
->
device
,
NULL
);
context_alloc_occlusion_query
(
context
,
oq
);
context
=
context_acquire
(
device
,
context_get_rt_surface
(
oq
->
context
));
GL_EXTCALL
(
glEndQuery
(
GL_SAMPLES_PASSED
));
checkGLcall
(
"glEndQuery()"
);
}
}
else
{
if
(
oq
->
context
)
context_free_occlusion_query
(
oq
);
context
=
context_acquire
(
query
->
device
,
NULL
);
context_alloc_occlusion_query
(
context
,
oq
);
}
GL_EXTCALL
(
glBeginQuery
(
GL_SAMPLES_PASSED
,
oq
->
id
));
checkGLcall
(
"glBeginQuery()"
);
GL_EXTCALL
(
glBeginQuery
(
GL_SAMPLES_PASSED
,
oq
->
id
));
checkGLcall
(
"glBeginQuery()"
);
context_release
(
context
);
}
if
(
flags
&
WINED3DISSUE_END
)
context_release
(
context
);
}
if
(
flags
&
WINED3DISSUE_END
)
{
/* MSDN says END on a non-building occlusion query returns an error,
* but our tests show that it returns OK. But OpenGL doesn't like it,
* so avoid generating an error. */
if
(
query
->
state
==
QUERY_BUILDING
)
{
/* Msdn says _END on a non-building occlusion query returns an error, but
* our tests show that it returns OK. But OpenGL doesn't like it, so avoid
* generating an error
*/
if
(
query
->
state
==
QUERY_BUILDING
)
if
(
oq
->
context
->
tid
!=
GetCurrentThreadId
())
{
FIXME
(
"Wrong thread, can't end query.
\n
"
);
}
else
{
if
(
oq
->
context
->
tid
!=
GetCurrentThreadId
())
{
FIXME
(
"Wrong thread, can't end query.
\n
"
);
}
else
{
context
=
context_acquire
(
device
,
context_get_rt_surface
(
oq
->
context
));
GL_EXTCALL
(
glEndQuery
(
GL_SAMPLES_PASSED
));
checkGLcall
(
"glEndQuery()"
);
context_release
(
context
);
}
context
=
context_acquire
(
device
,
context_get_rt_surface
(
oq
->
context
));
GL_EXTCALL
(
glEndQuery
(
GL_SAMPLES_PASSED
));
checkGLcall
(
"glEndQuery()"
);
context_release
(
context
);
}
}
}
else
{
FIXME
(
"%p Occlusion queries not supported.
\n
"
,
query
);
}
if
(
flags
&
WINED3DISSUE_BEGIN
)
query
->
state
=
QUERY_BUILDING
;
...
...
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