diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 33b2449eea..c2af11f282 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -1380,6 +1380,7 @@ bool FramebufferManager::GetCurrentDepthbuffer(GPUDebugBuffer &buffer) { if (!vfb) { // If there's no vfb and we're drawing there, must be memory? + // TODO: Is the value 16-bit? It seems to be. buffer = GPUDebugBuffer(Memory::GetPointer(z_address), z_stride, 512, GPU_DBG_FORMAT_16BIT); return true; } diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index 1c45a68ecd..7b1d306e50 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -752,3 +752,18 @@ bool SoftGPU::GetCurrentFramebuffer(GPUDebugBuffer &buffer) buffer = GPUDebugBuffer(fb.data, gstate.FrameBufStride(), 512, gstate.FrameBufFormat()); return true; } + +bool SoftGPU::GetCurrentDepthbuffer(GPUDebugBuffer &buffer) +{ + // We don't know the height, so just use 512, which should be the max (hopefully?) + // TODO: Could check clipping and such, though...? + // TODO: Is the value 16-bit? It seems to be. + buffer = GPUDebugBuffer(depthbuf.data, gstate.DepthBufStride(), 512, GPU_DBG_FORMAT_16BIT); + return true; +} + +bool SoftGPU::GetCurrentStencilbuffer(GPUDebugBuffer &buffer) +{ + // TODO: Just need the alpha value from the framebuffer... + return false; +} diff --git a/GPU/Software/SoftGpu.h b/GPU/Software/SoftGpu.h index f3d452f91a..baa88f5fb4 100644 --- a/GPU/Software/SoftGpu.h +++ b/GPU/Software/SoftGpu.h @@ -74,15 +74,9 @@ public: } virtual bool GetCurrentFramebuffer(GPUDebugBuffer &buffer); - bool GetCurrentTexture(GPUDebugBuffer &buffer) { - // TODO - return false; - } - virtual bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) { - // TODO - return false; - } - virtual bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) { + virtual bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer); + virtual bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer); + virtual bool GetCurrentTexture(GPUDebugBuffer &buffer) { // TODO return false; } diff --git a/Windows/GEDebugger/SimpleGLWindow.cpp b/Windows/GEDebugger/SimpleGLWindow.cpp index efdb7cacf9..ab3c7b55e7 100644 --- a/Windows/GEDebugger/SimpleGLWindow.cpp +++ b/Windows/GEDebugger/SimpleGLWindow.cpp @@ -219,6 +219,9 @@ void SimpleGLWindow::Draw(u8 *data, int w, int h, bool flipped, Format fmt) { if (fmt == FORMAT_8888) { glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glfmt = GL_UNSIGNED_BYTE; + } else if (fmt == FORMAT_FLOAT) { + glfmt = GL_FLOAT; + components = GL_RED; } else { glPixelStorei(GL_UNPACK_ALIGNMENT, 2); if (fmt == FORMAT_4444) { @@ -228,6 +231,11 @@ void SimpleGLWindow::Draw(u8 *data, int w, int h, bool flipped, Format fmt) { } else if (fmt == FORMAT_565) { glfmt = GL_UNSIGNED_SHORT_5_6_5; components = GL_RGB; + } else if (fmt == FORMAT_16BIT) { + glfmt = GL_UNSIGNED_SHORT; + components = GL_RED; + } else { + _dbg_assert_msg_(COMMON, false, "Invalid SimpleGLWindow format."); } } diff --git a/Windows/GEDebugger/SimpleGLWindow.h b/Windows/GEDebugger/SimpleGLWindow.h index 390698805d..2e72da1eca 100644 --- a/Windows/GEDebugger/SimpleGLWindow.h +++ b/Windows/GEDebugger/SimpleGLWindow.h @@ -29,6 +29,9 @@ struct SimpleGLWindow { FORMAT_5551 = 1, FORMAT_4444 = 2, FORMAT_8888 = 3, + + FORMAT_FLOAT = 0x10, + FORMAT_16BIT = 0x11, }; enum Flags {