[MG_IntegrationTest] (P7): the window leg of the flipped multisample resolve case primes the default framebuffer with values no other surface in the test holds

- review round 4 should-fix: round 3 primed the window blue at depth 0.5, the same colour and depth the user framebuffer `resolved.fbo` was primed with and still held after its own declined blit, so a glBindFramebuffer(GL_FRAMEBUFFER, 0) that landed on the user framebuffer, or a default-framebuffer readback that resolved the wrong surface, read the priming it was meant to reject and the leg passed vacuously
- the window is now primed magenta at depth 0.625 - the user framebuffer is blue at 0.5, the source red/green at 0.25/0.75 - and the three probes expect exactly that
- shown once and restored: with the probes pointed at `resolved.fbo` instead of 0, all three arms (`DirectVulkan.{Split,Spawn,Tcp}.MsFlip.`) fail on both aspects at (1, 1): colour reads {0,0,255,255} against {255,0,255,255} ("must not have written its colour at (1, 1)"), depth reads 0.5 against 0.625 ("must have left its depth alone at (1, 1)"); under round 3's priming the same probes on that surface were green
- test only; no backend source touched (G1 unaffected)
This commit is contained in:
2026-09-22 22:03:23 -04:00
parent c8fc4fb712
commit e385ea96c8
@@ -621,11 +621,17 @@ namespace MGITest {
// a scaled COLOR|DEPTH resolve onto the window scaled and wrote its colour through the
// swapchain blit and then recorded INVALID_OPERATION on its depth: the partial effect
// the previous leg pins for a user framebuffer, reproduced on the only other kind of
// destination there is. The window is primed blue at depth 0.5, the source (red below,
// green above) is blown up over the whole of it, and three probes - a corner, the
// centre, the far corner - must all still read the priming on both aspects. The
// harness's pbuffer default framebuffer has no other way of being looked at than
// glReadPixels, which is what both probes use.
// destination there is. The window is primed MAGENTA at depth 0.625 - values no other
// surface in this test holds (review round 4): the user framebuffer above is blue at 0.5
// and still is after its own declined blit, and the source is red/green at 0.25/0.75.
// Round 3 primed the window blue at 0.5 as well, so a glBindFramebuffer(0) that landed
// on the user framebuffer, or a default-framebuffer readback that resolved the wrong
// surface, read the same priming and passed for nothing; pointing the probes at the
// user framebuffer now fails on both aspects, shown once and restored. The source (red
// below, green above) is blown up over the whole of the window, and three probes - a
// corner, the centre, the far corner - must all still read the priming on both
// aspects. The harness's pbuffer default framebuffer has no other way of being looked
// at than glReadPixels, which is what both probes use.
{
HeadlessGL& gl = Gl();
const int windowWidth = gl.Width();
@@ -637,8 +643,8 @@ namespace MGITest {
glViewport(0, 0, windowWidth, windowHeight);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);
glClearColor(0, 0, 1, 1);
glClearDepth(0.5);
glClearColor(1, 0, 1, 1);
glClearDepth(0.625);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
ASSERT_EQ(FirstGLError(), 0u) << "priming the default framebuffer";
glBindFramebuffer(GL_READ_FRAMEBUFFER, multisampled.fbo);
@@ -655,12 +661,12 @@ namespace MGITest {
const int x = probeX[i], y = probeY[i];
std::array<GLubyte, 4> window{};
glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, window.data());
EXPECT_EQ(window, (std::array<GLubyte, 4>{0, 0, 255, 255}))
EXPECT_EQ(window, (std::array<GLubyte, 4>{255, 0, 255, 255}))
<< "the declined COLOR|DEPTH scale onto the window must not have written its colour at ("
<< x << ", " << y << ")";
float depth = kDepthPoison;
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
EXPECT_NEAR(depth, 0.5f, 1.0f / 4096.0f)
EXPECT_NEAR(depth, 0.625f, 1.0f / 4096.0f)
<< "the declined COLOR|DEPTH scale onto the window must have left its depth alone at ("
<< x << ", " << y << ")";
}