mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
gl: Fix leaking occlusion queries
- GL queries share the target binding (not asynchronous!) - Discard active queries by closing them, leave closed queries alone (nothing to be done for discard op)
This commit is contained in:
parent
22af70d0d0
commit
9fce5b0f7a
1 changed files with 8 additions and 4 deletions
|
@ -1593,7 +1593,7 @@ void GLGSRender::begin_occlusion_query(rsx::reports::occlusion_query_info* query
|
||||||
|
|
||||||
void GLGSRender::end_occlusion_query(rsx::reports::occlusion_query_info* query)
|
void GLGSRender::end_occlusion_query(rsx::reports::occlusion_query_info* query)
|
||||||
{
|
{
|
||||||
if (query->num_draws)
|
verify(HERE), query->active;
|
||||||
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1612,7 +1612,7 @@ void GLGSRender::get_occlusion_query_result(rsx::reports::occlusion_query_info*
|
||||||
{
|
{
|
||||||
if (query->num_draws)
|
if (query->num_draws)
|
||||||
{
|
{
|
||||||
GLint result;
|
GLint result = 0;
|
||||||
glGetQueryObjectiv((GLuint)query->driver_handle, GL_QUERY_RESULT, &result);
|
glGetQueryObjectiv((GLuint)query->driver_handle, GL_QUERY_RESULT, &result);
|
||||||
|
|
||||||
query->result += result;
|
query->result += result;
|
||||||
|
@ -1621,8 +1621,12 @@ void GLGSRender::get_occlusion_query_result(rsx::reports::occlusion_query_info*
|
||||||
|
|
||||||
void GLGSRender::discard_occlusion_query(rsx::reports::occlusion_query_info* query)
|
void GLGSRender::discard_occlusion_query(rsx::reports::occlusion_query_info* query)
|
||||||
{
|
{
|
||||||
|
if (query->active)
|
||||||
|
{
|
||||||
|
//Discard is being called on an active query, close it
|
||||||
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GLGSRender::shell_do_cleanup()
|
void GLGSRender::shell_do_cleanup()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue