From 6b8a06e7b40ffb740b957465df0e1f0ea1c60d9b Mon Sep 17 00:00:00 2001 From: GPUCode <47210458+GPUCode@users.noreply.github.com> Date: Sat, 24 Jun 2023 00:30:16 +0300 Subject: [PATCH] gl_rasterizer: Reset normal map flag each draw (#6636) * Fixes normal maps leaking draws --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 0889d75ec..037767385 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -487,6 +487,7 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) { } res_cache.InvalidateFramebuffer(framebuffer); + use_custom_normal = false; return succeeded; } @@ -581,7 +582,7 @@ void RasterizerOpenGL::BindTextureCube(const Pica::TexturingRegs::FullTextureCon } void RasterizerOpenGL::BindMaterial(u32 texture_index, Surface& surface) { - if (!surface.IsCustom() || texture_index != 0) { + if (!surface.IsCustom()) { return; } @@ -599,11 +600,6 @@ void RasterizerOpenGL::BindMaterial(u32 texture_index, Surface& surface) { } bind_texture(TextureUnits::TextureNormalMap, surface.Handle(2), sampler); use_custom_normal = true; - } else { - if (use_custom_normal) { - bind_texture(TextureUnits::TextureNormalMap, 0, 0); - } - use_custom_normal = false; } }