|
|
@@ -919,9 +919,16 @@ Surface RasterizerCacheOpenGL::GetTextureSurface(const Tegra::Texture::FullTextu
|
|
|
}
|
|
|
|
|
|
Surface RasterizerCacheOpenGL::GetDepthBufferSurface(bool preserve_contents) {
|
|
|
- const auto& regs{Core::System::GetInstance().GPU().Maxwell3D().regs};
|
|
|
+ auto& gpu{Core::System::GetInstance().GPU().Maxwell3D()};
|
|
|
+ const auto& regs{gpu.regs};
|
|
|
+
|
|
|
+ if (!gpu.dirty_flags.zeta_buffer) {
|
|
|
+ return last_depth_buffer;
|
|
|
+ }
|
|
|
+ gpu.dirty_flags.zeta_buffer = false;
|
|
|
+
|
|
|
if (!regs.zeta.Address() || !regs.zeta_enable) {
|
|
|
- return {};
|
|
|
+ return last_depth_buffer = {};
|
|
|
}
|
|
|
|
|
|
SurfaceParams depth_params{SurfaceParams::CreateForDepthBuffer(
|
|
|
@@ -929,7 +936,7 @@ Surface RasterizerCacheOpenGL::GetDepthBufferSurface(bool preserve_contents) {
|
|
|
regs.zeta.memory_layout.block_width, regs.zeta.memory_layout.block_height,
|
|
|
regs.zeta.memory_layout.block_depth, regs.zeta.memory_layout.type)};
|
|
|
|
|
|
- return GetSurface(depth_params, preserve_contents);
|
|
|
+ return last_depth_buffer = GetSurface(depth_params, preserve_contents);
|
|
|
}
|
|
|
|
|
|
Surface RasterizerCacheOpenGL::GetColorBufferSurface(std::size_t index, bool preserve_contents) {
|