mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00: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,8 +1593,8 @@ void GLGSRender::begin_occlusion_query(rsx::reports::occlusion_query_info* query
|
|||
|
||||
void GLGSRender::end_occlusion_query(rsx::reports::occlusion_query_info* query)
|
||||
{
|
||||
if (query->num_draws)
|
||||
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
||||
verify(HERE), query->active;
|
||||
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
||||
}
|
||||
|
||||
bool GLGSRender::check_occlusion_query_status(rsx::reports::occlusion_query_info* query)
|
||||
|
@ -1612,7 +1612,7 @@ void GLGSRender::get_occlusion_query_result(rsx::reports::occlusion_query_info*
|
|||
{
|
||||
if (query->num_draws)
|
||||
{
|
||||
GLint result;
|
||||
GLint result = 0;
|
||||
glGetQueryObjectiv((GLuint)query->driver_handle, GL_QUERY_RESULT, &result);
|
||||
|
||||
query->result += result;
|
||||
|
@ -1621,7 +1621,11 @@ void GLGSRender::get_occlusion_query_result(rsx::reports::occlusion_query_info*
|
|||
|
||||
void GLGSRender::discard_occlusion_query(rsx::reports::occlusion_query_info* query)
|
||||
{
|
||||
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
||||
if (query->active)
|
||||
{
|
||||
//Discard is being called on an active query, close it
|
||||
glEndQuery(GL_ANY_SAMPLES_PASSED);
|
||||
}
|
||||
}
|
||||
|
||||
void GLGSRender::shell_do_cleanup()
|
||||
|
|
Loading…
Add table
Reference in a new issue