Reuse allocated descriptor sets (#3002)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <mbgl/vulkan/context.hpp>
|
||||
#include <mbgl/vulkan/renderer_backend.hpp>
|
||||
#include <mbgl/util/logging.hpp>
|
||||
#include <mbgl/util/instrumentation.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -48,6 +49,8 @@ BufferResource::BufferResource(
|
||||
size(size_),
|
||||
usage(usage_),
|
||||
persistent(persistent_) {
|
||||
MLN_TRACE_FUNC();
|
||||
|
||||
const auto& allocator = context.getBackend().getAllocator();
|
||||
|
||||
std::size_t totalSize = size;
|
||||
@@ -141,6 +144,8 @@ BufferResource& BufferResource::operator=(BufferResource&& other) noexcept {
|
||||
}
|
||||
|
||||
void BufferResource::update(const void* newData, std::size_t updateSize, std::size_t offset) noexcept {
|
||||
MLN_TRACE_FUNC();
|
||||
|
||||
assert(updateSize + offset <= size);
|
||||
updateSize = std::min(updateSize, size - offset);
|
||||
if (updateSize <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user