From d75b536fd7809dab10bb2e0194312673e977a3fe Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 18 May 2017 13:58:57 +0100 Subject: [PATCH] Config: Add GFX ConfigInfo --- Source/Core/Core/CMakeLists.txt | 1 + Source/Core/Core/Config/Config.h | 9 ++ Source/Core/Core/Config/GraphicsSettings.cpp | 135 +++++++++++++++++++ Source/Core/Core/Config/GraphicsSettings.h | 108 +++++++++++++++ Source/Core/Core/Core.vcxproj | 2 + Source/Core/Core/Core.vcxproj.filters | 2 + 6 files changed, 257 insertions(+) create mode 100644 Source/Core/Core/Config/GraphicsSettings.cpp create mode 100644 Source/Core/Core/Config/GraphicsSettings.h diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index e5ba06faac..cdb5f5305c 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -26,6 +26,7 @@ set(SRCS Boot/Boot_WiiWAD.cpp Boot/ElfReader.cpp Config/Config.cpp + Config/GraphicsSettings.cpp ConfigLoaders/BaseConfigLoader.cpp ConfigLoaders/GameConfigLoader.cpp ConfigLoaders/IsSettingSaveable.cpp diff --git a/Source/Core/Core/Config/Config.h b/Source/Core/Core/Config/Config.h index bd31fe22b2..846f016c25 100644 --- a/Source/Core/Core/Config/Config.h +++ b/Source/Core/Core/Config/Config.h @@ -78,4 +78,13 @@ void SetCurrent(const ConfigInfo& info, const T& value) Set(LayerType::CurrentRun, info, value); } +template +void SetBaseOrCurrent(const ConfigInfo& info, const T& value) +{ + if (GetActiveLayerForConfig(info) == LayerType::Base) + Set(LayerType::Base, info, value); + else + Set(LayerType::CurrentRun, info, value); +} + } // namespace Config diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp new file mode 100644 index 0000000000..dcde16a17d --- /dev/null +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -0,0 +1,135 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include + +#include "Core/Config/Config.h" +#include "Core/Config/GraphicsSettings.h" +#include "VideoCommon/VideoConfig.h" + +namespace Config +{ +// Configuration Information + +// Graphics.Hardware + +const ConfigInfo GFX_VSYNC{{System::GFX, "Hardware", "VSync"}, false}; +const ConfigInfo GFX_ADAPTER{{System::GFX, "Hardware", "Adapter"}, 0}; + +// Graphics.Settings + +const ConfigInfo GFX_WIDESCREEN_HACK{{System::GFX, "Settings", "wideScreenHack"}, false}; +const ConfigInfo GFX_ASPECT_RATIO{{System::GFX, "Settings", "AspectRatio"}, + static_cast(ASPECT_AUTO)}; +const ConfigInfo GFX_CROP{{System::GFX, "Settings", "Crop"}, false}; +const ConfigInfo GFX_USE_XFB{{System::GFX, "Settings", "UseXFB"}, false}; +const ConfigInfo GFX_USE_REAL_XFB{{System::GFX, "Settings", "UseRealXFB"}, false}; +const ConfigInfo GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES{ + {System::GFX, "Settings", "SafeTextureCacheColorSamples"}, 128}; +const ConfigInfo GFX_SHOW_FPS{{System::GFX, "Settings", "ShowFPS"}, false}; +const ConfigInfo GFX_SHOW_NETPLAY_PING{{System::GFX, "Settings", "ShowNetPlayPing"}, false}; +const ConfigInfo GFX_SHOW_NETPLAY_MESSAGES{{System::GFX, "Settings", "ShowNetPlayMessages"}, + false}; +const ConfigInfo GFX_LOG_RENDER_TIME_TO_FILE{{System::GFX, "Settings", "LogRenderTimeToFile"}, + false}; +const ConfigInfo GFX_OVERLAY_STATS{{System::GFX, "Settings", "OverlayStats"}, false}; +const ConfigInfo GFX_OVERLAY_PROJ_STATS{{System::GFX, "Settings", "OverlayProjStats"}, false}; +const ConfigInfo GFX_DUMP_TEXTURES{{System::GFX, "Settings", "DumpTextures"}, false}; +const ConfigInfo GFX_HIRES_TEXTURES{{System::GFX, "Settings", "HiresTextures"}, false}; +const ConfigInfo GFX_CONVERT_HIRES_TEXTURES{{System::GFX, "Settings", "ConvertHiresTextures"}, + false}; +const ConfigInfo GFX_CACHE_HIRES_TEXTURES{{System::GFX, "Settings", "CacheHiresTextures"}, + false}; +const ConfigInfo GFX_DUMP_EFB_TARGET{{System::GFX, "Settings", "DumpEFBTarget"}, false}; +const ConfigInfo GFX_DUMP_FRAMES_AS_IMAGES{{System::GFX, "Settings", "DumpFramesAsImages"}, + false}; +const ConfigInfo GFX_FREE_LOOK{{System::GFX, "Settings", "FreeLook"}, false}; +const ConfigInfo GFX_USE_FFV1{{System::GFX, "Settings", "UseFFV1"}, false}; +const ConfigInfo GFX_DUMP_FORMAT{{System::GFX, "Settings", "DumpFormat"}, "avi"}; +const ConfigInfo GFX_DUMP_CODEC{{System::GFX, "Settings", "DumpCodec"}, ""}; +const ConfigInfo GFX_DUMP_PATH{{System::GFX, "Settings", "DumpPath"}, ""}; +const ConfigInfo GFX_BITRATE_KBPS{{System::GFX, "Settings", "BitrateKbps"}, 2500}; +const ConfigInfo GFX_INTERNAL_RESOLUTION_FRAME_DUMPS{ + {System::GFX, "Settings", "InternalResolutionFrameDumps"}, false}; +const ConfigInfo GFX_ENABLE_GPU_TEXTURE_DECODING{ + {System::GFX, "Settings", "EnableGPUTextureDecoding"}, false}; +const ConfigInfo GFX_ENABLE_PIXEL_LIGHTING{{System::GFX, "Settings", "EnablePixelLighting"}, + false}; +const ConfigInfo GFX_FAST_DEPTH_CALC{{System::GFX, "Settings", "FastDepthCalc"}, true}; +const ConfigInfo GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1}; +const ConfigInfo GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false}; +const ConfigInfo GFX_EFB_SCALE{{System::GFX, "Settings", "EFBScale"}, + static_cast(SCALE_1X)}; +const ConfigInfo GFX_TEXFMT_OVERLAY_ENABLE{{System::GFX, "Settings", "TexFmtOverlayEnable"}, + false}; +const ConfigInfo GFX_TEXFMT_OVERLAY_CENTER{{System::GFX, "Settings", "TexFmtOverlayCenter"}, + false}; +const ConfigInfo GFX_ENABLE_WIREFRAME{{System::GFX, "Settings", "WireFrame"}, false}; +const ConfigInfo GFX_DISABLE_FOG{{System::GFX, "Settings", "DisableFog"}, false}; +const ConfigInfo GFX_BORDERLESS_FULLSCREEN{{System::GFX, "Settings", "BorderlessFullscreen"}, + false}; +const ConfigInfo GFX_ENABLE_VALIDATION_LAYER{ + {System::GFX, "Settings", "EnableValidationLayer"}, false}; +const ConfigInfo GFX_BACKEND_MULTITHREADING{ + {System::GFX, "Settings", "BackendMultithreading"}, true}; +const ConfigInfo GFX_COMMAND_BUFFER_EXECUTE_INTERVAL{ + {System::GFX, "Settings", "CommandBufferExecuteInterval"}, 100}; +const ConfigInfo GFX_SHADER_CACHE{{System::GFX, "Settings", "ShaderCache"}, true}; + +const ConfigInfo GFX_SW_ZCOMPLOC{{System::GFX, "Settings", "SWZComploc"}, true}; +const ConfigInfo GFX_SW_ZFREEZE{{System::GFX, "Settings", "SWZFreeze"}, true}; +const ConfigInfo GFX_SW_DUMP_OBJECTS{{System::GFX, "Settings", "SWDumpObjects"}, false}; +const ConfigInfo GFX_SW_DUMP_TEV_STAGES{{System::GFX, "Settings", "SWDumpTevStages"}, false}; +const ConfigInfo GFX_SW_DUMP_TEV_TEX_FETCHES{{System::GFX, "Settings", "SWDumpTevTexFetches"}, + false}; +const ConfigInfo GFX_SW_DRAW_START{{System::GFX, "Settings", "SWDrawStart"}, 0}; +const ConfigInfo GFX_SW_DRAW_END{{System::GFX, "Settings", "SWDrawEnd"}, 100000}; + +// Graphics.Enhancements + +const ConfigInfo GFX_ENHANCE_FORCE_FILTERING{{System::GFX, "Enhancements", "ForceFiltering"}, + false}; +const ConfigInfo GFX_ENHANCE_MAX_ANISOTROPY{{System::GFX, "Enhancements", "MaxAnisotropy"}, 0}; +const ConfigInfo GFX_ENHANCE_POST_SHADER{ + {System::GFX, "Enhancements", "PostProcessingShader"}, ""}; +const ConfigInfo GFX_ENHANCE_FORCE_TRUE_COLOR{{System::GFX, "Enhancements", "ForceTrueColor"}, + true}; + +// Graphics.Stereoscopy + +const ConfigInfo GFX_STEREO_MODE{{System::GFX, "Stereoscopy", "StereoMode"}, 0}; +const ConfigInfo GFX_STEREO_DEPTH{{System::GFX, "Stereoscopy", "StereoDepth"}, 20}; +const ConfigInfo GFX_STEREO_CONVERGENCE_PERCENTAGE{ + {System::GFX, "Stereoscopy", "StereoConvergencePercentage"}, 100}; +const ConfigInfo GFX_STEREO_SWAP_EYES{{System::GFX, "Stereoscopy", "StereoSwapEyes"}, false}; +const ConfigInfo GFX_STEREO_CONVERGENCE{{System::GFX, "Stereoscopy", "StereoConvergence"}, 20}; +const ConfigInfo GFX_STEREO_EFB_MONO_DEPTH{{System::GFX, "Stereoscopy", "StereoEFBMonoDepth"}, + false}; +const ConfigInfo GFX_STEREO_DEPTH_PERCENTAGE{ + {System::GFX, "Stereoscopy", "StereoDepthPercentage"}, 100}; + +// Graphics.Hacks + +const ConfigInfo GFX_HACK_EFB_ACCESS_ENABLE{{System::GFX, "Hacks", "EFBAccessEnable"}, true}; +const ConfigInfo GFX_HACK_BBOX_ENABLE{{System::GFX, "Hacks", "BBoxEnable"}, false}; +const ConfigInfo GFX_HACK_BBOX_PREFER_STENCIL_IMPLEMENTATION{ + {System::GFX, "Hacks", "BBoxPreferStencilImplementation"}, false}; +const ConfigInfo GFX_HACK_FORCE_PROGRESSIVE{{System::GFX, "Hacks", "ForceProgressive"}, true}; +const ConfigInfo GFX_HACK_SKIP_EFB_COPY_TO_RAM{{System::GFX, "Hacks", "EFBToTextureEnable"}, + true}; +const ConfigInfo GFX_HACK_COPY_EFB_ENABLED{{System::GFX, "Hacks", "EFBScaledCopy"}, true}; +const ConfigInfo GFX_HACK_EFB_EMULATE_FORMAT_CHANGES{ + {System::GFX, "Hacks", "EFBEmulateFormatChanges"}, false}; +const ConfigInfo GFX_HACK_VERTEX_ROUDING{{System::GFX, "Hacks", "VertexRounding"}, false}; + +// Graphics.GameSpecific + +const ConfigInfo GFX_PROJECTION_HACK{{System::GFX, "GameSpecific", "ProjectionHack"}, 0}; +const ConfigInfo GFX_PROJECTION_HACK_SZNEAR{{System::GFX, "GameSpecific", "PH_SZNear"}, 0}; +const ConfigInfo GFX_PROJECTION_HACK_SZFAR{{System::GFX, "GameSpecific", "PH_SZFar"}, 0}; +const ConfigInfo GFX_PROJECTION_HACK_ZNEAR{{System::GFX, "GameSpecific", "PH_ZNear"}, 0}; +const ConfigInfo GFX_PROJECTION_HACK_ZFAR{{System::GFX, "GameSpecific", "PH_ZFar"}, 0}; +const ConfigInfo GFX_PERF_QUERIES_ENABLE{{System::GFX, "GameSpecific", "PerfQueriesEnable"}, + false}; +} // namespace Config diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h new file mode 100644 index 0000000000..7ff7b2b667 --- /dev/null +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -0,0 +1,108 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include + +#include "Core/Config/Config.h" + +namespace Config +{ +// Configuration Information + +// Graphics.Hardware + +extern const ConfigInfo GFX_VSYNC; +extern const ConfigInfo GFX_ADAPTER; + +// Graphics.Settings + +extern const ConfigInfo GFX_WIDESCREEN_HACK; +extern const ConfigInfo GFX_ASPECT_RATIO; +extern const ConfigInfo GFX_CROP; +extern const ConfigInfo GFX_USE_XFB; +extern const ConfigInfo GFX_USE_REAL_XFB; +extern const ConfigInfo GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES; +extern const ConfigInfo GFX_SHOW_FPS; +extern const ConfigInfo GFX_SHOW_NETPLAY_PING; +extern const ConfigInfo GFX_SHOW_NETPLAY_MESSAGES; +extern const ConfigInfo GFX_LOG_RENDER_TIME_TO_FILE; +extern const ConfigInfo GFX_OVERLAY_STATS; +extern const ConfigInfo GFX_OVERLAY_PROJ_STATS; +extern const ConfigInfo GFX_DUMP_TEXTURES; +extern const ConfigInfo GFX_HIRES_TEXTURES; +extern const ConfigInfo GFX_CONVERT_HIRES_TEXTURES; +extern const ConfigInfo GFX_CACHE_HIRES_TEXTURES; +extern const ConfigInfo GFX_DUMP_EFB_TARGET; +extern const ConfigInfo GFX_DUMP_FRAMES_AS_IMAGES; +extern const ConfigInfo GFX_FREE_LOOK; +extern const ConfigInfo GFX_USE_FFV1; +extern const ConfigInfo GFX_DUMP_FORMAT; +extern const ConfigInfo GFX_DUMP_CODEC; +extern const ConfigInfo GFX_DUMP_PATH; +extern const ConfigInfo GFX_BITRATE_KBPS; +extern const ConfigInfo GFX_INTERNAL_RESOLUTION_FRAME_DUMPS; +extern const ConfigInfo GFX_ENABLE_GPU_TEXTURE_DECODING; +extern const ConfigInfo GFX_ENABLE_PIXEL_LIGHTING; +extern const ConfigInfo GFX_FAST_DEPTH_CALC; +extern const ConfigInfo GFX_MSAA; +extern const ConfigInfo GFX_SSAA; +extern const ConfigInfo GFX_EFB_SCALE; +extern const ConfigInfo GFX_TEXFMT_OVERLAY_ENABLE; +extern const ConfigInfo GFX_TEXFMT_OVERLAY_CENTER; +extern const ConfigInfo GFX_ENABLE_WIREFRAME; +extern const ConfigInfo GFX_DISABLE_FOG; +extern const ConfigInfo GFX_BORDERLESS_FULLSCREEN; +extern const ConfigInfo GFX_ENABLE_VALIDATION_LAYER; +extern const ConfigInfo GFX_BACKEND_MULTITHREADING; +extern const ConfigInfo GFX_COMMAND_BUFFER_EXECUTE_INTERVAL; +extern const ConfigInfo GFX_SHADER_CACHE; + +extern const ConfigInfo GFX_SW_ZCOMPLOC; +extern const ConfigInfo GFX_SW_ZFREEZE; +extern const ConfigInfo GFX_SW_DUMP_OBJECTS; +extern const ConfigInfo GFX_SW_DUMP_TEV_STAGES; +extern const ConfigInfo GFX_SW_DUMP_TEV_TEX_FETCHES; +extern const ConfigInfo GFX_SW_DRAW_START; +extern const ConfigInfo GFX_SW_DRAW_END; + +// Graphics.Enhancements + +extern const ConfigInfo GFX_ENHANCE_FORCE_FILTERING; +extern const ConfigInfo GFX_ENHANCE_MAX_ANISOTROPY; // NOTE - this is x in (1 << x) +extern const ConfigInfo GFX_ENHANCE_POST_SHADER; +extern const ConfigInfo GFX_ENHANCE_FORCE_TRUE_COLOR; + +// Graphics.Stereoscopy + +extern const ConfigInfo GFX_STEREO_MODE; +extern const ConfigInfo GFX_STEREO_DEPTH; +extern const ConfigInfo GFX_STEREO_CONVERGENCE_PERCENTAGE; +extern const ConfigInfo GFX_STEREO_SWAP_EYES; +extern const ConfigInfo GFX_STEREO_CONVERGENCE; +extern const ConfigInfo GFX_STEREO_EFB_MONO_DEPTH; +extern const ConfigInfo GFX_STEREO_DEPTH_PERCENTAGE; + +// Graphics.Hacks + +extern const ConfigInfo GFX_HACK_EFB_ACCESS_ENABLE; +extern const ConfigInfo GFX_HACK_BBOX_ENABLE; +extern const ConfigInfo GFX_HACK_BBOX_PREFER_STENCIL_IMPLEMENTATION; +extern const ConfigInfo GFX_HACK_FORCE_PROGRESSIVE; +extern const ConfigInfo GFX_HACK_SKIP_EFB_COPY_TO_RAM; +extern const ConfigInfo GFX_HACK_COPY_EFB_ENABLED; +extern const ConfigInfo GFX_HACK_EFB_EMULATE_FORMAT_CHANGES; +extern const ConfigInfo GFX_HACK_VERTEX_ROUDING; + +// Graphics.GameSpecific + +extern const ConfigInfo GFX_PROJECTION_HACK; +extern const ConfigInfo GFX_PROJECTION_HACK_SZNEAR; +extern const ConfigInfo GFX_PROJECTION_HACK_SZFAR; +extern const ConfigInfo GFX_PROJECTION_HACK_ZNEAR; +extern const ConfigInfo GFX_PROJECTION_HACK_ZFAR; +extern const ConfigInfo GFX_PERF_QUERIES_ENABLE; + +} // namespace Config diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index d1c648a78d..5c75dbd778 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -57,6 +57,7 @@ + @@ -310,6 +311,7 @@ + diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters index 8f9a620aa8..ebeb6b2fca 100644 --- a/Source/Core/Core/Core.vcxproj.filters +++ b/Source/Core/Core/Core.vcxproj.filters @@ -857,6 +857,7 @@ ConfigLoader + @@ -1491,6 +1492,7 @@ ConfigLoader + ConfigLoader