diff options
author | Subv <subv2112@gmail.com> | 2015-07-19 21:09:23 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2015-07-19 21:09:23 +0200 |
commit | a694caeee0c32273998190dc7c238c5fc9b8efab (patch) | |
tree | 5231e4d1ae2690774315896fafb7796155430564 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #943 from Subv/ia4 (diff) | |
download | yuzu-a694caeee0c32273998190dc7c238c5fc9b8efab.tar yuzu-a694caeee0c32273998190dc7c238c5fc9b8efab.tar.gz yuzu-a694caeee0c32273998190dc7c238c5fc9b8efab.tar.bz2 yuzu-a694caeee0c32273998190dc7c238c5fc9b8efab.tar.lz yuzu-a694caeee0c32273998190dc7c238c5fc9b8efab.tar.xz yuzu-a694caeee0c32273998190dc7c238c5fc9b8efab.tar.zst yuzu-a694caeee0c32273998190dc7c238c5fc9b8efab.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 935a9f281..2db845da6 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -816,12 +816,16 @@ void RasterizerOpenGL::ReloadColorBuffer() { } void RasterizerOpenGL::ReloadDepthBuffer() { + PAddr depth_buffer_addr = Pica::g_state.regs.framebuffer.GetDepthBufferPhysicalAddress(); + + if (depth_buffer_addr == 0) + return; + // TODO: Appears to work, but double-check endianness of depth values and order of depth-stencil - u8* depth_buffer = Memory::GetPhysicalPointer(Pica::g_state.regs.framebuffer.GetDepthBufferPhysicalAddress()); + u8* depth_buffer = Memory::GetPhysicalPointer(depth_buffer_addr); - if (depth_buffer == nullptr) { + if (depth_buffer == nullptr) return; - } u32 bytes_per_pixel = Pica::Regs::BytesPerDepthPixel(fb_depth_texture.format); |