[MG_Test] (Disaggregated): P5f fs - prove virtual default XFB objects get distinct native twins

This commit is contained in:
2026-09-20 00:03:10 -04:00
parent 5f7d5bf731
commit 1b7010203b
@@ -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<MG_State::GLState::GLContext>();
auto secondContext = MakeUnique<MG_State::GLState::GLContext>();
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();