From 5480efdff2f6e51245aa690a0ccb152a2b0a438e Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Wed, 7 Jun 2017 04:30:39 -0700 Subject: [PATCH] video: change multisample/AA setting to u32 --- Source/Core/Core/Config/GraphicsSettings.cpp | 2 +- Source/Core/Core/Config/GraphicsSettings.h | 2 +- Source/Core/DolphinWX/VideoConfigDiag.cpp | 6 +++--- Source/Core/VideoBackends/D3D/D3DBase.cpp | 2 +- Source/Core/VideoBackends/OGL/Render.cpp | 4 ++-- Source/Core/VideoBackends/Vulkan/Renderer.cpp | 2 +- Source/Core/VideoCommon/VideoConfig.h | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index dcde16a17d..870fb1971c 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -57,7 +57,7 @@ const ConfigInfo GFX_ENABLE_GPU_TEXTURE_DECODING{ 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_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)}; diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index 7ff7b2b667..0b3b98ee06 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -47,7 +47,7 @@ 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_MSAA; extern const ConfigInfo GFX_SSAA; extern const ConfigInfo GFX_EFB_SCALE; extern const ConfigInfo GFX_TEXFMT_OVERLAY_ENABLE; diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index 65dc4c3603..22490e4ad5 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -1322,11 +1322,11 @@ void VideoConfigDiag::PopulatePostProcessingShaders() void VideoConfigDiag::PopulateAAList() { - const std::vector& aa_modes = vconfig.backend_info.AAModes; + const auto& aa_modes = vconfig.backend_info.AAModes; const bool supports_ssaa = vconfig.backend_info.bSupportsSSAA; m_msaa_modes = 0; - for (int mode : aa_modes) + for (auto mode : aa_modes) { if (mode == 1) { @@ -1342,7 +1342,7 @@ void VideoConfigDiag::PopulateAAList() if (supports_ssaa) { - for (int mode : aa_modes) + for (auto mode : aa_modes) { if (mode != 1) choice_aamode->AppendString(std::to_string(mode) + "x SSAA"); diff --git a/Source/Core/VideoBackends/D3D/D3DBase.cpp b/Source/Core/VideoBackends/D3D/D3DBase.cpp index b1ba228b96..327fece109 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.cpp +++ b/Source/Core/VideoBackends/D3D/D3DBase.cpp @@ -320,7 +320,7 @@ HRESULT Create(HWND wnd) return desc.Count == g_Config.iMultisamples; }) == aa_modes.end()) { - Config::SetCurrent(Config::GFX_MSAA, 1); + Config::SetCurrent(Config::GFX_MSAA, UINT32_C(1)); UpdateActiveConfig(); } diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index ebec5e98a9..ec709c152b 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -63,7 +63,7 @@ static std::unique_ptr s_raster_font; // 1 for no MSAA. Use s_MSAASamples > 1 to check for MSAA. static int s_MSAASamples = 1; -static int s_last_multisamples = 1; +static u32 s_last_multisamples = 1; static bool s_last_stereo_mode = false; static bool s_last_xfb_mode = false; @@ -519,7 +519,7 @@ Renderer::Renderer() { // GLES 3.1 can't support stereo rendering and MSAA OSD::AddMessage("MSAA Stereo rendering isn't supported by your GPU.", 10000); - Config::SetCurrent(Config::GFX_MSAA, 1); + Config::SetCurrent(Config::GFX_MSAA, UINT32_C(1)); } } else diff --git a/Source/Core/VideoBackends/Vulkan/Renderer.cpp b/Source/Core/VideoBackends/Vulkan/Renderer.cpp index 94087bdc1f..81bd7671cd 100644 --- a/Source/Core/VideoBackends/Vulkan/Renderer.cpp +++ b/Source/Core/VideoBackends/Vulkan/Renderer.cpp @@ -1106,7 +1106,7 @@ void Renderer::CheckForSurfaceChange() void Renderer::CheckForConfigChanges() { // Save the video config so we can compare against to determine which settings have changed. - int old_multisamples = g_ActiveConfig.iMultisamples; + u32 old_multisamples = g_ActiveConfig.iMultisamples; int old_anisotropy = g_ActiveConfig.iMaxAnisotropy; int old_stereo_mode = g_ActiveConfig.iStereoMode; int old_aspect_ratio = g_ActiveConfig.iAspectRatio; diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 707afae84c..03d102eb62 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -70,7 +70,7 @@ struct VideoConfig final bool bShaderCache; // Enhancements - int iMultisamples; + u32 iMultisamples; bool bSSAA; int iEFBScale; bool bForceFiltering; @@ -167,7 +167,7 @@ struct VideoConfig final APIType api_type; std::vector Adapters; // for D3D - std::vector AAModes; + std::vector AAModes; // TODO: merge AdapterName and Adapters array std::string AdapterName; // for OpenGL