From de940a5fd6a07728c51d53ebdab7489aa03cdb55 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Sun, 5 Mar 2017 15:17:54 -0800 Subject: VideoConfig: add bSupportsFragmentStoresAndAtomics --- Source/Core/VideoCommon/PixelShaderGen.cpp | 1 + Source/Core/VideoCommon/VideoConfig.h | 1 + 2 files changed, 2 insertions(+) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 608248fab8..6360a68a37 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -172,6 +172,7 @@ PixelShaderUid GetPixelShaderUid() uid_data->genMode_numtexgens = bpmem.genMode.numtexgens; uid_data->per_pixel_lighting = g_ActiveConfig.bEnablePixelLighting; uid_data->bounding_box = g_ActiveConfig.backend_info.bSupportsBBox && + g_ActiveConfig.backend_info.bSupportsFragmentStoresAndAtomics && 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.h b/Source/Core/VideoCommon/VideoConfig.h index ec79e6de48..b8e348157d 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -189,6 +189,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; -- cgit v1.2.3 From 134317e07f7c371000389e7c3f45ceaf046eea69 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Fri, 10 Mar 2017 00:07:49 -0800 Subject: videoconfig: add BBoxPreferStencilImplementation @JMC47 requested this to be able to do performance comparisons. --- Source/Core/VideoCommon/PixelShaderGen.cpp | 3 +-- Source/Core/VideoCommon/VideoConfig.cpp | 2 ++ Source/Core/VideoCommon/VideoConfig.h | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 6360a68a37..9eb0d625cb 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -171,8 +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 && - g_ActiveConfig.backend_info.bSupportsFragmentStoresAndAtomics && + 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 b8e348157d..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; @@ -203,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; -- cgit v1.2.3