Bläddra i källkod

Added device index to specify which GPU to lock/unlock hardware buffer data on

BearishSun 9 år sedan
förälder
incheckning
5ea564c897
23 ändrade filer med 94 tillägg och 45 borttagningar
  1. 10 5
      Source/BansheeCore/Include/BsHardwareBuffer.h
  2. 2 1
      Source/BansheeD3D11RenderAPI/Include/BsD3D11GpuBuffer.h
  3. 1 1
      Source/BansheeD3D11RenderAPI/Include/BsD3D11HardwareBuffer.h
  4. 1 1
      Source/BansheeD3D11RenderAPI/Include/BsD3D11IndexBuffer.h
  5. 1 1
      Source/BansheeD3D11RenderAPI/Include/BsD3D11VertexBuffer.h
  6. 1 1
      Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuBuffer.cpp
  7. 1 1
      Source/BansheeD3D11RenderAPI/Source/BsD3D11HardwareBuffer.cpp
  8. 1 1
      Source/BansheeD3D11RenderAPI/Source/BsD3D11IndexBuffer.cpp
  9. 1 1
      Source/BansheeD3D11RenderAPI/Source/BsD3D11VertexBuffer.cpp
  10. 1 1
      Source/BansheeGLRenderAPI/Include/BsGLGpuBuffer.h
  11. 2 1
      Source/BansheeGLRenderAPI/Include/BsGLIndexBuffer.h
  12. 2 1
      Source/BansheeGLRenderAPI/Include/BsGLVertexBuffer.h
  13. 1 1
      Source/BansheeGLRenderAPI/Source/BsGLGpuBuffer.cpp
  14. 3 3
      Source/BansheeGLRenderAPI/Source/BsGLIndexBuffer.cpp
  15. 3 3
      Source/BansheeGLRenderAPI/Source/BsGLVertexBuffer.cpp
  16. 1 1
      Source/BansheeVulkanRenderAPI/Include/BsVulkanGpuBuffer.h
  17. 2 1
      Source/BansheeVulkanRenderAPI/Include/BsVulkanHardwareBuffer.h
  18. 1 1
      Source/BansheeVulkanRenderAPI/Include/BsVulkanIndexBuffer.h
  19. 1 1
      Source/BansheeVulkanRenderAPI/Include/BsVulkanVertexBuffer.h
  20. 1 1
      Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuBuffer.cpp
  21. 55 15
      Source/BansheeVulkanRenderAPI/Source/BsVulkanHardwareBuffer.cpp
  22. 1 1
      Source/BansheeVulkanRenderAPI/Source/BsVulkanIndexBuffer.cpp
  23. 1 1
      Source/BansheeVulkanRenderAPI/Source/BsVulkanVertexBuffer.cpp

+ 10 - 5
Source/BansheeCore/Include/BsHardwareBuffer.h

@@ -30,6 +30,8 @@ namespace BansheeEngine
 		 * @param[in]	options		Signifies what you want to do with the returned pointer. Caller must ensure not to do
 		 *							anything he hasn't requested (for example don't try to read from the buffer unless you
 		 *							requested it here).
+		 * @param[in]	deviceIdx	Index of the device whose memory to map. If the buffer doesn't exist on this device,
+		 *							the method returns null.							
 		 * @param[in]	queueIdx	Device queue to perform any read/write operations on. Using a non-default queue index
 		 *							allows the GPU to perform write or read operations while executing rendering or compute
 		 *							operations on the same time.
@@ -41,10 +43,10 @@ namespace BansheeEngine
 		 *							This value is a global queue index which encodes both the queue type and queue index.
 		 *							Retrieve it from CommandSyncMask::getGlobalQueueIdx().
 		 */
