gl_rasterizer: Reset normal map flag each draw (#6636)

* Fixes normal maps leaking draws
This commit is contained in:
GPUCode 2023-06-24 00:30:16 +03:00 committed by GitHub
parent eb118b2a4c
commit 6b8a06e7b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}