Add WebGPU Backend w/ Dawn Support (#3838)

This commit is contained in:
Birk Skyum
2025-10-16 20:35:33 +02:00
committed by GitHub
parent cd129e873a
commit 68459732be
119 changed files with 14067 additions and 28 deletions

View File

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