-		virtual void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1)
+		virtual void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx = 0, UINT32 queueIdx = 1)
         {
             assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
-            void* ret = map(offset, length, options, queueIdx);
+            void* ret = map(offset, length, options, deviceIdx, queueIdx);
             mIsLocked = true;
 
 			mLockStart = offset;
@@ -58,6 +60,8 @@ namespace BansheeEngine
 		 * @param[in]	options		Signifies what you want to do with the returned pointer. Caller must ensure not to do 
 		 *							anything he hasn't requested (for example don't try to read from the buffer unless you
 		 *							requested it here).
+		 * @param[in]	deviceIdx	Index of the device whose memory to map. If the buffer doesn't exist on this device,
+		 *							the method returns null.
 		 * @param[in]	queueIdx	Device queue to perform any read/write operations on. Using a non-default queue index
 		 *							allows the GPU to perform write or read operations while executing rendering or compute
 		 *							operations on the same time.
@@ -69,9 +73,9 @@ namespace BansheeEngine
 		 *							This value is a global queue index which encodes both the queue type and queue index.
 		 *							Retrieve it from CommandSyncMask::getGlobalQueueIdx().
 		 */
-        void* lock(GpuLockOptions options, UINT32 queueIdx = 1)
+        void* lock(GpuLockOptions options, UINT32 deviceIdx = 0, UINT32 queueIdx = 1)
         {
-            return this->lock(0, mSize, options, queueIdx);
+            return this->lock(0, mSize, options, deviceIdx, queueIdx);
         }
 
 		/**	Releases the lock on this buffer. */
@@ -192,7 +196,8 @@ namespace BansheeEngine
 		{  }
 
 		/** @copydoc lock */
-		virtual void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) { return nullptr; }
+		virtual void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, 
+			UINT32 queueIdx) { return nullptr; }
 
 		/** @copydoc unlock */
 		virtual void unmap() { }

+ 2 - 1
Source/BansheeD3D11RenderAPI/Include/BsD3D11GpuBuffer.h

@@ -19,7 +19,8 @@ namespace BansheeEngine
 		~D3D11GpuBufferCore();
 
 		/** @copydoc GpuBufferCore::lock */
-		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1) override;
+		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx = 0,
+				   UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::unlock */
 		void unlock() override;

+ 1 - 1
Source/BansheeD3D11RenderAPI/Include/BsD3D11HardwareBuffer.h

@@ -57,7 +57,7 @@ namespace BansheeEngine
 
 	protected:
 		/** @copydoc HardwareBuffer::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc HardwareBuffer::unmap */
 		void unmap() override;

+ 1 - 1
Source/BansheeD3D11RenderAPI/Include/BsD3D11IndexBuffer.h

@@ -36,7 +36,7 @@ namespace BansheeEngine
 
 	protected:
 		/** @copydoc IndexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc IndexBufferCore::unmap */
 		void unmap() override;

+ 1 - 1
Source/BansheeD3D11RenderAPI/Include/BsD3D11VertexBuffer.h

@@ -36,7 +36,7 @@ namespace BansheeEngine
 
 	protected: 
 		/** @copydoc VertexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc VertexBufferCore::unmap */
 		void unmap(void) override;

+ 1 - 1
Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuBuffer.cpp

@@ -71,7 +71,7 @@ namespace BansheeEngine
 		GpuBufferCore::initialize();
 	}
 
-	void* D3D11GpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* D3D11GpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)

+ 1 - 1
Source/BansheeD3D11RenderAPI/Source/BsD3D11HardwareBuffer.cpp

@@ -89,7 +89,7 @@ namespace BansheeEngine
 			bs_delete(mpTempStagingBuffer);
 	}
 
-	void* D3D11HardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* D3D11HardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 		if (length > mSize)
 			BS_EXCEPT(RenderingAPIException, "Provided length " + toString(length) + " larger than the buffer " + toString(mSize) + ".");		

+ 1 - 1
Source/BansheeD3D11RenderAPI/Source/BsD3D11IndexBuffer.cpp

@@ -29,7 +29,7 @@ namespace BansheeEngine
 		IndexBufferCore::initialize();
 	}
 
