From ede25a5eccbf72baa2cf248dcc29f30a9b8fdbaf Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Sat, 31 Jan 2026 05:45:51 +0100 Subject: [PATCH] GS/DX11: Check if RGBA16 UNORM supports hw blending. If not then use DXGI_FORMAT_R16G16B16A16_FLOAT, it will be less precise but will still work on feature level 10.0 and some 10.1 gpus and allow for hardware blending. --- pcsx2/GS/Renderers/DX11/GSDevice11.cpp | 12 +++++++++++- pcsx2/GS/Renderers/DX11/GSDevice11.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp index c95d41a3d2..35c9938b99 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp @@ -38,6 +38,15 @@ static bool SupportsTextureFormat(ID3D11Device* dev, DXGI_FORMAT format) return (support & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0; } +static bool IsTextureFormatHWBlendable(ID3D11Device* dev, DXGI_FORMAT format) +{ + UINT support; + if (FAILED(dev->CheckFormatSupport(format, &support))) + return false; + + return (support & D3D11_FORMAT_SUPPORT_RENDER_TARGET) && (support & D3D11_FORMAT_SUPPORT_BLENDABLE); +} + GSDevice11::GSDevice11() { memset(&m_state, 0, sizeof(m_state)); @@ -601,6 +610,7 @@ void GSDevice11::SetFeatures(IDXGIAdapter1* adapter) D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION; m_conservative_depth = (m_feature_level >= D3D_FEATURE_LEVEL_11_0); + m_rgba16_unorm_hw_blend = IsTextureFormatHWBlendable(m_dev.get(), DXGI_FORMAT_R16G16B16A16_UNORM); } bool GSDevice11::HasSurface() const @@ -2624,7 +2634,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config) { config.colclip_update_area = config.drawarea; - colclip_rt = CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::ColorClip, false); + colclip_rt = CreateRenderTarget(rtsize.x, rtsize.y, m_rgba16_unorm_hw_blend ? GSTexture::Format::ColorClip : GSTexture::Format::ColorHDR, false); if (!colclip_rt) { Console.Warning("D3D11: Failed to allocate ColorClip render target, aborting draw."); diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.h b/pcsx2/GS/Renderers/DX11/GSDevice11.h index f25e8482c7..58985acafe 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.h +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.h @@ -137,6 +137,7 @@ private: bool m_using_allow_tearing = false; bool m_is_exclusive_fullscreen = false; bool m_conservative_depth = false; + bool m_rgba16_unorm_hw_blend = false; struct {