Vulkan renderer backend (#2564)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
This commit is contained in:
Adrian Cojocaru
2024-08-01 22:49:49 +03:00
committed by GitHub
parent 88993b9420
commit 072aa32e8b
103 changed files with 11459 additions and 135 deletions

View File

@@ -0,0 +1,26 @@
#include <mbgl/vulkan/vertex_buffer_resource.hpp>
#include <mbgl/vulkan/context.hpp>
namespace mbgl {
namespace vulkan {
VertexBufferResource::VertexBufferResource(BufferResource&& ptr) noexcept
: buffer(std::move(ptr)) {
if (buffer) {
auto& stats = buffer.getContext().renderingStats();
stats.numVertexBuffers++;
stats.memVertexBuffers += buffer.getSizeInBytes();
}
}
VertexBufferResource::~VertexBufferResource() noexcept {
if (buffer) {
auto& stats = buffer.getContext().renderingStats();
stats.numVertexBuffers--;
stats.memVertexBuffers -= buffer.getSizeInBytes();
}
}
} // namespace vulkan
} // namespace mbgl