-	void* D3D11IndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* D3D11IndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)

+ 1 - 1
Source/BansheeD3D11RenderAPI/Source/BsD3D11VertexBuffer.cpp

@@ -22,7 +22,7 @@ namespace BansheeEngine
 		BS_INC_RENDER_STAT_CAT(ResDestroyed, RenderStatObject_VertexBuffer);
 	}
 
-	void* D3D11VertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* D3D11VertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)

+ 1 - 1
Source/BansheeGLRenderAPI/Include/BsGLGpuBuffer.h

@@ -19,7 +19,7 @@ namespace BansheeEngine
 		~GLGpuBufferCore();
 
 		/** @copydoc GpuBufferCore::lock */
-		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1) override;
+		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx = 0, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::unlock */
 		void unlock() override;

+ 2 - 1
Source/BansheeGLRenderAPI/Include/BsGLIndexBuffer.h

@@ -34,13 +34,14 @@ namespace BansheeEngine
 		void initialize() override;	
 
 		/** @copydoc IndexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc IndexBufferCore::unmap */
 		void unmap() override;
 
 	private:
 		GLBuffer mBuffer;
+		GpuBufferUsage mUsage;
     };
 
 	/** @} */

+ 2 - 1
Source/BansheeGLRenderAPI/Include/BsGLVertexBuffer.h

@@ -41,13 +41,14 @@ namespace BansheeEngine
 		void initialize() override;
 
 		/** @copydoc VertexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc VertexBufferCore::unmap */
 		void unmap() override;
 
 	private:
 		GLBuffer mBuffer;
+		GpuBufferUsage mUsage;
 
 		Vector<GLVertexArrayObject> mVAObjects;
     };

+ 1 - 1
Source/BansheeGLRenderAPI/Source/BsGLGpuBuffer.cpp

@@ -48,7 +48,7 @@ namespace BansheeEngine
 		GpuBufferCore::initialize();
 	}
 
-	void* GLGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* GLGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)

+ 3 - 3
Source/BansheeGLRenderAPI/Source/BsGLIndexBuffer.cpp

