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
679 B
C++
27 lines
679 B
C++
#include <mbgl/vulkan/index_buffer_resource.hpp>
|
|
|
|
#include <mbgl/vulkan/context.hpp>
|
|
|
|
namespace mbgl {
|
|
namespace vulkan {
|
|
|
|
IndexBufferResource::IndexBufferResource(BufferResource&& ptr) noexcept
|
|
: buffer(std::move(ptr)) {
|
|
if (buffer) {
|
|
auto& stats = buffer.getContext().renderingStats();
|
|
stats.numIndexBuffers++;
|
|
stats.memIndexBuffers += buffer.getSizeInBytes();
|
|
}
|
|
}
|
|
|
|
IndexBufferResource::~IndexBufferResource() noexcept {
|
|
if (buffer) {
|
|
auto& stats = buffer.getContext().renderingStats();
|
|
stats.numIndexBuffers--;
|
|
stats.memIndexBuffers -= buffer.getSizeInBytes();
|
|
}
|
|
}
|
|
|
|
} // namespace vulkan
|
|
} // namespace mbgl
|