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

@@ -20,6 +20,16 @@ UniformBufferGL::UniformBufferGL(const void* data_, std::size_t size_)
MBGL_CHECK_ERROR(glBindBuffer(GL_UNIFORM_BUFFER, 0));
}
UniformBufferGL::UniformBufferGL(const UniformBufferGL& other)
: UniformBuffer(other),
hash(other.hash) {
MBGL_CHECK_ERROR(glGenBuffers(1, &id));
MBGL_CHECK_ERROR(glCopyBufferSubData(other.id, id, 0, 0, size));
MBGL_CHECK_ERROR(glBindBuffer(GL_COPY_READ_BUFFER, other.id));
MBGL_CHECK_ERROR(glBindBuffer(GL_COPY_WRITE_BUFFER, id));
MBGL_CHECK_ERROR(glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, size));
}
UniformBufferGL::~UniformBufferGL() {
if (id) {
MBGL_CHECK_ERROR(glDeleteBuffers(1, &id));