From 5f29374d5bed7d9d32d286de057d9530beafa6e6 Mon Sep 17 00:00:00 2001 From: nmzik Date: Mon, 19 Oct 2026 05:17:32 +0200 Subject: [PATCH] gpu: approximate PPSA24156 EQAA with 2x MSAA and warn once --- src/graphics/host_gpu/renderer/colorRenderTarget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/graphics/host_gpu/renderer/colorRenderTarget.cpp b/src/graphics/host_gpu/renderer/colorRenderTarget.cpp index e45c18e52..7a9dcee01 100644 --- a/src/graphics/host_gpu/renderer/colorRenderTarget.cpp +++ b/src/graphics/host_gpu/renderer/colorRenderTarget.cpp @@ -72,7 +72,16 @@ void RenderExecutor::ResolveRenderColorTarget(CommandBuffer& buffer, RenderColor return; } const auto samples = render_sample_count(rt.attrib.num_fragments); - if (samples == 0 || rt.attrib.num_samples != rt.attrib.num_fragments) { + // TODO(PPSA24156): Replace this 2x MSAA approximation with proper 4-coverage/2-fragment EQAA. + const bool approximate_eqaa = rt.attrib.num_samples == 2 && rt.attrib.num_fragments == 1; + if (approximate_eqaa) { + static std::atomic_bool logged = false; + if (!logged.exchange(true, std::memory_order_relaxed)) { + Log::WriteToConsoleAndLog( + "Warning: approximating 4-coverage/2-fragment EQAA with 2x MSAA.\n"); + } + } + if (samples == 0 || (rt.attrib.num_samples != rt.attrib.num_fragments && !approximate_eqaa)) { EXIT("unsupported render-target sample configuration: samples=%u fragments=%u\n", rt.attrib.num_samples, rt.attrib.num_fragments); }