summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-03-16 21:39:17 +0100
committerGitHub <noreply@github.com>2017-03-16 21:39:17 +0100
commita0acdfc070d5bed422d3cdafd7675fc28af4eed5 (patch)
tree0edd5873022cafad1caf3c9588ae6fda8e201d75 /Source/Core/VideoCommon
parentb2ab713ad93f8734fc65e104f4dc6c1c9a3e9411 (diff)
parent134317e07f7c371000389e7c3f45ceaf046eea69 (diff)
Merge pull request #5029 from ligfx/bboximagemask
OGL: implement Bounding Box on systems w/o SSBO
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp2
-rw-r--r--Source/Core/VideoCommon/VideoConfig.cpp2
-rw-r--r--Source/Core/VideoCommon/VideoConfig.h8
3 files changed, 11 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 608248fab8..9eb0d625cb 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -171,7 +171,7 @@ PixelShaderUid GetPixelShaderUid()
uid_data->genMode_numtevstages = bpmem.genMode.numtevstages;
uid_data->genMode_numtexgens = bpmem.genMode.numtexgens;
uid_data->per_pixel_lighting = g_ActiveConfig.bEnablePixelLighting;
- uid_data->bounding_box = g_ActiveConfig.backend_info.bSupportsBBox &&
+ uid_data->bounding_box = g_ActiveConfig.BBoxUseFragmentShaderImplementation() &&
g_ActiveConfig.bBBoxEnable && BoundingBox::active;
uid_data->rgba6_format =
bpmem.zcontrol.pixel_format == PEControl::RGBA6_Z24 && !g_ActiveConfig.bForceTrueColor;
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp
index 2db2494a05..7579c90c6e 100644
--- a/Source/Core/VideoCommon/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/VideoConfig.cpp
@@ -119,6 +119,7 @@ void VideoConfig::Load(const std::string& ini_file)
IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true);
hacks->Get("BBoxEnable", &bBBoxEnable, false);
+ hacks->Get("BBoxPreferStencilImplementation", &bBBoxPreferStencilImplementation, false);
hacks->Get("ForceProgressive", &bForceProgressive, true);
hacks->Get("EFBToTextureEnable", &bSkipEFBCopyToRam, true);
hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true);
@@ -342,6 +343,7 @@ void VideoConfig::Save(const std::string& ini_file)
IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
hacks->Set("EFBAccessEnable", bEFBAccessEnable);
hacks->Set("BBoxEnable", bBBoxEnable);
+ hacks->Set("BBoxPreferStencilImplementation", bBBoxPreferStencilImplementation);
hacks->Set("ForceProgressive", bForceProgressive);
hacks->Set("EFBToTextureEnable", bSkipEFBCopyToRam);
hacks->Set("EFBScaledCopy", bCopyEFBScaled);
diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h
index ec79e6de48..a3a44f2ec7 100644
--- a/Source/Core/VideoCommon/VideoConfig.h
+++ b/Source/Core/VideoCommon/VideoConfig.h
@@ -114,6 +114,7 @@ struct VideoConfig final
bool bEFBAccessEnable;
bool bPerfQueriesEnable;
bool bBBoxEnable;
+ bool bBBoxPreferStencilImplementation; // OpenGL-only, to see how slow it is compared to SSBOs
bool bForceProgressive;
bool bEFBEmulateFormatChanges;
@@ -189,6 +190,7 @@ struct VideoConfig final
bool bSupportsPaletteConversion;
bool bSupportsClipControl; // Needed by VertexShaderGen, so must stay in VideoCommon
bool bSupportsSSAA;
+ bool bSupportsFragmentStoresAndAtomics; // a.k.a. OpenGL SSBOs a.k.a. Direct3D UAVs
bool bSupportsDepthClamp; // Needed by VertexShaderGen, so must stay in VideoCommon
bool bSupportsReversedDepthRange;
bool bSupportsMultithreading;
@@ -202,6 +204,12 @@ struct VideoConfig final
{
return backend_info.bSupportsExclusiveFullscreen && !bBorderlessFullscreen;
}
+ bool BBoxUseFragmentShaderImplementation() const
+ {
+ if (backend_info.api_type == APIType::OpenGL && bBBoxPreferStencilImplementation)
+ return false;
+ return backend_info.bSupportsBBox && backend_info.bSupportsFragmentStoresAndAtomics;
+ }
};
extern VideoConfig g_Config;