From 1b7010203b385c9fbad60b41eefa76e9158aaa9e Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sun, 20 Sep 2026 00:03:10 -0400 Subject: [PATCH] [MG_Test] (Disaggregated): P5f fs - prove virtual default XFB objects get distinct native twins --- .../Backend/DirectGLES/ContextEpochTest.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/MobileGL/MG_Test/Backend/DirectGLES/ContextEpochTest.cpp b/MobileGL/MG_Test/Backend/DirectGLES/ContextEpochTest.cpp index 7419f0fe..2bca9fdd 100644 --- a/MobileGL/MG_Test/Backend/DirectGLES/ContextEpochTest.cpp +++ b/MobileGL/MG_Test/Backend/DirectGLES/ContextEpochTest.cpp @@ -104,20 +104,29 @@ TEST(ContextEpochTest, SameXfbNameInTwoServedContextsDoesNotAliasThePausedSpan) DriverScope scope; auto& state = MG_Pipe::MGPipeApplier(); const auto saved = state.BoundStreamOutputLifetimeId; - state.BoundStreamOutputLifetimeId = 101; - XfbImpl::BindTransformFeedback(1); + auto firstContext = MakeUnique(); + auto secondContext = MakeUnique(); + const Uint64 firstLifetime = firstContext->GetBoundTransformFeedbackLifetimeId(); + const Uint64 secondLifetime = secondContext->GetBoundTransformFeedbackLifetimeId(); + ASSERT_NE(firstLifetime, 0u); + ASSERT_NE(secondLifetime, 0u); + ASSERT_NE(firstLifetime, secondLifetime); + state.BoundStreamOutputLifetimeId = firstLifetime; + XfbImpl::BindTransformFeedback(0); const Uint first = boundXfb; + EXPECT_NE(first, 0u) << "virtual name 0 needs its own native object"; XfbImpl::BeginTransformFeedback(GL_POINTS); EXPECT_TRUE(XfbImpl::IsCaptureSpanOpen()); XfbImpl::PauseTransformFeedback(); EXPECT_FALSE(XfbImpl::IsCaptureSpanOpen()); - state.BoundStreamOutputLifetimeId = 202; - XfbImpl::BindTransformFeedback(1); + state.BoundStreamOutputLifetimeId = secondLifetime; + XfbImpl::BindTransformFeedback(0); + EXPECT_NE(boundXfb, 0u); EXPECT_NE(first, boundXfb) << "the GL name was mistaken for cross-context identity"; EXPECT_FALSE(XfbImpl::IsCaptureSpanOpen()); XfbImpl::BeginTransformFeedback(GL_POINTS); EXPECT_TRUE(XfbImpl::IsCaptureSpanOpen()); - state.BoundStreamOutputLifetimeId = 101; + state.BoundStreamOutputLifetimeId = firstLifetime; EXPECT_FALSE(XfbImpl::IsCaptureSpanOpen()) << "returning to the paused object inherited another context's span"; EXPECT_EQ(boundXfb, first); XfbImpl::ResumeTransformFeedback();