2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-09-13 08:21:35 +00:00
|
|
|
// IMPORTANT: UI etc should modify g_Config. Graphics code should read g_ActiveConfig.
|
|
|
|
// The reason for this is to get rid of race conditions etc when the configuration
|
|
|
|
// changes in the middle of a frame. This is done by copying g_Config to g_ActiveConfig
|
|
|
|
// at the start of every frame. Noone should ever change members of g_ActiveConfig
|
|
|
|
// directly.
|
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2022-03-15 06:46:58 +00:00
|
|
|
#include <optional>
|
2009-07-12 21:58:32 +00:00
|
|
|
#include <string>
|
2014-02-17 10:18:15 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2014-09-08 01:06:58 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2022-03-15 06:46:58 +00:00
|
|
|
#include "VideoCommon/GraphicsModSystem/Config/GraphicsModGroup.h"
|
2021-09-04 04:43:19 +00:00
|
|
|
#include "VideoCommon/VideoCommon.h"
|
2009-07-12 21:58:32 +00:00
|
|
|
|
2017-07-03 14:32:02 +00:00
|
|
|
constexpr int EFB_SCALE_AUTO_INTEGRAL = 0;
|
|
|
|
|
2018-01-08 11:04:12 +00:00
|
|
|
enum class AspectMode : int
|
2010-01-13 21:11:02 +00:00
|
|
|
{
|
2017-11-11 03:45:32 +00:00
|
|
|
Auto,
|
|
|
|
AnalogWide,
|
|
|
|
Analog,
|
|
|
|
Stretch,
|
2010-01-13 21:11:02 +00:00
|
|
|
};
|
|
|
|
|
2018-01-08 11:04:12 +00:00
|
|
|
enum class StereoMode : int
|
2014-10-31 14:25:42 +00:00
|
|
|
{
|
2017-11-11 03:55:00 +00:00
|
|
|
Off,
|
|
|
|
SBS,
|
|
|
|
TAB,
|
|
|
|
Anaglyph,
|
|
|
|
QuadBuffer,
|
2019-10-02 01:07:17 +00:00
|
|
|
Passive
|
2014-10-31 14:25:42 +00:00
|
|
|
};
|
|
|
|
|
2018-03-16 13:10:22 +00:00
|
|
|
enum class ShaderCompilationMode : int
|
2018-03-01 08:03:24 +00:00
|
|
|
{
|
2018-03-16 13:10:22 +00:00
|
|
|
Synchronous,
|
|
|
|
SynchronousUberShaders,
|
|
|
|
AsynchronousUberShaders,
|
|
|
|
AsynchronousSkipRendering
|
2018-03-01 08:03:24 +00:00
|
|
|
};
|
|
|
|
|
2022-11-14 05:01:19 +00:00
|
|
|
enum class TextureFilteringMode : int
|
|
|
|
{
|
|
|
|
Default,
|
|
|
|
Nearest,
|
|
|
|
Linear,
|
|
|
|
};
|
|
|
|
|
2023-06-27 00:23:08 +00:00
|
|
|
enum class OutputResamplingMode : int
|
|
|
|
{
|
|
|
|
Default,
|
|
|
|
Bilinear,
|
2023-08-03 22:53:21 +00:00
|
|
|
BSpline,
|
|
|
|
MitchellNetravali,
|
2023-06-27 00:23:08 +00:00
|
|
|
CatmullRom,
|
|
|
|
SharpBilinear,
|
2023-08-03 22:53:21 +00:00
|
|
|
AreaSampling,
|
2023-06-27 00:23:08 +00:00
|
|
|
};
|
|
|
|
|
Video: implement color correction to match the NTSC and PAL color spaces (and gamma) that GC and Wii targeted.
To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary
to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and
do them in linear space instead of gamma space (which is very important when playing at low resolutions).
For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now
R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted.
Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly)
as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used
by video standards dating to the pre HDR era (roughly gamma 2.35).
Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for
our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without
having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games
with strongly different and simpler lighting. HDR should also be supported in Linux.
Development of my own AutoHDR shader is almost complete and will come next.
This has been carefully tested and there should be no regression in any of the different features that Dolphin
offers, like multisampling, stereo rendering, other post processes, etc etc.
Fixes: https://bugs.dolphin-emu.org/issues/8941
Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com>
Co-authored-by: Dogway <lin_ares@hotmail.com>
2023-06-10 08:48:05 +00:00
|
|
|
enum class ColorCorrectionRegion : int
|
|
|
|
{
|
|
|
|
SMPTE_NTSCM,
|
|
|
|
SYSTEMJ_NTSCJ,
|
|
|
|
EBU_PAL,
|
|
|
|
};
|
|
|
|
|
2022-07-23 22:27:24 +00:00
|
|
|
enum class TriState : int
|
|
|
|
{
|
|
|
|
Off,
|
|
|
|
On,
|
|
|
|
Auto
|
|
|
|
};
|
|
|
|
|
2023-01-29 16:06:25 +00:00
|
|
|
// Bitmask containing information about which configuration has changed for the backend.
|
|
|
|
enum ConfigChangeBits : u32
|
|
|
|
{
|
|
|
|
CONFIG_CHANGE_BIT_HOST_CONFIG = (1 << 0),
|
|
|
|
CONFIG_CHANGE_BIT_MULTISAMPLES = (1 << 1),
|
|
|
|
CONFIG_CHANGE_BIT_STEREO_MODE = (1 << 2),
|
|
|
|
CONFIG_CHANGE_BIT_TARGET_SIZE = (1 << 3),
|
|
|
|
CONFIG_CHANGE_BIT_ANISOTROPY = (1 << 4),
|
|
|
|
CONFIG_CHANGE_BIT_FORCE_TEXTURE_FILTERING = (1 << 5),
|
|
|
|
CONFIG_CHANGE_BIT_VSYNC = (1 << 6),
|
2023-01-30 11:49:23 +00:00
|
|
|
CONFIG_CHANGE_BIT_BBOX = (1 << 7),
|
|
|
|
CONFIG_CHANGE_BIT_ASPECT_RATIO = (1 << 8),
|
|
|
|
CONFIG_CHANGE_BIT_POST_PROCESSING_SHADER = (1 << 9),
|
Video: implement color correction to match the NTSC and PAL color spaces (and gamma) that GC and Wii targeted.
To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary
to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and
do them in linear space instead of gamma space (which is very important when playing at low resolutions).
For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now
R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted.
Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly)
as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used
by video standards dating to the pre HDR era (roughly gamma 2.35).
Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for
our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without
having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games
with strongly different and simpler lighting. HDR should also be supported in Linux.
Development of my own AutoHDR shader is almost complete and will come next.
This has been carefully tested and there should be no regression in any of the different features that Dolphin
offers, like multisampling, stereo rendering, other post processes, etc etc.
Fixes: https://bugs.dolphin-emu.org/issues/8941
Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com>
Co-authored-by: Dogway <lin_ares@hotmail.com>
2023-06-10 08:48:05 +00:00
|
|
|
CONFIG_CHANGE_BIT_HDR = (1 << 10),
|
2023-01-29 16:06:25 +00:00
|
|
|
};
|
|
|
|
|
2009-02-28 16:33:59 +00:00
|
|
|
// NEVER inherit from this class.
|
2014-03-16 21:00:29 +00:00
|
|
|
struct VideoConfig final
|
2008-10-22 21:23:40 +00:00
|
|
|
{
|
2021-09-04 04:43:19 +00:00
|
|
|
VideoConfig() = default;
|
2017-05-18 12:59:38 +00:00
|
|
|
void Refresh();
|
2011-02-13 13:42:59 +00:00
|
|
|
void VerifyValidity();
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-06-05 01:38:22 +00:00
|
|
|
// General
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bVSync = false;
|
|
|
|
bool bVSyncActive = false;
|
|
|
|
bool bWidescreenHack = false;
|
|
|
|
AspectMode aspect_mode{};
|
|
|
|
AspectMode suggested_aspect_mode{};
|
|
|
|
bool bCrop = false; // Aspect ratio controls.
|
|
|
|
bool bShaderCache = false;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2008-10-26 13:35:34 +00:00
|
|
|
// Enhancements
|
2021-09-04 04:43:19 +00:00
|
|
|
u32 iMultisamples = 0;
|
|
|
|
bool bSSAA = false;
|
|
|
|
int iEFBScale = 0;
|
2022-11-14 05:01:19 +00:00
|
|
|
TextureFilteringMode texture_filtering_mode = TextureFilteringMode::Default;
|
2023-06-27 00:23:08 +00:00
|
|
|
OutputResamplingMode output_resampling_mode = OutputResamplingMode::Default;
|
2021-09-04 04:43:19 +00:00
|
|
|
int iMaxAnisotropy = 0;
|
2009-06-08 19:42:25 +00:00
|
|
|
std::string sPostProcessingShader;
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bForceTrueColor = false;
|
|
|
|
bool bDisableCopyFilter = false;
|
|
|
|
bool bArbitraryMipmapDetection = false;
|
|
|
|
float fArbitraryMipmapDetectionThreshold = 0;
|
Video: implement color correction to match the NTSC and PAL color spaces (and gamma) that GC and Wii targeted.
To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary
to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and
do them in linear space instead of gamma space (which is very important when playing at low resolutions).
For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now
R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted.
Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly)
as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used
by video standards dating to the pre HDR era (roughly gamma 2.35).
Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for
our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without
having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games
with strongly different and simpler lighting. HDR should also be supported in Linux.
Development of my own AutoHDR shader is almost complete and will come next.
This has been carefully tested and there should be no regression in any of the different features that Dolphin
offers, like multisampling, stereo rendering, other post processes, etc etc.
Fixes: https://bugs.dolphin-emu.org/issues/8941
Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com>
Co-authored-by: Dogway <lin_ares@hotmail.com>
2023-06-10 08:48:05 +00:00
|
|
|
bool bHDR = false;
|
|
|
|
|
|
|
|
// Color Correction
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
// Color Space Correction:
|
|
|
|
bool bCorrectColorSpace = false;
|
|
|
|
ColorCorrectionRegion game_color_space = ColorCorrectionRegion::SMPTE_NTSCM;
|
|
|
|
|
|
|
|
// Gamma Correction:
|
|
|
|
bool bCorrectGamma = false;
|
|
|
|
float fGameGamma = 2.35f;
|
|
|
|
bool bSDRDisplayGammaSRGB = true;
|
|
|
|
// Custom gamma when the display is not sRGB
|
|
|
|
float fSDRDisplayCustomGamma = 2.2f;
|
|
|
|
|
|
|
|
// HDR:
|
|
|
|
// 200 is a good default value that matches the brightness of many SDR screens
|
|
|
|
float fHDRPaperWhiteNits = 200.f;
|
|
|
|
} color_correction;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2008-10-26 13:35:34 +00:00
|
|
|
// Information
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bShowFPS = false;
|
2022-12-24 00:52:53 +00:00
|
|
|
bool bShowFTimes = false;
|
2022-10-26 19:17:15 +00:00
|
|
|
bool bShowVPS = false;
|
2022-12-24 00:52:53 +00:00
|
|
|
bool bShowVTimes = false;
|
|
|
|
bool bShowGraphs = false;
|
2022-10-26 19:17:15 +00:00
|
|
|
bool bShowSpeed = false;
|
|
|
|
bool bShowSpeedColors = false;
|
|
|
|
int iPerfSampleUSec = 0;
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bShowNetPlayPing = false;
|
|
|
|
bool bShowNetPlayMessages = false;
|
|
|
|
bool bOverlayStats = false;
|
|
|
|
bool bOverlayProjStats = false;
|
2021-11-28 01:09:55 +00:00
|
|
|
bool bOverlayScissorStats = false;
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bTexFmtOverlayEnable = false;
|
|
|
|
bool bTexFmtOverlayCenter = false;
|
|
|
|
bool bLogRenderTimeToFile = false;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-06-05 01:38:22 +00:00
|
|
|
// Render
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bWireFrame = false;
|
|
|
|
bool bDisableFog = false;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-06-05 01:38:22 +00:00
|
|
|
// Utility
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bDumpTextures = false;
|
|
|
|
bool bDumpMipmapTextures = false;
|
|
|
|
bool bDumpBaseTextures = false;
|
|
|
|
bool bHiresTextures = false;
|
|
|
|
bool bCacheHiresTextures = false;
|
|
|
|
bool bDumpEFBTarget = false;
|
|
|
|
bool bDumpXFBTarget = false;
|
|
|
|
bool bDumpFramesAsImages = false;
|
|
|
|
bool bUseFFV1 = false;
|
2017-02-21 19:04:22 +00:00
|
|
|
std::string sDumpCodec;
|
2022-04-08 22:45:49 +00:00
|
|
|
std::string sDumpPixelFormat;
|
2017-12-29 14:00:55 +00:00
|
|
|
std::string sDumpEncoder;
|
2017-02-21 10:43:49 +00:00
|
|
|
std::string sDumpFormat;
|
2017-02-21 19:37:36 +00:00
|
|
|
std::string sDumpPath;
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bInternalResolutionFrameDumps = false;
|
|
|
|
bool bBorderlessFullscreen = false;
|
|
|
|
bool bEnableGPUTextureDecoding = false;
|
2022-07-24 08:51:22 +00:00
|
|
|
bool bPreferVSForLinePointExpansion = false;
|
2021-09-04 04:43:19 +00:00
|
|
|
int iBitrateKbps = 0;
|
2022-04-07 05:00:38 +00:00
|
|
|
bool bGraphicMods = false;
|
2022-03-15 06:46:58 +00:00
|
|
|
std::optional<GraphicsModGroupConfig> graphics_mod_config;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-06-05 01:38:22 +00:00
|
|
|
// Hacks
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bEFBAccessEnable = false;
|
|
|
|
bool bEFBAccessDeferInvalidation = false;
|
|
|
|
bool bPerfQueriesEnable = false;
|
|
|
|
bool bBBoxEnable = false;
|
|
|
|
bool bForceProgressive = false;
|
2022-07-26 08:57:30 +00:00
|
|
|
bool bCPUCull = false;
|
2021-09-04 04:43:19 +00:00
|
|
|
|
|
|
|
bool bEFBEmulateFormatChanges = false;
|
|
|
|
bool bSkipEFBCopyToRam = false;
|
|
|
|
bool bSkipXFBCopyToRam = false;
|
|
|
|
bool bDisableCopyToVRAM = false;
|
|
|
|
bool bDeferEFBCopies = false;
|
|
|
|
bool bImmediateXFB = false;
|
|
|
|
bool bSkipPresentingDuplicateXFBs = false;
|
|
|
|
bool bCopyEFBScaled = false;
|
|
|
|
int iSafeTextureCache_ColorSamples = 0;
|
|
|
|
float fAspectRatioHackW = 1; // Initial value needed for the first frame
|
|
|
|
float fAspectRatioHackH = 1;
|
|
|
|
bool bEnablePixelLighting = false;
|
|
|
|
bool bFastDepthCalc = false;
|
|
|
|
bool bVertexRounding = false;
|
2023-01-14 06:56:37 +00:00
|
|
|
bool bVISkip = false;
|
2021-09-04 04:43:19 +00:00
|
|
|
int iEFBAccessTileSize = 0;
|
|
|
|
int iSaveTargetId = 0; // TODO: Should be dropped
|
|
|
|
u32 iMissingColorValue = 0;
|
2021-07-30 00:43:35 +00:00
|
|
|
bool bFastTextureSampling = false;
|
2022-11-07 05:28:46 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
bool bNoMipmapping = false; // Used by macOS fifoci to work around an M1 bug
|
|
|
|
#endif
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-11-24 11:01:21 +00:00
|
|
|
// Stereoscopy
|
2021-09-04 04:43:19 +00:00
|
|
|
StereoMode stereo_mode{};
|
|
|
|
int iStereoDepth = 0;
|
|
|
|
int iStereoConvergence = 0;
|
|
|
|
int iStereoConvergencePercentage = 0;
|
|
|
|
bool bStereoSwapEyes = false;
|
|
|
|
bool bStereoEFBMonoDepth = false;
|
|
|
|
int iStereoDepthPercentage = 0;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2009-09-13 08:21:35 +00:00
|
|
|
// D3D only config, mostly to be merged into the above
|
2021-09-04 04:43:19 +00:00
|
|
|
int iAdapter = 0;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-07-23 22:27:24 +00:00
|
|
|
// Metal only config
|
|
|
|
TriState iManuallyUploadBuffers = TriState::Auto;
|
2022-10-24 22:40:32 +00:00
|
|
|
TriState iUsePresentDrawable = TriState::Auto;
|
2022-07-23 22:27:24 +00:00
|
|
|
|
2016-08-13 12:08:46 +00:00
|
|
|
// Enable API validation layers, currently only supported with Vulkan.
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bEnableValidationLayer = false;
|
2016-08-13 12:08:46 +00:00
|
|
|
|
|
|
|
// Multithreaded submission, currently only supported with Vulkan.
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bBackendMultithreading = true;
|
2016-08-13 12:08:46 +00:00
|
|
|
|
2016-08-13 12:57:50 +00:00
|
|
|
// Early command buffer execution interval in number of draws.
|
|
|
|
// Currently only supported with Vulkan.
|
2021-09-04 04:43:19 +00:00
|
|
|
int iCommandBufferExecuteInterval = 0;
|
2016-08-13 12:57:50 +00:00
|
|
|
|
2018-03-01 08:03:24 +00:00
|
|
|
// Shader compilation settings.
|
2021-09-04 04:43:19 +00:00
|
|
|
bool bWaitForShadersBeforeStarting = false;
|
|
|
|
ShaderCompilationMode iShaderCompilationMode{};
|
2017-06-13 10:07:09 +00:00
|
|
|
|
|
|
|
// Number of shader compiler threads.
|
|
|
|
// 0 disables background compilation.
|
|
|
|
// -1 uses an automatic number based on the CPU threads.
|
2021-09-04 04:43:19 +00:00
|
|
|
int iShaderCompilerThreads = 0;
|
|
|
|
int iShaderPrecompilerThreads = 0;
|
2017-06-13 10:07:09 +00:00
|
|
|
|
2023-05-31 22:05:06 +00:00
|
|
|
// Loading custom drivers on Android
|
|
|
|
std::string customDriverLibraryName;
|
|
|
|
|
2009-09-13 21:18:04 +00:00
|
|
|
// Static config per API
|
2011-05-31 20:16:59 +00:00
|
|
|
// TODO: Move this out of VideoConfig
|
2011-03-21 19:57:31 +00:00
|
|
|
struct
|
2010-11-21 14:47:28 +00:00
|
|
|
{
|
2021-09-04 04:43:19 +00:00
|
|
|
APIType api_type = APIType::Nothing;
|
2022-10-23 00:48:50 +00:00
|
|
|
std::string DisplayName;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2013-09-22 15:49:26 +00:00
|
|
|
std::vector<std::string> Adapters; // for D3D
|
2017-06-07 11:30:39 +00:00
|
|
|
std::vector<u32> AAModes;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2016-06-20 11:54:44 +00:00
|
|
|
// TODO: merge AdapterName and Adapters array
|
|
|
|
std::string AdapterName; // for OpenGL
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2021-09-04 04:43:19 +00:00
|
|
|
u32 MaxTextureSize = 16384;
|
|
|
|
bool bUsesLowerLeftOrigin = false;
|
2023-01-26 06:06:39 +00:00
|
|
|
bool bUsesExplictQuadBuffering = false;
|
2021-09-04 04:43:19 +00:00
|
|
|
|
|
|
|
bool bSupportsExclusiveFullscreen = false;
|
|
|
|
bool bSupportsDualSourceBlend = false;
|
|
|
|
bool bSupportsPrimitiveRestart = false;
|
|
|
|
bool bSupportsGeometryShaders = false;
|
|
|
|
bool bSupportsComputeShaders = false;
|
|
|
|
bool bSupports3DVision = false;
|
|
|
|
bool bSupportsEarlyZ = false; // needed by PixelShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsBindingLayout = false; // Needed by ShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsBBox = false;
|
|
|
|
bool bSupportsGSInstancing = false; // Needed by GeometryShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsPostProcessing = false;
|
|
|
|
bool bSupportsPaletteConversion = false;
|
|
|
|
bool bSupportsClipControl = false; // Needed by VertexShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsSSAA = false;
|
|
|
|
bool bSupportsFragmentStoresAndAtomics = false; // a.k.a. OpenGL SSBOs a.k.a. Direct3D UAVs
|
|
|
|
bool bSupportsDepthClamp = false; // Needed by VertexShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsReversedDepthRange = false;
|
|
|
|
bool bSupportsLogicOp = false;
|
|
|
|
bool bSupportsMultithreading = false;
|
|
|
|
bool bSupportsGPUTextureDecoding = false;
|
|
|
|
bool bSupportsST3CTextures = false;
|
|
|
|
bool bSupportsCopyToVram = false;
|
|
|
|
bool bSupportsBitfield = false; // Needed by UberShaders, so must stay in VideoCommon
|
|
|
|
// Needed by UberShaders, so must stay in VideoCommon
|
|
|
|
bool bSupportsDynamicSamplerIndexing = false;
|
|
|
|
bool bSupportsBPTCTextures = false;
|
|
|
|
bool bSupportsFramebufferFetch = false; // Used as an alternative to dual-source blend on GLES
|
|
|
|
bool bSupportsBackgroundCompiling = false;
|
|
|
|
bool bSupportsLargePoints = false;
|
|
|
|
bool bSupportsPartialDepthCopies = false;
|
|
|
|
bool bSupportsDepthReadback = false;
|
|
|
|
bool bSupportsShaderBinaries = false;
|
|
|
|
bool bSupportsPipelineCacheData = false;
|
2021-11-14 04:10:20 +00:00
|
|
|
bool bSupportsCoarseDerivatives = false;
|
2021-11-14 04:10:55 +00:00
|
|
|
bool bSupportsTextureQueryLevels = false;
|
2021-08-07 03:26:51 +00:00
|
|
|
bool bSupportsLodBiasInSampler = false;
|
2022-01-31 02:44:57 +00:00
|
|
|
bool bSupportsSettingObjectNames = false;
|
2022-06-21 07:07:35 +00:00
|
|
|
bool bSupportsPartialMultisampleResolve = false;
|
2022-06-18 06:09:35 +00:00
|
|
|
bool bSupportsDynamicVertexLoader = false;
|
2022-07-23 05:47:04 +00:00
|
|
|
bool bSupportsVSLinePointExpand = false;
|
2022-12-11 07:15:15 +00:00
|
|
|
bool bSupportsGLLayerInFS = true;
|
Video: implement color correction to match the NTSC and PAL color spaces (and gamma) that GC and Wii targeted.
To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary
to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and
do them in linear space instead of gamma space (which is very important when playing at low resolutions).
For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now
R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted.
Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly)
as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used
by video standards dating to the pre HDR era (roughly gamma 2.35).
Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for
our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without
having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games
with strongly different and simpler lighting. HDR should also be supported in Linux.
Development of my own AutoHDR shader is almost complete and will come next.
This has been carefully tested and there should be no regression in any of the different features that Dolphin
offers, like multisampling, stereo rendering, other post processes, etc etc.
Fixes: https://bugs.dolphin-emu.org/issues/8941
Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com>
Co-authored-by: Dogway <lin_ares@hotmail.com>
2023-06-10 08:48:05 +00:00
|
|
|
bool bSupportsHDROutput = false;
|
2010-11-21 14:47:28 +00:00
|
|
|
} backend_info;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2012-09-28 21:19:50 +00:00
|
|
|
// Utility
|
2022-07-23 05:47:04 +00:00
|
|
|
bool UseVSForLinePointExpand() const
|
|
|
|
{
|
|
|
|
if (!backend_info.bSupportsVSLinePointExpand)
|
|
|
|
return false;
|
2022-07-24 08:51:22 +00:00
|
|
|
if (!backend_info.bSupportsGeometryShaders)
|
|
|
|
return true;
|
|
|
|
return bPreferVSForLinePointExpansion;
|
2022-07-23 05:47:04 +00:00
|
|
|
}
|
2017-04-30 08:07:57 +00:00
|
|
|
bool MultisamplingEnabled() const { return iMultisamples > 1; }
|
2014-10-07 14:43:32 +00:00
|
|
|
bool ExclusiveFullscreenEnabled() const
|
|
|
|
{
|
|
|
|
return backend_info.bSupportsExclusiveFullscreen && !bBorderlessFullscreen;
|
|
|
|
}
|
2016-11-27 08:14:57 +00:00
|
|
|
bool UseGPUTextureDecoding() const
|
|
|
|
{
|
|
|
|
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
|
|
|
|
}
|
2017-07-03 14:32:02 +00:00
|
|
|
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != 1; }
|
2022-12-27 21:45:13 +00:00
|
|
|
bool ManualTextureSamplingWithCustomTextureSizes() const
|
2021-08-02 00:31:40 +00:00
|
|
|
{
|
2022-12-27 21:45:13 +00:00
|
|
|
// If manual texture sampling is disabled, we don't need to do anything.
|
2021-08-02 00:31:40 +00:00
|
|
|
if (bFastTextureSampling)
|
|
|
|
return false;
|
2022-12-27 21:45:13 +00:00
|
|
|
// Hi-res textures break the wrapping logic used by manual texture sampling, as a texture's
|
|
|
|
// size won't match the size the game sets.
|
|
|
|
if (bHiresTextures)
|
|
|
|
return true;
|
|
|
|
// Hi-res EFB copies (but not native-resolution EFB copies at higher internal resolutions)
|
|
|
|
// also result in different texture sizes that need special handling.
|
2021-08-02 00:31:40 +00:00
|
|
|
if (iEFBScale != 1 && bCopyEFBScaled)
|
|
|
|
return true;
|
2022-12-27 21:45:13 +00:00
|
|
|
// Stereoscopic 3D changes the number of layers some textures have (EFB copies have 2 layers,
|
|
|
|
// while game textures still have 1), meaning bounds checks need to be added.
|
|
|
|
if (stereo_mode != StereoMode::Off)
|
|
|
|
return true;
|
|
|
|
// Otherwise, manual texture sampling can use the sizes games specify directly.
|
|
|
|
return false;
|
2021-08-02 00:31:40 +00:00
|
|
|
}
|
2018-03-16 13:10:22 +00:00
|
|
|
bool UsingUberShaders() const;
|
2017-06-13 10:07:09 +00:00
|
|
|
u32 GetShaderCompilerThreads() const;
|
2017-07-27 03:15:38 +00:00
|
|
|
u32 GetShaderPrecompilerThreads() const;
|
2008-10-22 21:23:40 +00:00
|
|
|
};
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-09-13 10:18:01 +00:00
|
|
|
extern VideoConfig g_Config;
|
|
|
|
extern VideoConfig g_ActiveConfig;
|
2009-09-13 08:21:35 +00:00
|
|
|
|
|
|
|
// Called every frame.
|
|
|
|
void UpdateActiveConfig();
|
2023-01-29 16:06:25 +00:00
|
|
|
void CheckForConfigChanges();
|