From bd4dc8a379d668075609303652842d533d7fee74 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 10 Oct 2024 19:57:42 +0200 Subject: [PATCH] display: Fix ability to copy wdxGraphicsBuffer to RAM on DX9 --- panda/src/display/frameBufferProperties.cxx | 11 ++++++----- panda/src/dxgsg9/wdxGraphicsBuffer9.cxx | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/panda/src/display/frameBufferProperties.cxx b/panda/src/display/frameBufferProperties.cxx index c6e1e9353f..4f27007cbc 100644 --- a/panda/src/display/frameBufferProperties.cxx +++ b/panda/src/display/frameBufferProperties.cxx @@ -305,11 +305,12 @@ int FrameBufferProperties:: get_buffer_mask() const { int mask = 0; - if (_property[FBP_back_buffers] > 0) { - mask = RenderBuffer::T_front | RenderBuffer::T_back; - } else { - mask = RenderBuffer::T_front; - } + //XXX rdb: some buffers only have a front buffer, some only a back buffer + //if (_property[FBP_back_buffers] > 0) { + mask = RenderBuffer::T_front | RenderBuffer::T_back; + //} else { + // mask = RenderBuffer::T_front; + //} if (_property[FBP_depth_bits] > 0) { mask |= RenderBuffer::T_depth; } diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx index 03d5a1a41a..d43febe03e 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx @@ -45,9 +45,10 @@ wdxGraphicsBuffer9(GraphicsEngine *engine, GraphicsPipe *pipe, _color_backing_store = nullptr; _depth_backing_store = nullptr; - // is this correct ??? Since the pbuffer never gets flipped, we get - // screenshots from the same buffer we draw into. - _screenshot_buffer_type = _draw_buffer_type; + // Since the pbuffer never gets flipped, we get screenshots from the same + // buffer we draw into, which is the back buffer. + _draw_buffer_type = RenderBuffer::T_back; + _screenshot_buffer_type = RenderBuffer::T_back; _shared_depth_buffer = 0; _debug = 0;