From 677922a9309e0f82bf84d2d142959b89fea2586e Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sun, 20 Sep 2026 12:49:50 -0400 Subject: [PATCH] [Tests] pin full texture staging extents beside scattered upload regions --- MobileGL/MG_Pipe/MGPipeTypes.h | 2 +- MobileGL/MG_Remote/Client/SlotCaps.h | 4 ++-- MobileGL/MG_Test/Pipe/TextureEmitTest.cpp | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MobileGL/MG_Pipe/MGPipeTypes.h b/MobileGL/MG_Pipe/MGPipeTypes.h index 6347fea4..fe97cb47 100644 --- a/MobileGL/MG_Pipe/MGPipeTypes.h +++ b/MobileGL/MG_Pipe/MGPipeTypes.h @@ -1266,7 +1266,7 @@ namespace MobileGL::MG_Pipe { // bytes an untransformed level shadow? Uint8 SourceIsVerbatimLevelShadow; // P5 (b1): DOES THIS RESOURCE HAVE A LIVE HOST WRITER RIGHT NOW? One byte out of the - // pad, so MGP_ASSERT_POD(MGPSubData, 72) below does not move. + // original pad; the complete mip extent below is a separate payload extension. // // It is here rather than on MGPResourceDesc, and that is a ruling with a reason. The // fact is CONTENT-shaped - "someone may be writing these bytes without telling you" - diff --git a/MobileGL/MG_Remote/Client/SlotCaps.h b/MobileGL/MG_Remote/Client/SlotCaps.h index 4a0894b7..7bf5f263 100644 --- a/MobileGL/MG_Remote/Client/SlotCaps.h +++ b/MobileGL/MG_Remote/Client/SlotCaps.h @@ -54,8 +54,8 @@ // Converted, because the fallback is right: // FenceSync used this fallback through P5. P5b ยง9 moved it to class B: the frontend // now calls the emitter and the server preserves the optional/native-null fallback. -// GL_Texture.cpp:6537 GetTextureImage -> the frontend's own CPU readback, which is exact -// GL_Texture.cpp:6799 GetTexImage -> the same +// GetTexImage/GetTextureImage now emit owned texture readback replies. Their +// split path must never use the frontend shadow after GPU writes. // GL_Getter.cpp x2 GetGpuTimestampNs and GL_Query.cpp's query probes now use their // timer/occlusion/primitive capability bits. An advertised path emits real query // records; only an unavailable native capability reports COUNTER_BITS 0. diff --git a/MobileGL/MG_Test/Pipe/TextureEmitTest.cpp b/MobileGL/MG_Test/Pipe/TextureEmitTest.cpp index 2d2f4160..8b5533cd 100644 --- a/MobileGL/MG_Test/Pipe/TextureEmitTest.cpp +++ b/MobileGL/MG_Test/Pipe/TextureEmitTest.cpp @@ -515,6 +515,10 @@ TEST(TextureEmit, AScatteredUploadCarriesTheLevelShadowsStridesAndNotZero) { IntVec3{2, 2, 1}); Textures().DrainTextureSubData(Ctx()); const Vector regions = Textures().LastRegions(); + const auto& record = Textures().LastSubData(); + EXPECT_EQ(record.LevelWidth, 256u); + EXPECT_EQ(record.LevelHeight, 256u); + EXPECT_EQ(record.LevelDepth, 1u); ASSERT_GE(regions.size(), 2u); // A SUB-RECT'S ROWS ARE NOT CONTIGUOUS IN THE SHADOW, so it must carry the LEVEL's pitches - // not its own width - or the staging planner on the far side repacks the wrong bytes.