From ab93a6bf64aa25cecbd9063f77ea91023d936e14 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Tue, 22 Dec 2015 15:44:02 -0600 Subject: [PATCH] If last framebuffer texture isn't set, use active framebuffer otherwise don't draw. --- src/xenia/gpu/gl4/gl4_command_processor.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/xenia/gpu/gl4/gl4_command_processor.cc b/src/xenia/gpu/gl4/gl4_command_processor.cc index 10666b53f..de191e371 100644 --- a/src/xenia/gpu/gl4/gl4_command_processor.cc +++ b/src/xenia/gpu/gl4/gl4_command_processor.cc @@ -396,19 +396,24 @@ void GL4CommandProcessor::PerformSwap(uint32_t frontbuffer_ptr, // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // HACK: just use whatever our current framebuffer is. GLuint framebuffer_texture = last_framebuffer_texture_; - /*GLuint framebuffer_texture = active_framebuffer_ - ? active_framebuffer_->color_targets[0] - : last_framebuffer_texture_;*/ + + if (last_framebuffer_texture_ == 0) { + framebuffer_texture = + active_framebuffer_ ? active_framebuffer_->color_targets[0] : 0; + } // Copy the the given framebuffer to the current backbuffer. Rect2D src_rect(0, 0, frontbuffer_width ? frontbuffer_width : 1280, frontbuffer_height ? frontbuffer_height : 720); Rect2D dest_rect(0, 0, swap_state_.width, swap_state_.height); - reinterpret_cast(context_.get()) - ->blitter() - ->CopyColorTexture2D(framebuffer_texture, src_rect, - static_cast(swap_state_.back_buffer_texture), - dest_rect, GL_LINEAR, true); + if (framebuffer_texture != 0) { + reinterpret_cast(context_.get()) + ->blitter() + ->CopyColorTexture2D( + framebuffer_texture, src_rect, + static_cast(swap_state_.back_buffer_texture), dest_rect, + GL_LINEAR, true); + } if (FLAGS_draw_all_framebuffers) { int32_t offsetx = (1280 - (1280 / 5));