@@ -8,7 +8,7 @@
 namespace BansheeEngine 
 {
 	GLIndexBufferCore::GLIndexBufferCore(const INDEX_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
-		:IndexBufferCore(desc, deviceMask)
+		:IndexBufferCore(desc, deviceMask), mUsage(desc.usage)
 	{
 		assert((deviceMask == GDF_DEFAULT || deviceMask == GDF_PRIMARY) && "Multiple GPUs not supported natively on OpenGL.");
 	}
@@ -20,13 +20,13 @@ namespace BansheeEngine
 
 	void GLIndexBufferCore::initialize()
 	{
-		mBuffer.initialize(GL_ELEMENT_ARRAY_BUFFER, mSizeInBytes, mUsage);
+		mBuffer.initialize(GL_ELEMENT_ARRAY_BUFFER, mSize, mUsage);
 
 		BS_INC_RENDER_STAT_CAT(ResCreated, RenderStatObject_IndexBuffer);
 		IndexBufferCore::initialize();
 	}
 
-	void* GLIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* GLIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 		return mBuffer.lock(offset, length, options);
 	}

+ 3 - 3
Source/BansheeGLRenderAPI/Source/BsGLVertexBuffer.cpp

@@ -9,7 +9,7 @@
 namespace BansheeEngine 
 {
 	GLVertexBufferCore::GLVertexBufferCore(const VERTEX_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
-		:VertexBufferCore(desc, deviceMask)
+		:VertexBufferCore(desc, deviceMask), mUsage(desc.usage)
     {
 		assert((deviceMask == GDF_DEFAULT || deviceMask == GDF_PRIMARY) && "Multiple GPUs not supported natively on OpenGL.");
     }
@@ -24,7 +24,7 @@ namespace BansheeEngine
 
 	void GLVertexBufferCore::initialize()
 	{
-		mBuffer.initialize(GL_ARRAY_BUFFER, mSizeInBytes, mUsage);
+		mBuffer.initialize(GL_ARRAY_BUFFER, mSize, mUsage);
 		
 		BS_INC_RENDER_STAT_CAT(ResCreated, RenderStatObject_VertexBuffer);
 		VertexBufferCore::initialize();
@@ -43,7 +43,7 @@ namespace BansheeEngine
 			mVAObjects.erase(iterFind);
 	}
 
-	void* GLVertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* GLVertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
     {
 		return mBuffer.lock(offset, length, options);
     }

+ 1 - 1
Source/BansheeVulkanRenderAPI/Include/BsVulkanGpuBuffer.h

@@ -18,7 +18,7 @@ namespace BansheeEngine
 		~VulkanGpuBufferCore();
 
 		/** @copydoc GpuBufferCore::lock */
-		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1) override;
+		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx = 0, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::unlock */
 		void unlock() override;

+ 2 - 1
Source/BansheeVulkanRenderAPI/Include/BsVulkanHardwareBuffer.h

@@ -75,12 +75,13 @@ namespace BansheeEngine
 
 	protected:
 		/** @copydoc HardwareBuffer::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc HardwareBuffer::unmap */
 		void unmap() override;
 
 		VulkanBuffer* mBuffers[BS_MAX_DEVICES];
+		bool mStaging;
 	};
 
 	/** @} */

+ 1 - 1
Source/BansheeVulkanRenderAPI/Include/BsVulkanIndexBuffer.h

@@ -32,7 +32,7 @@ namespace BansheeEngine
 
 	protected:
 		/** @copydoc IndexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc IndexBufferCore::unmap */
 		void unmap() override;

+ 1 - 1
Source/BansheeVulkanRenderAPI/Include/BsVulkanVertexBuffer.h

@@ -31,7 +31,7 @@ namespace BansheeEngine
 
 	protected: 
 		/** @copydoc VertexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx) override;
 
 		/** @copydoc VertexBufferCore::unmap */
 		void unmap(void) override;

+ 1 - 1
Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuBuffer.cpp

@@ -42,7 +42,7 @@ namespace BansheeEngine
 		GpuBufferCore::initialize();
 	}
 
-	void* VulkanGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* VulkanGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)

+ 55 - 15
Source/BansheeVulkanRenderAPI/Source/BsVulkanHardwareBuffer.cpp

@@ -27,12 +27,11 @@ namespace BansheeEngine
 
 	VulkanHardwareBuffer::VulkanHardwareBuffer(BufferType type, GpuBufferFormat format, GpuBufferUsage usage, 
 		UINT32 size, GpuDeviceFlags deviceMask)
-		: HardwareBuffer(usage), mBuffers()
+		: HardwareBuffer(size), mBuffers(), mStaging(type == BT_STAGING)
 	{
-		bool staging = type == BT_STAGING;
 		bool needsView = false;
 
-		VkMemoryPropertyFlags flags = staging ?
+		VkMemoryPropertyFlags flags = mStaging ?
 			(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) : // Note: Try using cached uncoherent memory
 			VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
 
@@ -69,7 +68,7 @@ namespace BansheeEngine
 		for (UINT32 i = 0; i < BS_MAX_DEVICES; i++)
 		{
 			if (devices[i] == nullptr)
-				break;
+				continue;
 
 			VkBufferCreateInfo bufferCI;
 			bufferCI.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
@@ -114,8 +113,6 @@ namespace BansheeEngine
 
 			mBuffers[i] = devices[i]->getResourceManager().create<VulkanBuffer>(buffer, view, memory);
 		}
-
-		mSizeInBytes = size;
 	}
 
 	VulkanHardwareBuffer::~VulkanHardwareBuffer()
