Metal stats (#1781)

This commit is contained in:
Tim Sylvester
2023-10-20 15:45:08 -07:00
committed by GitHub
parent 07c70fe1c8
commit 1a1c826fa4
28 changed files with 347 additions and 116 deletions

View File

@@ -63,14 +63,17 @@ static_assert(underlying_type(UniformDataType::FloatMat4) == GL_FLOAT_MAT4, "Ope
static_assert(underlying_type(UniformDataType::Sampler2D) == GL_SAMPLER_2D, "OpenGL type mismatch");
static_assert(underlying_type(UniformDataType::SamplerCube) == GL_SAMPLER_CUBE, "OpenGL type mismatch");
namespace {
GLint getMaxVertexAttribs() {
GLint value = 0;
MBGL_CHECK_ERROR(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value));
return value;
}
} // namespace
Context::Context(RendererBackend& backend_)
: gfx::Context([] {
GLint value;
MBGL_CHECK_ERROR(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value));
return value;
}()),
backend(backend_),
stats() {}
: gfx::Context(/*maximumVertexBindingCount=*/getMaxVertexAttribs()),
backend(backend_) {}
Context::~Context() noexcept {
if (cleanupOnDestruction) {
@@ -616,14 +619,6 @@ std::unique_ptr<gfx::CommandEncoder> Context::createCommandEncoder() {
return std::make_unique<gl::CommandEncoder>(*this);
}
gfx::RenderingStats& Context::renderingStats() {
return stats;
}
const gfx::RenderingStats& Context::renderingStats() const {
return stats;
}
void Context::finish() {
MBGL_CHECK_ERROR(glFinish());
}