gl: Avoid creating surface copies when strict mode is disabled.

This commit is contained in:
kd-11 2017-06-27 18:19:06 +03:00
parent 3651e67a25
commit 9cb58a47cd
1 changed files with 14 additions and 1 deletions

View File

@ -781,10 +781,23 @@ namespace gl
LOG_WARNING(RSX, "Surface blit from a compressed texture"); LOG_WARNING(RSX, "Surface blit from a compressed texture");
} }
if (!rsc.is_bound) if (!rsc.is_bound || !g_cfg.video.strict_rendering_mode)
{ {
if (rsc.w == tex_width && rsc.h == tex_height) if (rsc.w == tex_width && rsc.h == tex_height)
{
if (rsc.is_bound)
{
LOG_WARNING(RSX, "Sampling from a currently bound render target @ 0x%x", texaddr);
auto &caps = gl::get_driver_caps();
if (caps.ARB_texture_barrier_supported)
glTextureBarrier();
else if (caps.NV_texture_barrier_supported)
glTextureBarrierNV();
}
rsc.surface->bind(); rsc.surface->bind();
}
else else
bound_index = create_temporary_subresource(rsc.surface->id(), (GLenum)rsc.surface->get_compatible_internal_format(), rsc.x, rsc.y, rsc.w, rsc.h); bound_index = create_temporary_subresource(rsc.surface->id(), (GLenum)rsc.surface->get_compatible_internal_format(), rsc.x, rsc.y, rsc.w, rsc.h);
} }