@@ -123,17 +120,53 @@ namespace BansheeEngine
 		for (UINT32 i = 0; i < BS_MAX_DEVICES; i++)
 		{
 			if (mBuffers[i] == nullptr)
-				return;
+				continue;
 
 			mBuffers[i]->destroy();
 		}
 	}
 
-	void* VulkanHardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* VulkanHardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
-		if ((offset + length) > mSizeInBytes)
-			BS_EXCEPT(RenderingAPIException, "Provided offset(" + toString(offset) + ") + length(" + toString(length) + ") "
-				"is larger than the buffer " + toString(mSizeInBytes) + ".");		
+		if ((offset + length) > mSize)
+		{
+			LOGERR("Provided offset(" + toString(offset) + ") + length(" + toString(length) + ") "
+				   "is larger than the buffer " + toString(mSize) + ".");
+
+			return nullptr;
+		}
+
+		VulkanBuffer* buffer = mBuffers[deviceIdx];
+
+		if (buffer == nullptr)
+			return;
+
+		bool directMap = mStaging && !buffer->isUsed();
+
+		// If memory is host visible and buffer isn't used on the GPU, map directly (no need for pipeline barriers
+		// with access modifiers since we're sure the buffer isn't used on the GPU)
+		if (directMap)
+			return buffer->map();
+
+		// TODO - Allocate staging buffer
+
+		bool needRead = options == GBL_READ_WRITE || options == GBL_READ_ONLY;
+		if(needRead)
+		{
+			// TODO - Get command buffer on wanted queue
+			//      - Generate sync mask depending on where the resource is used on
+			//      - Issue copy from source buffer to staging buffer, with sync mask semaphores
+			//      - Wait for queue to complete, refresh CB states
+			//      - Proceed below
+		}
+
+		// TODO - Return staging buffer->map()
+		//      - Set mRequiresUpload field to true
+
+
+		// TODO - Special
+		//      - Keep a list of upload command buffers per queue to avoid allocating them
+		//      - Can I easily determine sync mask of which buffers a resource is used on from VulkanResource?
 
 		switch (options)
 		{
@@ -159,23 +192,30 @@ namespace BansheeEngine
 
 	void VulkanHardwareBuffer::unmap()
 	{
-
+		// TODO - If direct map (mRequiresUpload == false), simply unmap
+		// TODO - If mRequiresUpload is true, queue copyBuffer command
+		//      - If lock was discard, don't issue any write semaphores and instead create a brand new internal buffer (destroy old one)
+		//      - If lock was no overwrite, don't issue any write semaphores but write to the buffer
+		//      - Otherwise, wait until resource is not used before issuing write
 	}
 
 	void VulkanHardwareBuffer::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
 		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
-
+		// TODO - Queue copy command on the requested queue
+		//      - Issue semaphores if src buffer is currently used
+		//      - Otherwise just create a new buffer and write to it
+		//      - If current buffer is currently being written to by the GPU, issue a wait and log a performance warning
 	}
 
 	void VulkanHardwareBuffer::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 queueIdx)
 	{
-		
+		// TODO - Just use lock/unlock
 	}
 
 	void VulkanHardwareBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, 
 		UINT32 queueIdx)
 	{
-		
+		// TODO - Just use lock/unlock
 	}
 }

+ 1 - 1
Source/BansheeVulkanRenderAPI/Source/BsVulkanIndexBuffer.cpp

@@ -22,7 +22,7 @@ namespace BansheeEngine
 		IndexBufferCore::initialize();
 	}
 
-	void* VulkanIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* VulkanIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)

+ 1 - 1
Source/BansheeVulkanRenderAPI/Source/BsVulkanVertexBuffer.cpp

@@ -14,7 +14,7 @@ namespace BansheeEngine
 		BS_INC_RENDER_STAT_CAT(ResDestroyed, RenderStatObject_VertexBuffer);
 	}
 
-	void* VulkanVertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
+	void* VulkanVertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 deviceIdx, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)