VideoBackends: Add configuration field for GPU texture decoding

This commit is contained in:
Stenzek 2016-11-27 18:14:57 +10:00
parent abc662d69c
commit 82fd984f3e
9 changed files with 27 additions and 0 deletions

View File

@ -284,6 +284,10 @@ static wxString true_color_desc =
wxTRANSLATE("Forces the game to render the RGB color channels in 24-bit, thereby increasing " wxTRANSLATE("Forces the game to render the RGB color channels in 24-bit, thereby increasing "
"quality by reducing color banding.\nIt has no impact on performance and causes " "quality by reducing color banding.\nIt has no impact on performance and causes "
"few graphical issues.\n\n\nIf unsure, leave this checked."); "few graphical issues.\n\n\nIf unsure, leave this checked.");
static wxString gpu_texture_decoding_desc =
wxTRANSLATE("Enables texture decoding using the GPU instead of the CPU. This may result in "
"performance gains in some scenarios, or systems where the CPU is the bottleneck."
"\n\nIf unsure, leave this unchecked.");
#if !defined(__APPLE__) #if !defined(__APPLE__)
// Search for available resolutions - TODO: Move to Common? // Search for available resolutions - TODO: Move to Common?
@ -755,6 +759,15 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title)
slide_szr->Add(new wxStaticText(page_hacks, wxID_ANY, _("Fast")), 0, wxALIGN_CENTER_VERTICAL); slide_szr->Add(new wxStaticText(page_hacks, wxID_ANY, _("Fast")), 0, wxALIGN_CENTER_VERTICAL);
szr_safetex->Add(slide_szr, 1, wxEXPAND | wxLEFT | wxRIGHT, space5); szr_safetex->Add(slide_szr, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
if (vconfig.backend_info.bSupportsGPUTextureDecoding)
{
szr_safetex->Add(CreateCheckBox(page_hacks, _("GPU Texture Decoding"),
wxGetTranslation(gpu_texture_decoding_desc),
vconfig.bEnableGPUTextureDecoding),
1, wxEXPAND | wxLEFT | wxRIGHT, space5);
}
if (slider_pos == -1) if (slider_pos == -1)
{ {
stc_slider->Disable(); stc_slider->Disable();

View File

@ -76,6 +76,7 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsReversedDepthRange = false; g_Config.backend_info.bSupportsReversedDepthRange = false;
g_Config.backend_info.bSupportsMultithreading = false; g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false; g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false;
g_Config.backend_info.bSupportsGPUTextureDecoding = false;
IDXGIFactory* factory; IDXGIFactory* factory;
IDXGIAdapter* ad; IDXGIAdapter* ad;

View File

@ -79,6 +79,7 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsReversedDepthRange = false; g_Config.backend_info.bSupportsReversedDepthRange = false;
g_Config.backend_info.bSupportsMultithreading = false; g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false; g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false;
g_Config.backend_info.bSupportsGPUTextureDecoding = false;
IDXGIFactory* factory; IDXGIFactory* factory;
IDXGIAdapter* ad; IDXGIAdapter* ad;

View File

@ -44,6 +44,7 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsReversedDepthRange = true; g_Config.backend_info.bSupportsReversedDepthRange = true;
g_Config.backend_info.bSupportsMultithreading = false; g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false; g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false;
g_Config.backend_info.bSupportsGPUTextureDecoding = false;
// aamodes: We only support 1 sample, so no MSAA // aamodes: We only support 1 sample, so no MSAA
g_Config.backend_info.Adapters.clear(); g_Config.backend_info.Adapters.clear();

View File

@ -108,6 +108,7 @@ void VideoBackend::InitBackendInfo()
g_Config.backend_info.bSupportsReversedDepthRange = true; g_Config.backend_info.bSupportsReversedDepthRange = true;
g_Config.backend_info.bSupportsMultithreading = false; g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = true; g_Config.backend_info.bSupportsInternalResolutionFrameDumps = true;
g_Config.backend_info.bSupportsGPUTextureDecoding = false;
// Overwritten in Render.cpp later // Overwritten in Render.cpp later
g_Config.backend_info.bSupportsDualSourceBlend = true; g_Config.backend_info.bSupportsDualSourceBlend = true;

View File

@ -133,6 +133,7 @@ void VideoSoftware::InitBackendInfo()
g_Config.backend_info.bSupportsMultithreading = false; g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsComputeShaders = false; g_Config.backend_info.bSupportsComputeShaders = false;
g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false; g_Config.backend_info.bSupportsInternalResolutionFrameDumps = false;
g_Config.backend_info.bSupportsGPUTextureDecoding = false;
// aamodes // aamodes
g_Config.backend_info.AAModes = {1}; g_Config.backend_info.AAModes = {1};

View File

@ -245,6 +245,7 @@ void VulkanContext::PopulateBackendInfo(VideoConfig* config)
config->backend_info.bSupportsDepthClamp = false; // Dependent on features. config->backend_info.bSupportsDepthClamp = false; // Dependent on features.
config->backend_info.bSupportsReversedDepthRange = false; // No support yet due to driver bugs. config->backend_info.bSupportsReversedDepthRange = false; // No support yet due to driver bugs.
config->backend_info.bSupportsComputeShaders = false; // No support yet. config->backend_info.bSupportsComputeShaders = false; // No support yet.
config->backend_info.bSupportsGPUTextureDecoding = false; // No support yet.
} }
void VulkanContext::PopulateBackendInfoAdapters(VideoConfig* config, const GPUList& gpu_list) void VulkanContext::PopulateBackendInfoAdapters(VideoConfig* config, const GPUList& gpu_list)

View File

@ -81,6 +81,7 @@ void VideoConfig::Load(const std::string& ini_file)
settings->Get("DumpPath", &sDumpPath, ""); settings->Get("DumpPath", &sDumpPath, "");
settings->Get("BitrateKbps", &iBitrateKbps, 2500); settings->Get("BitrateKbps", &iBitrateKbps, 2500);
settings->Get("InternalResolutionFrameDumps", &bInternalResolutionFrameDumps, false); settings->Get("InternalResolutionFrameDumps", &bInternalResolutionFrameDumps, false);
settings->Get("EnableGPUTextureDecoding", &bEnableGPUTextureDecoding, false);
settings->Get("EnablePixelLighting", &bEnablePixelLighting, false); settings->Get("EnablePixelLighting", &bEnablePixelLighting, false);
settings->Get("FastDepthCalc", &bFastDepthCalc, true); settings->Get("FastDepthCalc", &bFastDepthCalc, true);
settings->Get("MSAA", &iMultisamples, 1); settings->Get("MSAA", &iMultisamples, 1);
@ -305,6 +306,7 @@ void VideoConfig::Save(const std::string& ini_file)
settings->Set("DumpPath", sDumpPath); settings->Set("DumpPath", sDumpPath);
settings->Set("BitrateKbps", iBitrateKbps); settings->Set("BitrateKbps", iBitrateKbps);
settings->Set("InternalResolutionFrameDumps", bInternalResolutionFrameDumps); settings->Set("InternalResolutionFrameDumps", bInternalResolutionFrameDumps);
settings->Set("EnableGPUTextureDecoding", bEnableGPUTextureDecoding);
settings->Set("EnablePixelLighting", bEnablePixelLighting); settings->Set("EnablePixelLighting", bEnablePixelLighting);
settings->Set("FastDepthCalc", bFastDepthCalc); settings->Set("FastDepthCalc", bFastDepthCalc);
settings->Set("MSAA", iMultisamples); settings->Set("MSAA", iMultisamples);

View File

@ -108,6 +108,7 @@ struct VideoConfig final
bool bInternalResolutionFrameDumps; bool bInternalResolutionFrameDumps;
bool bFreeLook; bool bFreeLook;
bool bBorderlessFullscreen; bool bBorderlessFullscreen;
bool bEnableGPUTextureDecoding;
int iBitrateKbps; int iBitrateKbps;
// Hacks // Hacks
@ -196,6 +197,7 @@ struct VideoConfig final
bool bSupportsReversedDepthRange; bool bSupportsReversedDepthRange;
bool bSupportsMultithreading; bool bSupportsMultithreading;
bool bSupportsInternalResolutionFrameDumps; bool bSupportsInternalResolutionFrameDumps;
bool bSupportsGPUTextureDecoding;
} backend_info; } backend_info;
// Utility // Utility
@ -211,6 +213,10 @@ struct VideoConfig final
return false; return false;
return backend_info.bSupportsBBox && backend_info.bSupportsFragmentStoresAndAtomics; return backend_info.bSupportsBBox && backend_info.bSupportsFragmentStoresAndAtomics;
} }
bool UseGPUTextureDecoding() const
{
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
}
}; };
extern VideoConfig g_Config; extern VideoConfig g_Config;