2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:09:55 -06:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2009-09-13 02:21:35 -06: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
|
2013-10-28 23:23:17 -06:00
|
|
|
// at the start of every frame. Noone should ever change members of g_ActiveConfig
|
2009-09-13 02:21:35 -06:00
|
|
|
// directly.
|
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2009-07-12 15:58:32 -06:00
|
|
|
#include <string>
|
2014-02-17 03:18:15 -07:00
|
|
|
#include <vector>
|
|
|
|
|
2014-09-07 19:06:58 -06:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "VideoCommon/VideoCommon.h"
|
2009-07-12 15:58:32 -06:00
|
|
|
|
2009-02-04 10:33:59 -07:00
|
|
|
// Log in two categories, and save three other options in the same byte
|
2016-06-24 02:43:46 -06:00
|
|
|
#define CONF_LOG 1
|
|
|
|
#define CONF_PRIMLOG 2
|
|
|
|
#define CONF_SAVETARGETS 8
|
|
|
|
#define CONF_SAVESHADERS 16
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-02-09 14:03:16 -07:00
|
|
|
enum AspectMode
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
ASPECT_AUTO = 0,
|
|
|
|
ASPECT_ANALOG_WIDE = 1,
|
|
|
|
ASPECT_ANALOG = 2,
|
|
|
|
ASPECT_STRETCH = 3,
|
2010-01-13 14:11:02 -07:00
|
|
|
};
|
|
|
|
|
2014-02-09 14:03:16 -07:00
|
|
|
enum EFBScale
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
SCALE_FORCE_INTEGRAL = -1,
|
|
|
|
SCALE_AUTO,
|
|
|
|
SCALE_AUTO_INTEGRAL,
|
|
|
|
SCALE_1X,
|
|
|
|
SCALE_1_5X,
|
|
|
|
SCALE_2X,
|
|
|
|
SCALE_2_5X,
|
2013-04-05 23:48:00 -06:00
|
|
|
};
|
|
|
|
|
2014-10-31 08:25:42 -06:00
|
|
|
enum StereoMode
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
STEREO_OFF = 0,
|
|
|
|
STEREO_SBS,
|
|
|
|
STEREO_TAB,
|
|
|
|
STEREO_ANAGLYPH,
|
|
|
|
STEREO_3DVISION
|
2014-10-31 08:25:42 -06:00
|
|
|
};
|
|
|
|
|
2009-02-28 09:33:59 -07:00
|
|
|
// NEVER inherit from this class.
|
2014-03-16 15:00:29 -06:00
|
|
|
struct VideoConfig final
|
2008-12-07 21:46:09 -07:00
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
VideoConfig();
|
|
|
|
void Load(const std::string& ini_file);
|
|
|
|
void GameIniLoad();
|
|
|
|
void VerifyValidity();
|
|
|
|
void Save(const std::string& ini_file);
|
|
|
|
void UpdateProjectionHack();
|
|
|
|
bool IsVSync();
|
|
|
|
|
|
|
|
// General
|
|
|
|
bool bVSync;
|
|
|
|
bool bRunning;
|
|
|
|
bool bWidescreenHack;
|
|
|
|
int iAspectRatio;
|
|
|
|
bool bCrop; // Aspect ratio controls.
|
|
|
|
bool bUseXFB;
|
|
|
|
bool bUseRealXFB;
|
|
|
|
|
|
|
|
// Enhancements
|
|
|
|
int iMultisamples;
|
|
|
|
bool bSSAA;
|
|
|
|
int iEFBScale;
|
|
|
|
bool bForceFiltering;
|
|
|
|
int iMaxAnisotropy;
|
|
|
|
std::string sPostProcessingShader;
|
2016-09-07 18:43:34 -06:00
|
|
|
bool bForceTrueColor;
|
2016-06-24 02:43:46 -06:00
|
|
|
|
|
|
|
// Information
|
|
|
|
bool bShowFPS;
|
2016-02-02 08:35:27 -07:00
|
|
|
bool bShowNetPlayPing;
|
|
|
|
bool bShowNetPlayMessages;
|
2016-06-24 02:43:46 -06:00
|
|
|
bool bOverlayStats;
|
|
|
|
bool bOverlayProjStats;
|
|
|
|
bool bTexFmtOverlayEnable;
|
|
|
|
bool bTexFmtOverlayCenter;
|
|
|
|
bool bLogRenderTimeToFile;
|
|
|
|
|
|
|
|
// Render
|
|
|
|
bool bWireFrame;
|
|
|
|
bool bDisableFog;
|
|
|
|
|
|
|
|
// Utility
|
|
|
|
bool bDumpTextures;
|
|
|
|
bool bHiresTextures;
|
|
|
|
bool bConvertHiresTextures;
|
|
|
|
bool bCacheHiresTextures;
|
|
|
|
bool bDumpEFBTarget;
|
2016-11-18 05:57:08 -07:00
|
|
|
bool bDumpFramesAsImages;
|
2016-06-24 02:43:46 -06:00
|
|
|
bool bUseFFV1;
|
2016-11-10 06:26:57 -07:00
|
|
|
bool bInternalResolutionFrameDumps;
|
2016-06-24 02:43:46 -06:00
|
|
|
bool bFreeLook;
|
|
|
|
bool bBorderlessFullscreen;
|
|
|
|
|
|
|
|
// Hacks
|
|
|
|
bool bEFBAccessEnable;
|
|
|
|
bool bPerfQueriesEnable;
|
|
|
|
bool bBBoxEnable;
|
|
|
|
bool bForceProgressive;
|
|
|
|
|
|
|
|
bool bEFBEmulateFormatChanges;
|
|
|
|
bool bSkipEFBCopyToRam;
|
|
|
|
bool bCopyEFBScaled;
|
|
|
|
int iSafeTextureCache_ColorSamples;
|
|
|
|
int iPhackvalue[3];
|
|
|
|
std::string sPhackvalue[2];
|
|
|
|
float fAspectRatioHackW, fAspectRatioHackH;
|
|
|
|
bool bEnablePixelLighting;
|
|
|
|
bool bFastDepthCalc;
|
|
|
|
int iLog; // CONF_ bits
|
|
|
|
int iSaveTargetId; // TODO: Should be dropped
|
|
|
|
|
|
|
|
// Stereoscopy
|
|
|
|
int iStereoMode;
|
|
|
|
int iStereoDepth;
|
|
|
|
int iStereoConvergence;
|
|
|
|
int iStereoConvergencePercentage;
|
|
|
|
bool bStereoSwapEyes;
|
|
|
|
bool bStereoEFBMonoDepth;
|
|
|
|
int iStereoDepthPercentage;
|
|
|
|
|
|
|
|
// D3D only config, mostly to be merged into the above
|
|
|
|
int iAdapter;
|
|
|
|
|
|
|
|
// VideoSW Debugging
|
|
|
|
int drawStart;
|
|
|
|
int drawEnd;
|
|
|
|
bool bZComploc;
|
|
|
|
bool bZFreeze;
|
|
|
|
bool bDumpObjects;
|
|
|
|
bool bDumpTevStages;
|
|
|
|
bool bDumpTevTextureFetches;
|
|
|
|
|
2016-08-13 06:08:46 -06:00
|
|
|
// Enable API validation layers, currently only supported with Vulkan.
|
|
|
|
bool bEnableValidationLayer;
|
|
|
|
|
|
|
|
// Multithreaded submission, currently only supported with Vulkan.
|
|
|
|
bool bBackendMultithreading;
|
|
|
|
|
2016-08-13 06:57:50 -06:00
|
|
|
// Early command buffer execution interval in number of draws.
|
|
|
|
// Currently only supported with Vulkan.
|
|
|
|
int iCommandBufferExecuteInterval;
|
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Static config per API
|
|
|
|
// TODO: Move this out of VideoConfig
|
|
|
|
struct
|
|
|
|
{
|
2016-07-21 17:04:57 -06:00
|
|
|
APIType api_type;
|
2016-06-24 02:43:46 -06:00
|
|
|
|
|
|
|
std::vector<std::string> Adapters; // for D3D
|
|
|
|
std::vector<int> AAModes;
|
|
|
|
std::vector<std::string> PPShaders; // post-processing shaders
|
|
|
|
std::vector<std::string> AnaglyphShaders; // anaglyph shaders
|
|
|
|
|
|
|
|
// TODO: merge AdapterName and Adapters array
|
|
|
|
std::string AdapterName; // for OpenGL
|
|
|
|
|
|
|
|
bool bSupportsExclusiveFullscreen;
|
|
|
|
bool bSupportsDualSourceBlend;
|
|
|
|
bool bSupportsPrimitiveRestart;
|
|
|
|
bool bSupportsOversizedViewports;
|
|
|
|
bool bSupportsGeometryShaders;
|
|
|
|
bool bSupports3DVision;
|
|
|
|
bool bSupportsEarlyZ; // needed by PixelShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsBindingLayout; // Needed by ShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsBBox;
|
|
|
|
bool bSupportsGSInstancing; // Needed by GeometryShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsPostProcessing;
|
|
|
|
bool bSupportsPaletteConversion;
|
|
|
|
bool bSupportsClipControl; // Needed by VertexShaderGen, so must stay in VideoCommon
|
|
|
|
bool bSupportsSSAA;
|
2016-08-12 05:55:35 -06:00
|
|
|
bool bSupportsDepthClamp; // Needed by VertexShaderGen, so must stay in VideoCommon
|
2016-08-21 09:47:24 -06:00
|
|
|
bool bSupportsReversedDepthRange;
|
2016-08-13 06:08:46 -06:00
|
|
|
bool bSupportsMultithreading;
|
2016-11-10 06:26:57 -07:00
|
|
|
bool bSupportsInternalResolutionFrameDumps;
|
2016-06-24 02:43:46 -06:00
|
|
|
} backend_info;
|
|
|
|
|
|
|
|
// Utility
|
|
|
|
bool RealXFBEnabled() const { return bUseXFB && bUseRealXFB; }
|
|
|
|
bool VirtualXFBEnabled() const { return bUseXFB && !bUseRealXFB; }
|
|
|
|
bool ExclusiveFullscreenEnabled() const
|
|
|
|
{
|
|
|
|
return backend_info.bSupportsExclusiveFullscreen && !bBorderlessFullscreen;
|
|
|
|
}
|
2008-12-07 21:46:09 -07:00
|
|
|
};
|
|
|
|
|
2009-09-13 04:18:01 -06:00
|
|
|
extern VideoConfig g_Config;
|
|
|
|
extern VideoConfig g_ActiveConfig;
|
2009-09-13 02:21:35 -06:00
|
|
|
|
|
|
|
// Called every frame.
|
|
|
|
void UpdateActiveConfig();
|