From 911587fb8d4fbd6917c427ce7c500fef7f1274d7 Mon Sep 17 00:00:00 2001 From: Mat M Date: Tue, 29 Jan 2019 22:01:04 -0300 Subject: gl_rasterizer_cache: Guard clause swizzle testing Co-Authored-By: ReinUsesLisp --- src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 0dc4857e8..d453ddbce 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -880,7 +880,9 @@ void CachedSurface::UpdateSwizzle(Tegra::Texture::SwizzleSource swizzle_x, const GLenum new_y = MaxwellToGL::SwizzleSource(swizzle_y); const GLenum new_z = MaxwellToGL::SwizzleSource(swizzle_z); const GLenum new_w = MaxwellToGL::SwizzleSource(swizzle_w); - if (swizzle[0] != new_x || swizzle[1] != new_y || swizzle[2] != new_z || swizzle[3] != new_w) { + if (swizzle[0] == new_x && swizzle[1] == new_y && swizzle[2] == new_z && swizzle[3] == new_w) { + return; + } swizzle = {new_x, new_y, new_z, new_w}; const auto swizzle_data = reinterpret_cast(swizzle.data()); glTextureParameteriv(texture.handle, GL_TEXTURE_SWIZZLE_RGBA, swizzle_data); -- cgit v1.2.3