aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-21 20:28:53 -0700
committerGitHub <noreply@github.com>2018-07-21 20:28:53 -0700
commit4cd5df95d67bb2867ad9ffb006b27d2635c5fd91 (patch)
tree741aaf7b4a46bbcce5a25192d8df0c3f3d2c88fd /src/video_core/renderer_opengl/gl_rasterizer.cpp
parent53a219f163941988826aec4496a61ec36c69ce7d (diff)
parent63fbf9a7d3e24c684cf6f0868f30021a8ddf7256 (diff)
Merge pull request #761 from bunnei/improve-raster-cache
Improvements to rasterizer cache
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 65a2fd5e8..56d9c575b 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -387,7 +387,7 @@ void RasterizerOpenGL::Clear() {
}
if (regs.clear_buffers.Z) {
clear_mask |= GL_DEPTH_BUFFER_BIT;
- use_depth_fb = true;
+ use_depth_fb = regs.zeta_enable != 0;
// Always enable the depth write when clearing the depth buffer. The depth write mask is
// ignored when clearing the buffer in the Switch, but OpenGL obeys it so we set it to true.
@@ -413,11 +413,13 @@ void RasterizerOpenGL::Clear() {
glClear(clear_mask);
// Mark framebuffer surfaces as dirty
- if (dirty_color_surface != nullptr) {
- res_cache.MarkSurfaceAsDirty(dirty_color_surface);
- }
- if (dirty_depth_surface != nullptr) {
- res_cache.MarkSurfaceAsDirty(dirty_depth_surface);
+ if (Settings::values.use_accurate_framebuffers) {
+ if (dirty_color_surface != nullptr) {
+ res_cache.FlushSurface(dirty_color_surface);
+ }
+ if (dirty_depth_surface != nullptr) {
+ res_cache.FlushSurface(dirty_depth_surface);
+ }
}
}
@@ -431,7 +433,7 @@ void RasterizerOpenGL::DrawArrays() {
ScopeAcquireGLContext acquire_context;
auto [dirty_color_surface, dirty_depth_surface] =
- ConfigureFramebuffers(true, regs.zeta.Address() != 0);
+ ConfigureFramebuffers(true, regs.zeta.Address() != 0 && regs.zeta_enable != 0);
SyncDepthTestState();
SyncBlendState();
@@ -520,11 +522,13 @@ void RasterizerOpenGL::DrawArrays() {
state.Apply();
// Mark framebuffer surfaces as dirty
- if (dirty_color_surface != nullptr) {
- res_cache.MarkSurfaceAsDirty(dirty_color_surface);
- }
- if (dirty_depth_surface != nullptr) {
- res_cache.MarkSurfaceAsDirty(dirty_depth_surface);
+ if (Settings::values.use_accurate_framebuffers) {
+ if (dirty_color_surface != nullptr) {
+ res_cache.FlushSurface(dirty_color_surface);
+ }
+ if (dirty_depth_surface != nullptr) {
+ res_cache.FlushSurface(dirty_depth_surface);
+ }
}
}