From c633fcc87e295ebc88b5847c44ca0da121652819 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 12 Dec 2021 01:33:10 +0200 Subject: [PATCH] Use const void * for the object pointers in TransferQueue --- source/backends/vulkan/transferqueue.cpp | 2 +- source/backends/vulkan/transferqueue.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/backends/vulkan/transferqueue.cpp b/source/backends/vulkan/transferqueue.cpp index 8040f245..f356510e 100644 --- a/source/backends/vulkan/transferqueue.cpp +++ b/source/backends/vulkan/transferqueue.cpp @@ -12,7 +12,7 @@ TransferQueue::TransferQueue(Device &d): device(d) { } -TransferQueue::PendingTransfer &TransferQueue::prepare_transfer(void *object, bool ordered, size_t size) +TransferQueue::PendingTransfer &TransferQueue::prepare_transfer(const void *object, bool ordered, size_t size) { unsigned &order = next_orders[object]; order += !order; diff --git a/source/backends/vulkan/transferqueue.h b/source/backends/vulkan/transferqueue.h index b11b4503..58b1bc2d 100644 --- a/source/backends/vulkan/transferqueue.h +++ b/source/backends/vulkan/transferqueue.h @@ -42,23 +42,23 @@ private: std::size_t default_buffer_size = 16*1048576; std::vector buffers; std::vector transfers; - std::map next_orders; + std::map next_orders; public: TransferQueue(Device &); template - void *prepare_transfer(void *, bool, std::size_t, S &&, T &&); + void *prepare_transfer(const void *, bool, std::size_t, S &&, T &&); private: - PendingTransfer &prepare_transfer(void *, bool, std::size_t); + PendingTransfer &prepare_transfer(const void *, bool, std::size_t); public: void dispatch_transfers(VkCommandBuffer); }; template -void *TransferQueue::prepare_transfer(void *object, bool ordered, std::size_t size, S &&synchronize, T &&transfer) +void *TransferQueue::prepare_transfer(const void *object, bool ordered, std::size_t size, S &&synchronize, T &&transfer) { PendingTransfer &pt = prepare_transfer(object, ordered, size); pt.synchronize = std::forward(synchronize); -- 2.45.2