Add WebGPU Backend w/ Dawn Support (#3838)
This commit is contained in:
25
src/mbgl/webgpu/vertex_buffer_resource.cpp
Normal file
25
src/mbgl/webgpu/vertex_buffer_resource.cpp
Normal 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
|
||||
Reference in New Issue
Block a user