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>
27 lines
688 B
C++
27 lines
688 B
C++
#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
|