Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoBackends: Internal resolution frame dumping #4436

Merged
merged 7 commits into from
Nov 28, 2016
13 changes: 13 additions & 0 deletions Source/Core/DolphinWX/VideoConfigDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ static wxString cache_hires_textures_desc =
"more RAM but fixes possible stuttering.\n\nIf unsure, leave this unchecked.");
static wxString dump_efb_desc = wxTRANSLATE(
"Dump the contents of EFB copies to User/Dump/Textures/.\n\nIf unsure, leave this unchecked.");
static wxString internal_resolution_frame_dumping_desc = wxTRANSLATE(
"Create frame dumps and screenshots at the internal resolution of the renderer, rather than "
"the size of the window it is displayed within. If the aspect ratio is widescreen, the output "
"image will be scaled horizontally to preserve the vertical resolution.\n\nIf unsure, leave "
"this unchecked.");
#if defined(HAVE_LIBAV) || defined(_WIN32)
static wxString use_ffv1_desc =
wxTRANSLATE("Encode frame dumps using the FFV1 codec.\n\nIf unsure, leave this unchecked.");
Expand Down Expand Up @@ -858,6 +863,14 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title)
CreateCheckBox(page_advanced, _("Prefetch Custom Textures"),
wxGetTranslation(cache_hires_textures_desc), vconfig.bCacheHiresTextures);
szr_utility->Add(cache_hires_textures);

if (vconfig.backend_info.bSupportsInternalResolutionFrameDumps)
{
szr_utility->Add(CreateCheckBox(page_advanced, _("Full Resolution Frame Dumps"),
wxGetTranslation(internal_resolution_frame_dumping_desc),
vconfig.bInternalResolutionFrameDumps));
}

szr_utility->Add(CreateCheckBox(page_advanced, _("Dump EFB Target"),
wxGetTranslation(dump_efb_desc), vconfig.bDumpEFBTarget));
szr_utility->Add(CreateCheckBox(page_advanced, _("Free Look"),
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/VideoBackends/D3D/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ Renderer::Renderer(void*& window_handle)
FramebufferManagerBase::SetLastXfbWidth(MAX_XFB_WIDTH);
FramebufferManagerBase::SetLastXfbHeight(MAX_XFB_HEIGHT);

UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
UpdateDrawRectangle();

s_last_multisamples = g_ActiveConfig.iMultisamples;
s_last_efb_scale = g_ActiveConfig.iEFBScale;
s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0;
s_last_xfb_mode = g_ActiveConfig.bUseRealXFB;
CalculateTargetSize(s_backbuffer_width, s_backbuffer_height);
CalculateTargetSize();
PixelShaderManager::SetEfbScaleChanged();

SetupDeviceObjects();
Expand Down Expand Up @@ -732,7 +732,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
ResetAPIState();

// Prepare to copy the XFBs to our backbuffer
UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
UpdateDrawRectangle();
TargetRectangle targetRc = GetTargetRectangle();

D3D::context->OMSetRenderTargets(1, &D3D::GetBackBuffer()->GetRTV(), nullptr);
Expand Down Expand Up @@ -867,7 +867,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
D3D::Present();

// Resize the back buffers NOW to avoid flickering
if (CalculateTargetSize(s_backbuffer_width, s_backbuffer_height) || xfbchanged || windowResized ||
if (CalculateTargetSize() || xfbchanged || windowResized ||
s_last_efb_scale != g_ActiveConfig.iEFBScale ||
s_last_multisamples != g_ActiveConfig.iMultisamples ||
s_last_stereo_mode != (g_ActiveConfig.iStereoMode > 0))
Expand All @@ -886,7 +886,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
s_backbuffer_height = D3D::GetBackBufferHeight();
}

UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
UpdateDrawRectangle();

s_last_efb_scale = g_ActiveConfig.iEFBScale;
s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoBackends/D3D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsDepthClamp = true;
g_Config.backend_info.bSupportsReversedDepthRange = false;
g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false;

IDXGIFactory* factory;
IDXGIAdapter* ad;
Expand Down
12 changes: 6 additions & 6 deletions Source/Core/VideoBackends/D3D12/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ Renderer::Renderer(void*& window_handle)
FramebufferManagerBase::SetLastXfbWidth(MAX_XFB_WIDTH);
FramebufferManagerBase::SetLastXfbHeight(MAX_XFB_HEIGHT);

UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
UpdateDrawRectangle();

s_last_multisamples = g_ActiveConfig.iMultisamples;
s_last_efb_scale = g_ActiveConfig.iEFBScale;
s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0;
s_last_xfb_mode = g_ActiveConfig.bUseRealXFB;
CalculateTargetSize(s_backbuffer_width, s_backbuffer_height);
CalculateTargetSize();
PixelShaderManager::SetEfbScaleChanged();

SetupDeviceObjects();
Expand Down Expand Up @@ -654,7 +654,7 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height
BBox::Invalidate();

// Prepare to copy the XFBs to our backbuffer
UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
UpdateDrawRectangle();
TargetRectangle target_rc = GetTargetRectangle();

D3D::GetBackBuffer()->TransitionToResourceState(D3D::current_command_list,
Expand Down Expand Up @@ -819,8 +819,8 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height
D3D::Present();

// Resize the back buffers NOW to avoid flickering
if (CalculateTargetSize(s_backbuffer_width, s_backbuffer_height) || xfb_changed ||
window_resized || s_last_efb_scale != g_ActiveConfig.iEFBScale ||
if (CalculateTargetSize() || xfb_changed || window_resized ||
s_last_efb_scale != g_ActiveConfig.iEFBScale ||
s_last_multisamples != g_ActiveConfig.iMultisamples ||
s_last_stereo_mode != (g_ActiveConfig.iStereoMode > 0))
{
Expand Down Expand Up @@ -851,7 +851,7 @@ void Renderer::SwapImpl(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height
s_backbuffer_height = D3D::GetBackBufferHeight();
}

UpdateDrawRectangle(s_backbuffer_width, s_backbuffer_height);
UpdateDrawRectangle();

s_last_efb_scale = g_ActiveConfig.iEFBScale;
s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoBackends/D3D12/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsDepthClamp = true;
g_Config.backend_info.bSupportsReversedDepthRange = false;
g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false;

IDXGIFactory* factory;
IDXGIAdapter* ad;
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoBackends/Null/NullBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsDepthClamp = true;
g_Config.backend_info.bSupportsReversedDepthRange = true;
g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false;

// aamodes: We only support 1 sample, so no MSAA
g_Config.backend_info.Adapters.clear();
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/VideoBackends/OGL/PostProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ void OpenGLPostProcessing::BlitFromTexture(TargetRectangle src, TargetRectangle
{
ApplyShader();

glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);

glViewport(dst.left, dst.bottom, dst.GetWidth(), dst.GetHeight());

OpenGL_BindAttributelessVAO();
Expand Down