Cleanup display vs. output screenshot terminology.

This commit is contained in:
Unknown W. Brackets 2016-09-25 16:35:43 -07:00
parent fa0e88f1b7
commit 4d0c457ddc
15 changed files with 24 additions and 21 deletions

View file

@ -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());
}

View file

@ -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
}
}

View file

@ -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,
};

View file

@ -1358,7 +1358,7 @@ namespace DX9 {
return success;
}
bool FramebufferManagerDX9::GetDisplayFramebuffer(GPUDebugBuffer &buffer) {
bool FramebufferManagerDX9::GetOutputFramebuffer(GPUDebugBuffer &buffer) {
fbo_unbind();
LPDIRECT3DSURFACE9 renderTarget = nullptr;

View file

@ -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;

View file

@ -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<GPUDebugVertex> &vertices, std::vector<u16> &indices) {

View file

@ -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<GPUDebugVertex> &vertices, std::vector<u16> &indices) override;
typedef void (GPU_DX9::*CmdFunc)(u32 op, u32 diff);

View file

@ -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;

View file

@ -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;

View file

@ -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<GPUDebugVertex> &vertices, std::vector<u16> &indices) {

View file

@ -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<GPUDebugVertex> &vertices, std::vector<u16> &indices) override;
bool DescribeCodePtr(const u8 *ptr, std::string &name) override;

View file

@ -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?
/*

View file

@ -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;

View file

@ -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 {

View file

@ -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))));