[MG_Pipe, MG_Remote, MG_Test, MG_IntegrationTest] (P7): accept empty texture levels in the respecify extent carrier

This commit is contained in:
2026-09-23 13:44:37 -04:00
parent 38ac5dbd2d
commit 10c5168be2
6 changed files with 252 additions and 8 deletions
+8 -3
View File
@@ -428,10 +428,15 @@ namespace MobileGL::MG_Pipe {
inline constexpr Uint32 MGPipeRespecifiedDepthOf(const MGPResourceDesc& desc) {
return MGPipeRespecifyIsWholeResource(desc) ? 0u : static_cast<Uint32>(desc.BufSize);
}
// A ZERO COMPONENT IS CANONICAL. glTexImage1D(width 0), glTexImage2D(0 x 0) and friends are
// legal GL that define an EMPTY level - dEQP's resetStateGLCore issues exactly that for every
// texture target after every case - and the frontend reports the level's exact extent as
// e.g. {0, 1, 1}. Requiring nonzero components made that legal call a session Fatal on every
// split arm. The carrier's only noncanonical shape is a depth word past 32 bits; whether an
// extent is USABLE is the staged store's question (an empty level has no byte bound, so any
// resource_subdata against it is refused there).
inline constexpr Bool MGPipeRespecifiedExtentCarrierIsCanonical(const MGPResourceDesc& desc) {
return MGPipeRespecifyIsWholeResource(desc) ||
((desc.BufSize >> 32) == 0 && MGPipeRespecifiedWidthOf(desc) != 0 &&
MGPipeRespecifiedHeightOf(desc) != 0 && MGPipeRespecifiedDepthOf(desc) != 0);
return MGPipeRespecifyIsWholeResource(desc) || (desc.BufSize >> 32) == 0;
}
inline constexpr void MGPipeSetRespecifiedLevel(MGPResourceDesc& desc, Uint16 uploadTarget,
+1 -1
View File
@@ -2081,7 +2081,7 @@ namespace MobileGL::MG_Pipe {
if (!MGPipeRespecifyIsWholeResource(desc) &&
!MGPipeRespecifiedExtentCarrierIsCanonical(desc)) {
MGP_TRIP_WIRE_REPORT("MGPipe: Fatal{ProtocolCorruption, \"ResourceRespecify.ExtentCarrier\"} - "
"a named image level must carry nonzero width/height/depth with no high BufSize bits");
"a named image level's depth word must fit in 32 bits (no high BufSize bits)");
}
if (level == nullptr && desc.Target != static_cast<Uint8>(MGPipeResourceTarget::TexBuffer) &&
(desc.BufOffset != 0 || desc.BufSize != 0)) {