mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-14 13:33:23 +09:00
39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
// MobileGL - MobileGL/MG_IntegrationTest/Harness/WireIndirectPeek.cpp
|
|
// Copyright (c) 2026 MobileGL-Dev
|
|
// Licensed under the GNU Lesser General Public License v3.0:
|
|
// https://www.gnu.org/licenses/gpl-3.0.txt
|
|
// https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
// End of Source File Header
|
|
|
|
#include "WireIndirectPeek.h"
|
|
|
|
#if !defined(__ANDROID__)
|
|
#include <MG_Pipe/MGPipe.h>
|
|
#if MOBILEGL_PIPE_PUSH
|
|
#include <MG_Util/Metrics/PipeStats.h>
|
|
#define MGITEST_WIRE_INDIRECT_PEEK_LIVE 1
|
|
#endif
|
|
#endif
|
|
|
|
namespace MGITest {
|
|
|
|
#if defined(MGITEST_WIRE_INDIRECT_PEEK_LIVE)
|
|
bool PeekWireIndirectCounters(WireIndirectCounters* out) {
|
|
if (out == nullptr) return false;
|
|
namespace Stats = MobileGL::MG_Util::PipeStats;
|
|
if (!Stats::Enabled()) Stats::SetEnabledForTesting(true);
|
|
out->nativeDraws = Stats::TotalCalls(Stats::CallClass::WireIndirectNativeDraws);
|
|
out->cpuExpansions = Stats::TotalCalls(Stats::CallClass::WireIndirectCpuExpansions);
|
|
out->barriers = Stats::TotalCalls(Stats::CallClass::WireIndirectBarriers);
|
|
out->hostWaits = Stats::TotalCalls(Stats::CallClass::WireHostWaits);
|
|
out->indirectWaits = Stats::TotalCalls(Stats::CallClass::WireHostWaitsIndirect);
|
|
out->nativeDispatches = Stats::TotalCalls(Stats::CallClass::WireIndirectNativeDispatches);
|
|
return true;
|
|
}
|
|
#else
|
|
bool PeekWireIndirectCounters(WireIndirectCounters*) { return false; }
|
|
#endif
|
|
|
|
} // namespace MGITest
|