GS/HW: More AA1 fixes and optimizations.

Do not enable AA1 if we aren't drawing to the RT.
Check if RT is written for IsCoverageAlphaSupported().
This commit is contained in:
lightningterror
2026-04-26 13:05:39 +02:00
parent 27736ef47f
commit 226b4d25dc
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -5362,7 +5362,7 @@ void GSRendererHW::HandleProvokingVertexFirst()
}
}
void GSRendererHW::SetupIA(float target_scale, float sx, float sy, bool req_vert_backup)
void GSRendererHW::SetupIA(float target_scale, float sx, float sy, bool req_vert_backup, const bool no_rt)
{
GL_PUSH("HW: IA");
@@ -5376,6 +5376,7 @@ void GSRendererHW::SetupIA(float target_scale, float sx, float sy, bool req_vert
const bool unscale_pt_ln = !GSConfig.UserHacks_DisableSafeFeatures && (target_scale != 1.0f);
const GSDevice::FeatureSupport features = g_gs_device->Features();
const bool draw_aa1 = !no_rt && PRIM->AA1 && features.aa1;
pxAssert(VerifyIndices());
@@ -5419,7 +5420,7 @@ void GSRendererHW::SetupIA(float target_scale, float sx, float sy, bool req_vert
{
m_conf.topology = GSHWDrawConfig::Topology::Line;
m_conf.indices_per_prim = 2;
if (PRIM->AA1 && features.aa1)
if (draw_aa1)
{
// AA1 expansion uses a similar path as upscale expansion but it is used
// for both upscaling and native resolution drawing.
@@ -5487,7 +5488,7 @@ void GSRendererHW::SetupIA(float target_scale, float sx, float sy, bool req_vert
case GS_TRIANGLE_CLASS:
{
if (PRIM->AA1 && features.aa1)
if (draw_aa1)
{
GL_INS("HW: AA1 triangle expand.");
m_conf.vs.expand = GSHWDrawConfig::VSExpand::TriangleAA1;
@@ -8943,7 +8944,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
HandleProvokingVertexFirst();
SetupIA(rtscale, vs_scale_x, vs_scale_y, m_channel_shuffle_width != 0);
SetupIA(rtscale, vs_scale_x, vs_scale_y, m_channel_shuffle_width != 0, no_rt);
if (m_conf.ds && m_conf.ps.IsFeedbackLoopDepth() && !g_gs_device->Features().depth_feedback)
{
@@ -10493,5 +10494,5 @@ std::size_t GSRendererHW::ComputeDrawlistGetSize(float scale)
bool GSRendererHW::IsCoverageAlphaSupported()
{
return IsCoverageAlpha() && g_gs_device->Features().aa1;
return IsCoverageAlpha() && IsRTWritten() && g_gs_device->Features().aa1;
}
+1 -1
View File
@@ -210,7 +210,7 @@ private:
void ResetStates();
void HandleProvokingVertexFirst();
void SetupIA(float target_scale, float sx, float sy, bool req_vert_backup);
void SetupIA(float target_scale, float sx, float sy, bool req_vert_backup, const bool no_rt);
void EmulateTextureShuffleAndFbmask(GSTextureCache::Target* rt, GSTextureCache::Source* tex);
u32 EmulateChannelShuffle(GSTextureCache::Target* src, bool test_only, GSTextureCache::Target* rt = nullptr);
void EmulateBlending(int rt_alpha_min, int rt_alpha_max, DATEOptions& date_options, GSTextureCache::Target* rt,