[MG_Pipe, MG_Test] (Disaggregated): P5f fe - verify XFB snapshot fields and preserve spans

This commit is contained in:
2026-09-19 21:58:27 -04:00
parent 07bf8d7ce0
commit 881e050e2c
5 changed files with 11 additions and 14 deletions
@@ -1657,10 +1657,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
#if MOBILEGL_BUILD_DISAGGREGATED
if (MG_Config::Transport == MG_Config::TransportMode::Monolith)
#endif
#if MOBILEGL_BUILD_DISAGGREGATED
if (MG_Config::Transport == MG_Config::TransportMode::Monolith)
#endif
if (!target.buffer) continue;
if (!target.buffer) continue;
#if MOBILEGL_BUILD_DISAGGREGATED
// P5c: under an active transport the frontend object is client
// memory (rule E), so the persistence question is the server
-8
View File
@@ -3214,10 +3214,6 @@ namespace MobileGL::MG_Pipe {
// bind_render_state's precedent for the same question.
if (MGPipeHandleIsNull(handle.Handle)) {
g_applier.BoundShaderCso = kMGPipeNullHandle;
#if MOBILEGL_BUILD_DISAGGREGATED
g_applier.BoundStreamOutputLifetimeId = 0;
g_applier.StreamOutputSpans.clear();
#endif
++g_applier.ProgramBindingSerial;
return;
}
@@ -3250,10 +3246,6 @@ namespace MobileGL::MG_Pipe {
Bool cleared = false;
if (g_applier.BoundShaderCso == handle.Handle) {
g_applier.BoundShaderCso = kMGPipeNullHandle;
#if MOBILEGL_BUILD_DISAGGREGATED
g_applier.BoundStreamOutputLifetimeId = 0;
g_applier.StreamOutputSpans.clear();
#endif
cleared = true;
}
if (g_applier.DrawProgram == handle.Handle) {
+1 -1
View File
@@ -236,7 +236,7 @@
F(Bits) F(ByRegion)
#define MGP_FIELDS_MGPStreamOutputBegin(F) \
F(PrimitiveMode)
F(PrimitiveMode) F(CaptureProgram) F(LifetimeId) F(Targets)
#define MGP_FIELDS_MGPXfbAccounting(F) \
F(CapturedVertices) F(PrimitivesWritten) F(PrimitiveMode)
+1 -1
View File
@@ -1428,7 +1428,7 @@ namespace MobileGL::MG_Remote::Client {
const auto range = point.GetRange();
const SizeT start = std::min(range.start, buffer->GetSize());
const SizeT end = std::min(range.end, buffer->GetSize());
record.Targets[i] = {MG_Pipe::MGPipeBufferResources().Find(*buffer), start,
record.Targets[i] = {MG_Pipe::MGPipeResourceTrackerInstance().Find(*buffer), start,
end > start ? end - start : 0};
}
session.EmitAndWait(MG_Pipe::MGPWireOp::BeginStreamOutput, &record, sizeof(record),
@@ -1194,6 +1194,9 @@ TEST_F(PipeWireCodecTest, TheFourStreamOutputSpanRowsReachTheSink) {
Wire2 wire;
MGPStreamOutputBegin begin{};
begin.PrimitiveMode = 4;
begin.CaptureProgram = MakeHandle(95);
begin.LifetimeId = 0x100000002ull;
begin.Targets[3] = {MakeHandle(96), 0x100000010ull, 64};
MGPStreamOutputControl control{};
MGPXfbAccounting end{};
end.CapturedVertices = 300;
@@ -1210,6 +1213,11 @@ TEST_F(PipeWireCodecTest, TheFourStreamOutputSpanRowsReachTheSink) {
}
ASSERT_EQ(wire.Sink().Begins.size(), 1u);
EXPECT_EQ(wire.Sink().Begins[0].PrimitiveMode, 4u);
EXPECT_EQ(wire.Sink().Begins[0].CaptureProgram, MakeHandle(95));
EXPECT_EQ(wire.Sink().Begins[0].LifetimeId, 0x100000002ull);
EXPECT_EQ(wire.Sink().Begins[0].Targets[3].Res, MakeHandle(96));
EXPECT_EQ(wire.Sink().Begins[0].Targets[3].Offset, 0x100000010ull);
EXPECT_EQ(wire.Sink().Begins[0].Targets[3].Size, 64u);
EXPECT_EQ(wire.Sink().Pauses, 1u);
EXPECT_EQ(wire.Sink().Resumes, 1u);
ASSERT_EQ(wire.Sink().Ends.size(), 1u);