From d3aace98ac4a52cf13fbd677de0639e17ea5a9ff Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 27 Mar 2022 12:58:05 +1000 Subject: [PATCH] GS/OpenGL: Fix fb target conflict without fbfetch --- pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp | 11 +++-------- pcsx2/GS/Renderers/OpenGL/GSTextureOGL.h | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp index 42253c3d4a..ee4152a25e 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp @@ -1653,14 +1653,9 @@ void GSDeviceOGL::OMAttachDs(GSTextureOGL* ds) if (GLState::ds != id) { GLState::ds = id; - if (ds && ds->IsDss()) - { - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, id, 0); - } - else - { - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, id, 0); - } + + const GLenum target = GLLoader::found_framebuffer_fetch ? GL_DEPTH_ATTACHMENT : GL_DEPTH_STENCIL_ATTACHMENT; + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, target, GL_TEXTURE_2D, id, 0); } } diff --git a/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.h b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.h index b05226075e..81e10d6ac7 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.h +++ b/pcsx2/GS/Renderers/OpenGL/GSTextureOGL.h @@ -71,7 +71,6 @@ public: void Swap(GSTexture* tex) final; GSMap Read(const GSVector4i& r, AlignedBuffer& buffer); - bool IsDss() { return (m_type == Type::DepthStencil || m_type == Type::SparseDepthStencil) && !GLLoader::found_framebuffer_fetch; } bool IsDepth() { return (m_type == Type::DepthStencil || m_type == Type::SparseDepthStencil); } bool IsIntegerFormat() const {