summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2023-01-28 16:23:30 +1300
committerScott Mansell <phiren@gmail.com>2023-01-31 19:41:24 +1300
commitf158ff300b72cff5ca1e2e62bc239111987188af (patch)
tree0ba518f48f8f2e0ac0c0ea2775c69a071cec2056 /Source
parent26e00c3bb4957ce9d26415e415d0b137742844bc (diff)
Handle VideoSoftware's present fallback better
Not a good idea to abuse bSupportsPostProcessing
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/VideoBackends/Null/NullGfx.cpp5
-rw-r--r--Source/Core/VideoBackends/Null/NullGfx.h1
-rw-r--r--Source/Core/VideoBackends/Software/SWGfx.cpp5
-rw-r--r--Source/Core/VideoBackends/Software/SWGfx.h1
-rw-r--r--Source/Core/VideoCommon/AbstractGfx.h3
-rw-r--r--Source/Core/VideoCommon/Present.cpp14
6 files changed, 23 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Null/NullGfx.cpp b/Source/Core/VideoBackends/Null/NullGfx.cpp
index ce8da5ff06..7449aae09c 100644
--- a/Source/Core/VideoBackends/Null/NullGfx.cpp
+++ b/Source/Core/VideoBackends/Null/NullGfx.cpp
@@ -29,6 +29,11 @@ bool NullGfx::IsHeadless() const
return true;
}
+bool NullGfx::SupportsUtilityDrawing() const
+{
+ return false;
+}
+
std::unique_ptr<AbstractTexture> NullGfx::CreateTexture(const TextureConfig& config,
[[maybe_unused]] std::string_view name)
{
diff --git a/Source/Core/VideoBackends/Null/NullGfx.h b/Source/Core/VideoBackends/Null/NullGfx.h
index 5afb3995b8..b1dff2bc2f 100644
--- a/Source/Core/VideoBackends/Null/NullGfx.h
+++ b/Source/Core/VideoBackends/Null/NullGfx.h
@@ -15,6 +15,7 @@ public:
~NullGfx() override;
bool IsHeadless() const override;
+ virtual bool SupportsUtilityDrawing() const override;
std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config,
std::string_view name) override;
diff --git a/Source/Core/VideoBackends/Software/SWGfx.cpp b/Source/Core/VideoBackends/Software/SWGfx.cpp
index b53b7ae89a..7e8c234540 100644
--- a/Source/Core/VideoBackends/Software/SWGfx.cpp
+++ b/Source/Core/VideoBackends/Software/SWGfx.cpp
@@ -27,6 +27,11 @@ bool SWGfx::IsHeadless() const
return m_window->IsHeadless();
}
+bool SWGfx::SupportsUtilityDrawing() const
+{
+ return false;
+}
+
std::unique_ptr<AbstractTexture> SWGfx::CreateTexture(const TextureConfig& config,
[[maybe_unused]] std::string_view name)
{
diff --git a/Source/Core/VideoBackends/Software/SWGfx.h b/Source/Core/VideoBackends/Software/SWGfx.h
index 48015fda25..1337d89525 100644
--- a/Source/Core/VideoBackends/Software/SWGfx.h
+++ b/Source/Core/VideoBackends/Software/SWGfx.h
@@ -15,6 +15,7 @@ public:
SWGfx(std::unique_ptr<SWOGLWindow> window);
bool IsHeadless() const override;
+ virtual bool SupportsUtilityDrawing() const override;
std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config,
std::string_view name) override;
diff --git a/Source/Core/VideoCommon/AbstractGfx.h b/Source/Core/VideoCommon/AbstractGfx.h
index eb5944fc84..d34690ec01 100644
--- a/Source/Core/VideoCommon/AbstractGfx.h
+++ b/Source/Core/VideoCommon/AbstractGfx.h
@@ -59,6 +59,9 @@ public:
virtual bool IsHeadless() const = 0;
+ // Does the backend support drawing a UI or doing post-processing
+ virtual bool SupportsUtilityDrawing() const { return true; }
+
virtual void SetPipeline(const AbstractPipeline* pipeline) {}
virtual void SetScissorRect(const MathUtil::Rectangle<int>& rc) {}
virtual void SetTexture(u32 index, const AbstractTexture* texture) {}
diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp
index 8f10707d0d..a89b41b1dd 100644
--- a/Source/Core/VideoCommon/Present.cpp
+++ b/Source/Core/VideoCommon/Present.cpp
@@ -393,12 +393,6 @@ void Presenter::RenderXFBToScreen(const MathUtil::Rectangle<int>& target_rc,
const AbstractTexture* source_texture,
const MathUtil::Rectangle<int>& source_rc)
{
- if (!g_ActiveConfig.backend_info.bSupportsPostProcessing)
- {
- g_gfx->ShowImage(source_texture, source_rc);
- return;
- }
-
if (g_ActiveConfig.stereo_mode == StereoMode::QuadBuffer &&
g_ActiveConfig.backend_info.bUsesExplictQuadBuffering)
{
@@ -463,6 +457,14 @@ void Presenter::Present()
{
m_last_xfb_id = m_xfb_entry->id;
+ if (!g_gfx->SupportsUtilityDrawing())
+ {
+ // Video Software doesn't support Drawing a UI or doing post-processing
+ // So just Show the XFB
+ g_gfx->ShowImage(m_xfb_entry->texture.get(), m_xfb_rect);
+ return;
+ }
+
// Since we use the common pipelines here and draw vertices if a batch is currently being
// built by the vertex loader, we end up trampling over its pointer, as we share the buffer
// with the loader, and it has not been unmapped yet. Force a pipeline flush to avoid this.