summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-01-08 00:13:48 +0100
committerbunnei <bunneidev@gmail.com>2015-01-08 00:13:48 +0100
commitb659cac2dc67ee97297049fcfb02c1ce186ffcb0 (patch)
tree8b0bae87f32c632e5d07d826133d56d49c6159f7
parentMerge pull request #431 from yuriks/thread-queue-cleanup (diff)
parentGSP: Toggle active framebuffer each frame (diff)
downloadyuzu-b659cac2dc67ee97297049fcfb02c1ce186ffcb0.tar
yuzu-b659cac2dc67ee97297049fcfb02c1ce186ffcb0.tar.gz
yuzu-b659cac2dc67ee97297049fcfb02c1ce186ffcb0.tar.bz2
yuzu-b659cac2dc67ee97297049fcfb02c1ce186ffcb0.tar.lz
yuzu-b659cac2dc67ee97297049fcfb02c1ce186ffcb0.tar.xz
yuzu-b659cac2dc67ee97297049fcfb02c1ce186ffcb0.tar.zst
yuzu-b659cac2dc67ee97297049fcfb02c1ce186ffcb0.zip
-rw-r--r--src/core/hle/service/gsp_gpu.cpp5
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index 0127d4ee5..26a43217e 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -291,8 +291,11 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
// Update framebuffer information if requested
for (int screen_id = 0; screen_id < 2; ++screen_id) {
FrameBufferUpdate* info = GetFrameBufferInfo(thread_id, screen_id);
- if (info->is_dirty)
+
+ if (info->is_dirty) {
SetBufferSwap(screen_id, info->framebuffer_info[info->index]);
+ info->framebuffer_info->active_fb = info->framebuffer_info->active_fb ^ 1;
+ }
info->is_dirty = false;
}
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 4df3a5e25..29d220e8d 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -87,8 +87,11 @@ void RendererOpenGL::SwapBuffers() {
*/
void RendererOpenGL::LoadFBToActiveGLTexture(const GPU::Regs::FramebufferConfig& framebuffer,
const TextureInfo& texture) {
+
+ // TODO: Why are active_fb and the valid framebuffer flipped compared to 3dbrew documentation
+ // and GSP definitions?
const VAddr framebuffer_vaddr = Memory::PhysicalToVirtualAddress(
- framebuffer.active_fb == 1 ? framebuffer.address_left2 : framebuffer.address_left1);
+ framebuffer.active_fb == 0 ? framebuffer.address_left2 : framebuffer.address_left1);
LOG_TRACE(Render_OpenGL, "0x%08x bytes from 0x%08x(%dx%d), fmt %x",
framebuffer.stride * framebuffer.height,