Rendering statistics view (#3322)

Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
Adrian Cojocaru
2025-06-03 18:59:51 +03:00
committed by GitHub
parent 3c07cacc4d
commit 2a7249a3b0
81 changed files with 1271 additions and 128 deletions

View File

@@ -100,6 +100,10 @@ Context::~Context() noexcept {
if (cleanupOnDestruction) {
backend.getThreadPool().runRenderJobs(true /* closeQueue */);
for (size_t i = 0; i < globalUniformBuffers.allocatedSize(); i++) {
globalUniformBuffers.set(i, nullptr);
}
reset();
// Delete all pooled resources while the context is still valid
@@ -536,7 +540,7 @@ gfx::UniformBufferPtr Context::createUniformBuffer(const void* data,
bool /*ssbo*/) {
MLN_TRACE_FUNC();
return std::make_shared<gl::UniformBufferGL>(data, size, *uboAllocator);
return std::make_shared<gl::UniformBufferGL>(*this, data, size, *uboAllocator);
}
gfx::UniqueUniformBufferArray Context::createLayerUniformBufferArray() {
@@ -622,6 +626,7 @@ void Context::clear(std::optional<mbgl::Color> color, std::optional<float> depth
MBGL_CHECK_ERROR(glClear(mask));
stats.numDrawCalls = 0;
stats.numFrames++;
}
void Context::setCullFaceMode(const gfx::CullFaceMode& mode) {
@@ -728,6 +733,7 @@ void Context::draw(const gfx::DrawMode& drawMode, std::size_t indexOffset, std::
reinterpret_cast<GLvoid*>(sizeof(uint16_t) * indexOffset)));
stats.numDrawCalls++;
stats.totalDrawCalls++;
}
void Context::performCleanup() {