From 99136ec592c20a5e0261903f18f8ec8dd25c305d Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Sat, 6 Jul 2019 08:03:01 -0400 Subject: [PATCH] gl_rasterizer: correct supress_mipmap_for_cube logic The previous version would break when the state changes from (cube=true,mipmap=false) -> (cube=true,mipmap=true) --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index acdbd8306e..55487a1a86 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1576,17 +1576,14 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig( mag_filter = config.mag_filter; glSamplerParameteri(s, GL_TEXTURE_MAG_FILTER, PicaToGL::TextureMagFilterMode(mag_filter)); } - if (min_filter != config.min_filter || mip_filter != config.mip_filter) { - min_filter = config.min_filter; - mip_filter = config.mip_filter; - glSamplerParameteri(s, GL_TEXTURE_MIN_FILTER, - PicaToGL::TextureMinFilterMode(min_filter, mip_filter)); - } - // TODO(wwylele): remove this block once mipmap for cube is implemented + // TODO(wwylele): remove new_supress_mipmap_for_cube logic once mipmap for cube is implemented bool new_supress_mipmap_for_cube = config.type == Pica::TexturingRegs::TextureConfig::TextureCube; - if (supress_mipmap_for_cube != new_supress_mipmap_for_cube) { + if (min_filter != config.min_filter || mip_filter != config.mip_filter || + supress_mipmap_for_cube != new_supress_mipmap_for_cube) { + min_filter = config.min_filter; + mip_filter = config.mip_filter; supress_mipmap_for_cube = new_supress_mipmap_for_cube; if (new_supress_mipmap_for_cube) { // HACK: use mag filter converter for min filter because they are the same anyway