From 4d0c457ddcf1256ce4abdd1850b564d74123acc0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 25 Sep 2016 16:35:43 -0700 Subject: [PATCH] Cleanup display vs. output screenshot terminology. --- Core/SaveState.cpp | 2 +- Core/Screenshot.cpp | 8 ++++---- Core/Screenshot.h | 7 +++++-- GPU/Directx9/FramebufferDX9.cpp | 2 +- GPU/Directx9/FramebufferDX9.h | 2 +- GPU/Directx9/GPU_DX9.cpp | 4 ++-- GPU/Directx9/GPU_DX9.h | 2 +- GPU/GLES/Framebuffer.cpp | 2 +- GPU/GLES/Framebuffer.h | 2 +- GPU/GLES/GPU_GLES.cpp | 4 ++-- GPU/GLES/GPU_GLES.h | 2 +- GPU/Vulkan/FramebufferVulkan.cpp | 2 +- GPU/Vulkan/FramebufferVulkan.h | 2 +- UI/NativeApp.cpp | 2 +- UI/ReportScreen.cpp | 2 +- 15 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index 74a698b58a..8a5b1f35ed 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -643,7 +643,7 @@ namespace SaveState break; case SAVESTATE_SAVE_SCREENSHOT: - callbackResult = TakeGameScreenshot(op.filename.c_str(), SCREENSHOT_JPG, SCREENSHOT_RENDER); + callbackResult = TakeGameScreenshot(op.filename.c_str(), SCREENSHOT_JPG, SCREENSHOT_DISPLAY); if (!callbackResult) { ERROR_LOG(COMMON, "Failed to take a screenshot for the savestate! %s", op.filename.c_str()); } diff --git a/Core/Screenshot.cpp b/Core/Screenshot.cpp index c512832e5e..dcf598940d 100644 --- a/Core/Screenshot.cpp +++ b/Core/Screenshot.cpp @@ -221,9 +221,9 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy u32 w = (u32)-1; u32 h = (u32)-1; - if (type == SCREENSHOT_RENDER) { + if (type == SCREENSHOT_DISPLAY || type == SCREENSHOT_RENDER) { if (gpuDebug) { - success = gpuDebug->GetCurrentFramebuffer(buf, GPU_DBG_FRAMEBUF_DISPLAY, maxRes); + success = gpuDebug->GetCurrentFramebuffer(buf, type == SCREENSHOT_RENDER ? GPU_DBG_FRAMEBUF_RENDER : GPU_DBG_FRAMEBUF_DISPLAY, maxRes); } // Only crop to the top left when using a render screenshot. @@ -231,10 +231,10 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy h = maxRes > 0 ? 272 * maxRes : PSP_CoreParameter().renderHeight; } else { if (GetGPUBackend() == GPUBackend::OPENGL) { - success = GPU_GLES::GetDisplayFramebuffer(buf); + success = GPU_GLES::GetOutputFramebuffer(buf); #ifdef _WIN32 } else if (GetGPUBackend() == GPUBackend::DIRECT3D9) { - success = DX9::GPU_DX9::GetDisplayFramebuffer(buf); + success = DX9::GPU_DX9::GetOutputFramebuffer(buf); #endif } } diff --git a/Core/Screenshot.h b/Core/Screenshot.h index 28292146bc..6514830d3a 100644 --- a/Core/Screenshot.h +++ b/Core/Screenshot.h @@ -25,9 +25,12 @@ enum ScreenshotFormat { }; enum ScreenshotType { - // What's begin show on screen (e.g. including FPS, etc.) + // What's being show on screen (e.g. including FPS, etc.) + SCREENSHOT_OUTPUT, + // What the game rendered (e.g. at render resolution) to the display. + // Can only be used while in game. SCREENSHOT_DISPLAY, - // What the game rendered (e.g. at render resolution.) + // What the game is in-progress rendering now. // Can only be used while in game. SCREENSHOT_RENDER, }; diff --git a/GPU/Directx9/FramebufferDX9.cpp b/GPU/Directx9/FramebufferDX9.cpp index 1fd08877a2..91a9490c8f 100644 --- a/GPU/Directx9/FramebufferDX9.cpp +++ b/GPU/Directx9/FramebufferDX9.cpp @@ -1358,7 +1358,7 @@ namespace DX9 { return success; } - bool FramebufferManagerDX9::GetDisplayFramebuffer(GPUDebugBuffer &buffer) { + bool FramebufferManagerDX9::GetOutputFramebuffer(GPUDebugBuffer &buffer) { fbo_unbind(); LPDIRECT3DSURFACE9 renderTarget = nullptr; diff --git a/GPU/Directx9/FramebufferDX9.h b/GPU/Directx9/FramebufferDX9.h index 612d3c3bea..f11bb5d3ee 100644 --- a/GPU/Directx9/FramebufferDX9.h +++ b/GPU/Directx9/FramebufferDX9.h @@ -85,7 +85,7 @@ public: bool GetCurrentFramebuffer(GPUDebugBuffer &buffer, GPUDebugFramebufferType type, int maxRes); bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer); bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer); - static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer); + static bool GetOutputFramebuffer(GPUDebugBuffer &buffer); virtual void RebindFramebuffer() override; diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index 07ca205f96..2c693fea03 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -2251,8 +2251,8 @@ bool GPU_DX9::GetCurrentClut(GPUDebugBuffer &buffer) { return textureCache_.GetCurrentClutBuffer(buffer); } -bool GPU_DX9::GetDisplayFramebuffer(GPUDebugBuffer &buffer) { - return FramebufferManagerDX9::GetDisplayFramebuffer(buffer); +bool GPU_DX9::GetOutputFramebuffer(GPUDebugBuffer &buffer) { + return FramebufferManagerDX9::GetOutputFramebuffer(buffer); } bool GPU_DX9::GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices) { diff --git a/GPU/Directx9/GPU_DX9.h b/GPU/Directx9/GPU_DX9.h index 5939fa06d8..ce0003a34e 100644 --- a/GPU/Directx9/GPU_DX9.h +++ b/GPU/Directx9/GPU_DX9.h @@ -81,7 +81,7 @@ public: bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override; bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override; bool GetCurrentClut(GPUDebugBuffer &buffer) override; - static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer); + static bool GetOutputFramebuffer(GPUDebugBuffer &buffer); bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices) override; typedef void (GPU_DX9::*CmdFunc)(u32 op, u32 diff); diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 7522dd3967..fe208eed35 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -2016,7 +2016,7 @@ bool FramebufferManager::GetFramebuffer(u32 fb_address, int fb_stride, GEBufferF return true; } -bool FramebufferManager::GetDisplayFramebuffer(GPUDebugBuffer &buffer) { +bool FramebufferManager::GetOutputFramebuffer(GPUDebugBuffer &buffer) { fbo_unbind_read(); int pw = PSP_CoreParameter().pixelWidth; diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/Framebuffer.h index dc0070e2d3..ee80abbbf7 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/Framebuffer.h @@ -111,7 +111,7 @@ public: bool GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer, int maxRes); bool GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer); bool GetStencilbuffer(u32 fb_address, int fb_stride, GPUDebugBuffer &buffer); - static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer); + static bool GetOutputFramebuffer(GPUDebugBuffer &buffer); virtual void RebindFramebuffer() override; diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index df0c3b89af..e85b095453 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -2482,8 +2482,8 @@ bool GPU_GLES::GetCurrentClut(GPUDebugBuffer &buffer) { return textureCache_.GetCurrentClutBuffer(buffer); } -bool GPU_GLES::GetDisplayFramebuffer(GPUDebugBuffer &buffer) { - return FramebufferManager::GetDisplayFramebuffer(buffer); +bool GPU_GLES::GetOutputFramebuffer(GPUDebugBuffer &buffer) { + return FramebufferManager::GetOutputFramebuffer(buffer); } bool GPU_GLES::GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices) { diff --git a/GPU/GLES/GPU_GLES.h b/GPU/GLES/GPU_GLES.h index 34c5d27faf..63f33b57b3 100644 --- a/GPU/GLES/GPU_GLES.h +++ b/GPU/GLES/GPU_GLES.h @@ -86,7 +86,7 @@ public: bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override; bool GetCurrentTexture(GPUDebugBuffer &buffer, int level) override; bool GetCurrentClut(GPUDebugBuffer &buffer) override; - static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer); + static bool GetOutputFramebuffer(GPUDebugBuffer &buffer); bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices) override; bool DescribeCodePtr(const u8 *ptr, std::string &name) override; diff --git a/GPU/Vulkan/FramebufferVulkan.cpp b/GPU/Vulkan/FramebufferVulkan.cpp index 52d8f8e103..c26199c1b8 100644 --- a/GPU/Vulkan/FramebufferVulkan.cpp +++ b/GPU/Vulkan/FramebufferVulkan.cpp @@ -1624,7 +1624,7 @@ bool FramebufferManagerVulkan::GetFramebuffer(u32 fb_address, int fb_stride, GEB return false; } -bool FramebufferManagerVulkan::GetDisplayFramebuffer(GPUDebugBuffer &buffer) { +bool FramebufferManagerVulkan::GetOutputFramebuffer(GPUDebugBuffer &buffer) { // TODO: Doing this synchronously will require stalling the pipeline. Maybe better // to do it callback-style? /* diff --git a/GPU/Vulkan/FramebufferVulkan.h b/GPU/Vulkan/FramebufferVulkan.h index a613af694a..98d6e62f84 100644 --- a/GPU/Vulkan/FramebufferVulkan.h +++ b/GPU/Vulkan/FramebufferVulkan.h @@ -127,7 +127,7 @@ public: bool GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer); bool GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer); bool GetStencilbuffer(u32 fb_address, int fb_stride, GPUDebugBuffer &buffer); - static bool GetDisplayFramebuffer(GPUDebugBuffer &buffer); + static bool GetOutputFramebuffer(GPUDebugBuffer &buffer); virtual void RebindFramebuffer() override; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 925b19efcd..e308dbce82 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -673,7 +673,7 @@ void TakeScreenshot() { i++; } - bool success = TakeGameScreenshot(filename, g_Config.bScreenshotsAsPNG ? SCREENSHOT_PNG : SCREENSHOT_JPG, SCREENSHOT_DISPLAY); + bool success = TakeGameScreenshot(filename, g_Config.bScreenshotsAsPNG ? SCREENSHOT_PNG : SCREENSHOT_JPG, SCREENSHOT_OUTPUT); if (success) { osm.Show(filename); } else { diff --git a/UI/ReportScreen.cpp b/UI/ReportScreen.cpp index fcd7277e33..6309a1d6ec 100644 --- a/UI/ReportScreen.cpp +++ b/UI/ReportScreen.cpp @@ -236,7 +236,7 @@ void ReportScreen::CreateViews() { } screenshotFilename_ = path + ".reporting.jpg"; int shotWidth = 0, shotHeight = 0; - if (TakeGameScreenshot(screenshotFilename_.c_str(), SCREENSHOT_JPG, SCREENSHOT_RENDER, &shotWidth, &shotHeight, 4)) { + if (TakeGameScreenshot(screenshotFilename_.c_str(), SCREENSHOT_JPG, SCREENSHOT_DISPLAY, &shotWidth, &shotHeight, 4)) { float scale = 340.0f * (1.0f / g_dpi_scale) * (1.0f / shotHeight); leftColumnItems->Add(new CheckBox(&includeScreenshot_, rp->T("FeedbackIncludeScreen", "Include a screenshot")))->SetEnabledPtr(&enableReporting_); screenshot_ = leftColumnItems->Add(new AsyncImageFileView(screenshotFilename_, IS_DEFAULT, nullptr, new LinearLayoutParams(shotWidth * scale, shotHeight * scale, Margins(12, 0))));