From 5d5aeab1fbc71d2d775f66e611db5bc4fa22ec05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Franch?= Date: Thu, 15 Oct 2026 11:16:56 +0200 Subject: [PATCH] fix(agc): a queued draw's writes include its color targets' CMASK Co-Authored-By: Claude --- .../Execution/src/Driver/Memory/WrittenBuffers.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp index 5da9b3dac8..7115bcabf5 100644 --- a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp +++ b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp @@ -98,12 +98,14 @@ std::vector> DrawWriteRanges(const Graph const auto bytes = static_cast(color.bytes) * slices; add(color.address, bytes); add(color.dccAddress, (bytes + 255) / 256); + add(color.cmaskAddress, static_cast(color.cmaskBytes) * slices); return; } const std::uint64_t bytes = color.bytes != 0 ? static_cast(color.bytes) : UnknownBytes; const auto base = color.surfaceAddress != 0 ? std::min(color.surfaceAddress, color.address) : color.address; if (base != 0) ranges.emplace_back(base, color.address + 2 * bytes + Slack); add(color.dccAddress, bytes / 16 + Slack); + add(color.cmaskAddress, static_cast(color.cmaskBytes) * std::max(color.depth, 1)); }; if (graphics.hasColorTarget) addColor(graphics.color); for (const auto& color : graphics.colors) addColor(color);