From 046daac427f937fdb570ae267c339ad25f006d68 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 6 Dec 2015 13:46:43 -0500 Subject: [PATCH] HWRenderer/TextureCache: Flush the texture cache when bit 16 of register 0x80 is set to 1. --- src/video_core/pica.h | 1 + src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 2f1b2dec4..192a808ac 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -235,6 +235,7 @@ struct Regs { BitField< 0, 1, u32> texture0_enable; BitField< 1, 1, u32> texture1_enable; BitField< 2, 1, u32> texture2_enable; + BitField<16, 1, u32> clear_texture_cache; }; TextureConfig texture0; INSERT_PADDING_WORDS(0x8); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 822739088..a94d7ad9b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -281,6 +281,12 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) { case PICA_REG_INDEX(tev_combiner_buffer_color): SyncCombinerColor(); break; + + case PICA_REG_INDEX(clear_texture_cache): + // Clear the texture cache when this bit is 1 + if (regs.clear_texture_cache) + res_cache.FullFlush(); + break; } }