mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 22:43:24 +09:00
[MG_IntegrationTest] (Disaggregated): sample frame statistics after present is applied
This commit is contained in:
@@ -87,6 +87,22 @@ namespace MGITest {
|
|||||||
return session && session->Control() && session->Control()->producerParked.load(std::memory_order_acquire);
|
return session && session->Control() && session->Control()->producerParked.load(std::memory_order_acquire);
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
bool WaitForSplitAppliedForTesting(unsigned long long seq, unsigned int timeoutMs) {
|
||||||
|
#if defined(MGITEST_SPLIT_RUNTIME_PEEK_LIVE)
|
||||||
|
auto* session = MobileGL::MG_Remote::Client::ClientSession::Active();
|
||||||
|
auto* control = session ? session->Control() : nullptr;
|
||||||
|
if (!control) return false;
|
||||||
|
const auto until = std::chrono::steady_clock::now() + std::chrono::milliseconds(timeoutMs);
|
||||||
|
do {
|
||||||
|
if (control->appliedSeq.load(std::memory_order_acquire) >= seq) return true;
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
|
} while (std::chrono::steady_clock::now() < until);
|
||||||
|
return control->appliedSeq.load(std::memory_order_acquire) >= seq;
|
||||||
|
#else
|
||||||
|
(void)seq; (void)timeoutMs;
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
void DelaySplitRetirementForTesting(bool enabled) {
|
void DelaySplitRetirementForTesting(bool enabled) {
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ namespace MGITest {
|
|||||||
bool SplitApplyHoldIsActiveForTesting();
|
bool SplitApplyHoldIsActiveForTesting();
|
||||||
void ReleaseSplitApplyHoldForTesting();
|
void ReleaseSplitApplyHoldForTesting();
|
||||||
bool SplitProducerIsParkedForTesting();
|
bool SplitProducerIsParkedForTesting();
|
||||||
|
// Observe completion for assertions about an emitted frame; does not emit a
|
||||||
|
// GL command or change the production wait rule.
|
||||||
|
bool WaitForSplitAppliedForTesting(unsigned long long seq, unsigned int timeoutMs = 5000);
|
||||||
|
|
||||||
|
|
||||||
// Empty when this process is a real split run that can be asserted about; otherwise the
|
// Empty when this process is a real split run that can be asserted about; otherwise the
|
||||||
|
|||||||
@@ -161,6 +161,9 @@ void main() { color = vec4(value, 0.25, 0.75, 1.0); }
|
|||||||
EXPECT_NEAR(pixel[2], 191, 1);
|
EXPECT_NEAR(pixel[2], 191, 1);
|
||||||
EXPECT_EQ(pixel[3], 255);
|
EXPECT_EQ(pixel[3], 255);
|
||||||
Gl().EndFrame();
|
Gl().EndFrame();
|
||||||
|
// Present returns before apply under run-ahead. Inspect this completed
|
||||||
|
// frame's window, not the previous (possibly empty setup) log line.
|
||||||
|
ASSERT_TRUE(WaitForSplitAppliedForTesting(PeekSplitRuntime().emitSeq));
|
||||||
const auto window = PipeStatsWindow::LastFromLaneLog();
|
const auto window = PipeStatsWindow::LastFromLaneLog();
|
||||||
ASSERT_TRUE(window.found) << "P5f rsp window missing on frame " << frame;
|
ASSERT_TRUE(window.found) << "P5f rsp window missing on frame " << frame;
|
||||||
// Magma does not publish Espryt's draw counter. The changing uniform and
|
// Magma does not publish Espryt's draw counter. The changing uniform and
|
||||||
|
|||||||
Reference in New Issue
Block a user