Rendering statistics view (#3322)
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user