From 780303049be5a52894f2cf1df476c2d641cd8eab Mon Sep 17 00:00:00 2001 From: Daan Dehing Date: Sun, 11 Oct 2026 19:39:47 +0200 Subject: [PATCH] test(agc): cover indexed rect-list draws with a partial last rectangle Co-Authored-By: Claude Opus 5.5 --- core/libs/prx/libSceAgcDriver/tests/Graphics.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp index 2d73e4a33..e03e6e2e6 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp @@ -3025,8 +3025,9 @@ void rectListTests() { queue.userConfig[0x242] = 17; const auto state = DecodeState(queue); const Context context{}; - const auto drawFailure = [&](std::uint32_t count) { - const AgcDriver::Pm4::DrawParameters draw{0, count, 0, 1, 0, false}; + std::array indices{}; + const auto drawFailure = [&](std::uint32_t count, bool indexed) { + const AgcDriver::Pm4::DrawParameters draw = indexed ? AgcDriver::Pm4::DrawParameters{reinterpret_cast(indices.data()), count, 2, 1, 0, true} : AgcDriver::Pm4::DrawParameters{0, count, 0, 1, 0, false}; try { Draw(context, state, draw, {}); } catch (const std::exception& error) { @@ -3034,8 +3035,10 @@ void rectListTests() { } return std::string{}; }; - const auto complete = drawFailure(3); - for (const auto count : {4u, 5u}) Require(drawFailure(count) == complete, "a rect-list draw with a partial last rectangle was not drawn like its complete rectangles"); + for (const auto indexed : {false, true}) { + const auto complete = drawFailure(3, indexed); + for (const auto count : {4u, 5u}) Require(drawFailure(count, indexed) == complete, "a rect-list draw with a partial last rectangle was not drawn like its complete rectangles"); + } } ShaderRecompiler::RecompileResult recompilePixel(std::initializer_list controls, std::span code) {