From 0f64af8f55d2942c240c14c8de2cc24a3575414a Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Wed, 23 Sep 2026 11:19:57 -0400 Subject: [PATCH] [MG_Remote, MG_Test] (P7): state banded reads against PH-3's tight-answer bound, not DstSize equality --- MobileGL/MG_Remote/Client/EmitTables.cpp | 8 ++++---- MobileGL/MG_Remote/Client/EmitTables.h | 4 ++-- MobileGL/MG_Test/Wire/RemoteClientTest.cpp | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/MobileGL/MG_Remote/Client/EmitTables.cpp b/MobileGL/MG_Remote/Client/EmitTables.cpp index 82a27900..fc14e81a 100644 --- a/MobileGL/MG_Remote/Client/EmitTables.cpp +++ b/MobileGL/MG_Remote/Client/EmitTables.cpp @@ -947,10 +947,10 @@ namespace MobileGL::MG_Remote::Client { // KHR-GL46.direct_state_access.renderbuffers_storage reads 256x512 RGBA/FLOAT = // 2,097,152 bytes, sixteen over MaxReplyBytes, and that used to be // Fatal{ReplyTooLarge} on every split arm while the monolith passed. Each band below - // is an ordinary read_pixels record - its own box, its own TIGHT DstSize - so every - // answer still fits one slot (ID-47) and the server's PH-3 bound (`tight == DstSize - // <= LinkTerms.maxReplyBytes`, PipeApplier.cpp OnReadPixels) holds unchanged: no - // reply is chunked, the READ is. The cap is the link's own, read live, exactly as + // is an ordinary read_pixels record - its own box, and a DstSize that IS its tight + // w*h*bpp extent (ID-49) - so every answer still fits one slot (ID-47) and the + // server's PH-3 bound (its tight answer against its own LinkTerms.maxReplyBytes, + // PipeApplier.cpp OnReadPixels) holds unchanged: no reply is chunked, the READ is. The cap is the link's own, read live, exactly as // before, so a different SEG_REPLY geometry or a stream link needs no edit here. ReadbackBandPlan plan; if (!PlanReadbackBands(static_cast(width), static_cast(height), diff --git a/MobileGL/MG_Remote/Client/EmitTables.h b/MobileGL/MG_Remote/Client/EmitTables.h index 950d894a..8c902939 100644 --- a/MobileGL/MG_Remote/Client/EmitTables.h +++ b/MobileGL/MG_Remote/Client/EmitTables.h @@ -149,8 +149,8 @@ namespace MobileGL::MG_Remote::Client { // P7 gate 5 (g5-readback). A glReadPixels whose tight answer is larger than one reply slot // is NOT one record: the client splits the w*h rectangle into BANDS, emits each band as an // ordinary read_pixels record with its own box and its own tight DstSize (so every answer - // still fits one slot, ID-47, and the server's PH-3 bound `tight == DstSize <= maxReplyBytes` - // holds unchanged), and scatters each band into the application's destination under its + // still fits one slot, ID-47, and the server's PH-3 bound - its tight answer against its own + // LinkTerms.maxReplyBytes - holds unchanged), and scatters each band into the application's destination under its // own GL_PACK_* state. No reply is chunked; the READ is. // // THE SHAPE. Whole-width row bands of floor(maxReplyBytes / rowBytes) rows when a row fits diff --git a/MobileGL/MG_Test/Wire/RemoteClientTest.cpp b/MobileGL/MG_Test/Wire/RemoteClientTest.cpp index c81e4451..347e0d06 100644 --- a/MobileGL/MG_Test/Wire/RemoteClientTest.cpp +++ b/MobileGL/MG_Test/Wire/RemoteClientTest.cpp @@ -1246,7 +1246,8 @@ TEST(RemoteReadback, TheCtsReadOfExactlyTwoMiBIsTwoBandsThatEachFitASlot) { // KHR-GL46.direct_state_access.renderbuffers_storage's own read: 256x512 RGBA/FLOAT is // 2,097,152 bytes against ID-47's 2,097,136. It used to be Fatal{ReplyTooLarge}; it is now two // records - 511 rows (2,093,056 bytes) and the single top row - and BOTH are answers one slot - // holds, so the server's PH-3 bound (tight == DstSize <= maxReplyBytes) is met per record. + // holds, and each record's DstSize is its own tight extent, so the server's PH-3 bound (its + // tight answer against its own maxReplyBytes) is met per record. constexpr Uint64 kCap = 2u * 1024u * 1024u - 16u; const Uint64 bpp = 16; ASSERT_EQ(TightReadbackByteCount(256, 512, 0x1908 /*RGBA*/, 0x1406 /*FLOAT*/), 2097152u);