]> git.tdb.fi Git - libs/gl.git/commitdiff
Use const void * for the object pointers in TransferQueue
authorMikko Rasa <tdb@tdb.fi>
Sat, 11 Dec 2021 23:33:10 +0000 (01:33 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 11 Dec 2021 23:33:10 +0000 (01:33 +0200)
source/backends/vulkan/transferqueue.cpp
source/backends/vulkan/transferqueue.h

index 8040f245f5360a33ae31fb6a23b34cd392c8dbf9..f356510e4b3a02d57dddb387825eb478ea88fa37 100644 (file)
@@ -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;
index b11b4503d59c78a0a60c77c2c905135ad714f57e..58b1bc2d6fa5f4743964c72d1e15e01305a97af0 100644 (file)
@@ -42,23 +42,23 @@ private:
        std::size_t default_buffer_size = 16*1048576;
        std::vector<StagingBuffer> buffers;
        std::vector<PendingTransfer> transfers;
-       std::map<void *, unsigned> next_orders;
+       std::map<const void *, unsigned> next_orders;
 
 public:
        TransferQueue(Device &);
 
        template<typename S, typename T>
-       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<typename S, typename T>
-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<S>(synchronize);