summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BoundingBox.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2023-02-09 19:59:16 +1300
committerGitHub <noreply@github.com>2023-02-09 19:59:16 +1300
commitccf92a3e56764d6378c436a8040519a5bffc3372 (patch)
treee2b330b225044e1901e77a6ed147cf21b9d7ac0e /Source/Core/VideoCommon/BoundingBox.cpp
parent72b22ef0a54f841b1c52d49cf0e00d3b12c29ac7 (diff)
parent5c1b3ac61d7e660a9d1c206dbd0e615d637d3272 (diff)
Merge pull request #11522 from phire/KillRendererWithFire
Kill Renderer (with phire)
Diffstat (limited to 'Source/Core/VideoCommon/BoundingBox.cpp')
-rw-r--r--Source/Core/VideoCommon/BoundingBox.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/BoundingBox.cpp b/Source/Core/VideoCommon/BoundingBox.cpp
index af0961aab6..ffc85d824c 100644
--- a/Source/Core/VideoCommon/BoundingBox.cpp
+++ b/Source/Core/VideoCommon/BoundingBox.cpp
@@ -13,6 +13,8 @@
#include <algorithm>
+std::unique_ptr<BoundingBox> g_bounding_box;
+
void BoundingBox::Enable(PixelShaderManager& pixel_shader_manager)
{
m_is_active = true;
@@ -27,7 +29,7 @@ void BoundingBox::Disable(PixelShaderManager& pixel_shader_manager)
void BoundingBox::Flush()
{
- if (!g_ActiveConfig.backend_info.bSupportsBBox)
+ if (!g_ActiveConfig.bBBoxEnable || !g_ActiveConfig.backend_info.bSupportsBBox)
return;
m_is_valid = false;
@@ -74,6 +76,9 @@ u16 BoundingBox::Get(u32 index)
{
ASSERT(index < NUM_BBOX_VALUES);
+ if (!g_ActiveConfig.bBBoxEnable || !g_ActiveConfig.backend_info.bSupportsBBox)
+ return m_bounding_box_fallback[index];
+
if (!m_is_valid)
Readback();
@@ -84,6 +89,12 @@ void BoundingBox::Set(u32 index, u16 value)
{
ASSERT(index < NUM_BBOX_VALUES);
+ if (!g_ActiveConfig.bBBoxEnable || !g_ActiveConfig.backend_info.bSupportsBBox)
+ {
+ m_bounding_box_fallback[index] = value;
+ return;
+ }
+
if (m_is_valid && m_values[index] == value)
return;
@@ -96,6 +107,7 @@ void BoundingBox::Set(u32 index, u16 value)
// Nonetheless, it has been designed to be as safe as possible.
void BoundingBox::DoState(PointerWrap& p)
{
+ p.DoArray(m_bounding_box_fallback);
p.Do(m_is_active);
p.DoArray(m_values);
p.DoArray(m_dirty);