Procházet zdrojové kódy

Refactoring hardware buffer write/read API, in preparation for Vulkan HW buffer transfer implementation

BearishSun před 9 roky
rodič
revize
588076b7cc
36 změnil soubory, kde provedl 235 přidání a 355 odebrání
  1. 2 50
      Source/BansheeCore/Include/BsGpuBuffer.h
  2. 0 31
      Source/BansheeCore/Include/BsGpuParamBlockBuffer.h
  3. 79 74
      Source/BansheeCore/Include/BsHardwareBuffer.h
  4. 13 1
      Source/BansheeCore/Source/BsGpuBuffer.cpp
  5. 0 33
      Source/BansheeCore/Source/BsGpuParamBlockBuffer.cpp
  6. 11 11
      Source/BansheeCore/Source/BsIndexBuffer.cpp
  7. 5 5
      Source/BansheeCore/Source/BsMesh.cpp
  8. 3 7
      Source/BansheeCore/Source/BsVertexBuffer.cpp
  9. 5 5
      Source/BansheeD3D11RenderAPI/Include/BsD3D11GpuBuffer.h
  10. 0 3
      Source/BansheeD3D11RenderAPI/Include/BsD3D11GpuParamBlockBuffer.h
  11. 5 4
      Source/BansheeD3D11RenderAPI/Include/BsD3D11HardwareBuffer.h
  12. 6 4
      Source/BansheeD3D11RenderAPI/Include/BsD3D11IndexBuffer.h
  13. 5 4
      Source/BansheeD3D11RenderAPI/Include/BsD3D11VertexBuffer.h
  14. 8 7
      Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuBuffer.cpp
  15. 0 7
      Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuParamBlockBuffer.cpp
  16. 16 17
      Source/BansheeD3D11RenderAPI/Source/BsD3D11HardwareBuffer.cpp
  17. 6 6
      Source/BansheeD3D11RenderAPI/Source/BsD3D11IndexBuffer.cpp
  18. 7 6
      Source/BansheeD3D11RenderAPI/Source/BsD3D11VertexBuffer.cpp
  19. 5 5
      Source/BansheeGLRenderAPI/Include/BsGLGpuBuffer.h
  20. 0 3
      Source/BansheeGLRenderAPI/Include/BsGLGpuParamBlockBuffer.h
  21. 3 3
      Source/BansheeGLRenderAPI/Include/BsGLIndexBuffer.h
  22. 3 3
      Source/BansheeGLRenderAPI/Include/BsGLVertexBuffer.h
  23. 10 8
      Source/BansheeGLRenderAPI/Source/BsGLGpuBuffer.cpp
  24. 0 9
      Source/BansheeGLRenderAPI/Source/BsGLGpuParamBlockBuffer.cpp
  25. 3 3
      Source/BansheeGLRenderAPI/Source/BsGLIndexBuffer.cpp
  26. 3 3
      Source/BansheeGLRenderAPI/Source/BsGLVertexBuffer.cpp
  27. 6 6
      Source/BansheeVulkanRenderAPI/Include/BsVulkanGpuBuffer.h
  28. 0 3
      Source/BansheeVulkanRenderAPI/Include/BsVulkanGpuParamBlockBuffer.h
  29. 4 4
      Source/BansheeVulkanRenderAPI/Include/BsVulkanHardwareBuffer.h
  30. 4 4
      Source/BansheeVulkanRenderAPI/Include/BsVulkanIndexBuffer.h
  31. 4 4
      Source/BansheeVulkanRenderAPI/Include/BsVulkanVertexBuffer.h
  32. 6 5
      Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuBuffer.cpp
  33. 0 5
      Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuParamBlockBuffer.cpp
  34. 5 4
      Source/BansheeVulkanRenderAPI/Source/BsVulkanHardwareBuffer.cpp
  35. 4 4
      Source/BansheeVulkanRenderAPI/Source/BsVulkanIndexBuffer.cpp
  36. 4 4
      Source/BansheeVulkanRenderAPI/Source/BsVulkanVertexBuffer.cpp

+ 2 - 50
Source/BansheeCore/Include/BsGpuBuffer.h

@@ -4,6 +4,7 @@
 
 #include "BsCorePrerequisites.h"
 #include "BsCoreObject.h"
+#include "BsHardwareBuffer.h"
 
 namespace BansheeEngine 
 {
@@ -137,60 +138,11 @@ namespace BansheeEngine
 	 *
 	 * @note	Core thread only.
 	 */
-	class BS_CORE_EXPORT GpuBufferCore : public CoreObjectCore
+	class BS_CORE_EXPORT GpuBufferCore : public CoreObjectCore, public HardwareBuffer
 	{
 	public:
 		virtual ~GpuBufferCore();
 
-		/**
-		 * Locks the buffer returning a pointer to the internal buffer data that you may then read or write to. 
-		 * Caller must ensure it will only perform actions promised in the provided GPU lock options parameter.
-		 *
-		 * @param[in]	offset	Number of bytes at which to lock the buffer. Returned pointer points to this location.
-		 * @param[in]	length	Number of bytes to lock.
-		 * @param[in]	options How to lock the buffer. Certain options offer better performance than others.
-		 */
-		virtual void* lock(UINT32 offset, UINT32 length, GpuLockOptions options) = 0;
-
-		/**
-		 * Unlocks a previously locked buffer. Any pointers to internal buffers returned when it was locked will become 
-		 * invalid.
-		 */
-		virtual void unlock() = 0;
-
-		/**
-		 * Reads buffer data into the previously allocated buffer.
-		 *
-		 * @param[in]	offset	Number of bytes at which to start reading the buffer.
-		 * @param[in]	length	Number of bytes to read.
-		 * @param[in]	pDest	Previously allocated buffer of @p length bytes size that the data will be written to.
-		 */
-        virtual void readData(UINT32 offset, UINT32 length, void* pDest) = 0;
-
-		/**
-		 * Writes data into the buffer.
-		 *
-		 * @param[in]	offset		Number of bytes at which to start writing to the buffer.
-		 * @param[in]	length		Number of bytes to write.
-		 * @param[in]	pSource		Buffer containg the data to write.
-		 * @param[in]	writeFlags  Flags that may be used to improve performance for specific use cases.
-		 */
-        virtual void writeData(UINT32 offset, UINT32 length, const void* pSource, 
-			BufferWriteType writeFlags = BWT_NORMAL) = 0;
-
-		/**
-		 * Copies data from another buffer into this buffer.
-		 *
-		 * @param[in]	srcBuffer			Buffer to copy the data from.
-		 * @param[in]	srcOffset			Offset in bytes into the source buffer - this is where reading starts from.
-		 * @param[in]	dstOffset			Offset in bytes into the destination buffer - this is where writing starts from.
-		 * @param[in]	length				Number of bytes to copy from source to destination.
-		 * @param[in]	discardWholeBuffer	If true, the contents of the current buffer will be entirely discarded. This can
-		 *									improve performance if you know you wont be needing that data any more.
-		 */
-		virtual void copyData(GpuBufferCore& srcBuffer, UINT32 srcOffset,
-			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false) = 0;
-
 		/** Returns properties describing the buffer. */
 		const GpuBufferProperties& getProperties() const { return mProperties; }
 

+ 0 - 31
Source/BansheeCore/Include/BsGpuParamBlockBuffer.h

@@ -25,14 +25,6 @@ namespace BansheeEngine
 		/** Writes all of the specified data to the buffer. Data size must be the same size as the buffer. */
 		virtual void writeToGPU(const UINT8* data) = 0;
 
-		/**
-		 * Copies data from the internal buffer to a pre-allocated array. Be aware this generally isn't a very fast 
-		 * operation as reading from the GPU will most definitely involve a CPU-GPU sync point.
-		 *
-		 * @param[in,out]	data	Array where the data will be written to. Must be of getSize() bytes.
-		 */
-		virtual void readFromGPU(UINT8* data) const = 0;
-
 		/** Flushes any cached data into the actual GPU buffer. */
 		void flushToGPU();
 
@@ -75,29 +67,6 @@ namespace BansheeEngine
 		bool mGPUBufferDirty;
 	};
 
-	/**
-	 * Implementation of a GpuParamBlock buffer that doesn't use a GPU buffer for storage. Used with APIs that do not 
-	 * support GPU parameter buffers.
-	 */
-	class BS_CORE_EXPORT GenericGpuParamBlockBufferCore : public GpuParamBlockBufferCore
-	{
-	public:
-		GenericGpuParamBlockBufferCore(UINT32 size, GpuParamBlockUsage usage, GpuDeviceFlags deviceMask);
-		~GenericGpuParamBlockBufferCore();
-
-		/** @copydoc GpuParamBlockBufferCore::writeToGPU */
-		void writeToGPU(const UINT8* data) override;
-
-		/** @copydoc GpuParamBlockBufferCore::readFromGPU */
-		void readFromGPU(UINT8* data) const override;
-
-	protected:
-		UINT8* mData;
-
-		/** @copydoc CoreObjectCore::initialize */
-		void initialize() override;
-	};
-
 	/** @} */
 	/** @addtogroup RenderAPI
 	 *  @{

+ 79 - 74
Source/BansheeCore/Include/BsHardwareBuffer.h

@@ -30,20 +30,21 @@ 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]	syncMask	Mask that determines how are read or write operations synchronized with other operations
-		 *							on this resource. This corresponds to the sync mask property on a CommandBuffer object.
-		 *							If reading, the system will wait on all commands buffers with the shared mask bits
-		 *							before continuing.
-		 *							If writing, Setting a mask that's different from used command buffers allows the writes
-		 *							to be queued independantly from normal rendering commands, allowing for async execution.
-		 *
-		 *							It's up to the caller to ensure the usage is valid (e.g. not reading something that is
-		 *							currently being written to with a different sync mask). If not sure leave at default.
+		 * @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.
+		 * 
+		 *							Note that when writing to a buffer that is being used on a command buffer with a
+		 *							different queue you must ensure to provide the command buffer with a valid sync mask
+		 *							so it knows to wait before the write operation completes.
+		 *							
+		 *							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 syncMask = 0x00000001)
+		virtual void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1)
         {
             assert(!isLocked() && "Cannot lock this buffer, it is already locked!");
-            void* ret = map(offset, length, options, syncMask);
+            void* ret = map(offset, length, options, queueIdx);
             mIsLocked = true;
 
 			mLockStart = offset;
@@ -57,19 +58,20 @@ 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]	syncMask	Mask that determines how are read or write operations synchronized with other operations
-		 *							on this resource. This corresponds to the sync mask property on a CommandBuffer object.
-		 *							If reading, the system will wait on all commands buffers with the shared mask bits
-		 *							before continuing. 
-		 *							If writing, Setting a mask that's different from used command buffers allows the writes
-		 *							to be queued independantly from normal rendering commands, allowing for async execution.
-		 *							
-		 *							It's up to the caller to ensure the usage is valid (e.g. not reading something that is
-		 *							currently being written to with a different sync mask). If not sure leave at default.
+		 * @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.
+		 *
+		 *							Note that when writing to a buffer that is being used on a command buffer with a
+		 *							different queue you must ensure to provide the command buffer with a valid sync mask
+		 *							so it knows to wait before the write operation completes.
+		 *
+		 *							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 syncMask = 0x00000001)
+        void* lock(GpuLockOptions options, UINT32 queueIdx = 1)
         {
-            return this->lock(0, mSizeInBytes, options, syncMask);
+            return this->lock(0, mSize, options, queueIdx);
         }
 
 		/**	Releases the lock on this buffer. */
@@ -88,15 +90,18 @@ namespace BansheeEngine
 		 * @param[in]	offset		Offset in bytes from which to copy the data.
 		 * @param[in]	length		Length of the area you want to copy, in bytes.
 		 * @param[in]	dest		Destination buffer large enough to store the read data.
-		 * @param[in]	syncMask	Mask that determines how is the read operation synchronized with other operations on 
-		 *							this resource. This corresponds to the sync mask property on a CommandBuffer object.
-		 *							The system will wait on all commands buffers with the shared mask bits before continuing
-		 *							with the read. 
-		 *							
-		 *							It's up to the caller to ensure the usage is valid (e.g. not reading something that is
-		 *							currently being written to with a different sync mask). If not sure leave at default.
+		 * @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.
+		 *
+		 *							Note that when writing to a buffer that is being used on a command buffer with a
+		 *							different queue you must ensure to provide the command buffer with a valid sync mask
+		 *							so it knows to wait before the write operation completes.
+		 *
+		 *							This value is a global queue index which encodes both the queue type and queue index.
+		 *							Retrieve it from CommandSyncMask::getGlobalQueueIdx().
 		 */
-        virtual void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) = 0;
+        virtual void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) = 0;
 
 		/**
 		 * Writes data into a portion of the buffer from the source memory. 
@@ -105,16 +110,19 @@ namespace BansheeEngine
 		 * @param[in]	length		Length of the area you want to copy, in bytes.
 		 * @param[in]	source		Source buffer containing the data to write.
 		 * @param[in]	writeFlags	Optional write flags that may affect performance.
-		 * @param[in]	syncMask	Mask that determines how is the write operation synchronized with other operations
-		 *							on this resource. This corresponds to the sync mask property on a CommandBuffer object.
-		 *							Setting a mask that's different from used command buffers allows the writes to be queued
-		 *							independantly from normal rendering commands, allowing for async execution.
-		 *							
-		 *							It's up to the caller to ensure the usage is valid (e.g. not writing to something that
-		 *							is currently being used by the GPU). If not sure leave at default.
+		 * @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.
+		 *
+		 *							Note that when writing to a buffer that is being used on a command buffer with a
+		 *							different queue you must ensure to provide the command buffer with a valid sync mask
+		 *							so it knows to wait before the write operation completes.
+		 *
+		 *							This value is a global queue index which encodes both the queue type and queue index.
+		 *							Retrieve it from CommandSyncMask::getGlobalQueueIdx().
 		 */
         virtual void writeData(UINT32 offset, UINT32 length, const void* source,
-				BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) = 0;
+				BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) = 0;
 
 		/**
 		 * Copies data from a specific portion of the source buffer into a specific portion of this buffer.
@@ -125,49 +133,48 @@ namespace BansheeEngine
 		 * @param[in]	length				Size of the data to copy, in bytes.
 		 * @param[in]	discardWholeBuffer	Specify true if the data in the current buffer can be entirely discarded. This
 		 *									may improve performance.
-		 * @param[in]	syncMask			Mask that determines how is the copy operation synchronized with other 
-		 *									operations on this resource. This corresponds to the sync mask property on a 
-		 *									CommandBuffer object. Setting a mask that's different from used command buffers
-		 *									allows the copy to be queued independantly from normal rendering commands, 
-		 *									allowing for async execution.
+		 * @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.
 		 *									
-		 *									It's up to the caller to ensure the usage is valid (e.g. not reading from
-		 *									something that is currently being written to, or writing to something that is
-		 *									currently being read).		
+		 *									Note that when writing to a buffer that is being used on a command buffer with a
+		 *									different queue you must ensure to provide the command buffer with a valid sync
+		 *									mask so it knows to wait before the write operation completes.
+		 *
+		 *									This value is a global queue index which encodes both the queue type and queue
+		 *									index. Retrieve it from CommandSyncMask::getGlobalQueueIdx().
 		 */
 		virtual void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, 
-			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false, UINT32 syncMask = 0x00000001)
+			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false, UINT32 queueIdx = 1)
 		{
 			const void *srcData = srcBuffer.lock(
-				srcOffset, length, GBL_READ_ONLY, syncMask);
-			this->writeData(dstOffset, length, srcData, discardWholeBuffer ? BWT_DISCARD : BWT_NORMAL, syncMask);
+				srcOffset, length, GBL_READ_ONLY, queueIdx);
+			this->writeData(dstOffset, length, srcData, discardWholeBuffer ? BWT_DISCARD : BWT_NORMAL, queueIdx);
 			srcBuffer.unlock();
 		}
 
 		/**
 		 * Copy data from the provided buffer into this buffer. If buffers are not the same size, smaller size will be used.
 		 * 
-		* @param[in]	syncMask			Mask that determines how is the copy operation synchronized with other 
-		 *									operations on this resource. This corresponds to the sync mask property on a 
-		 *									CommandBuffer object. Setting a mask that's different from used command buffers
-		 *									allows the copy to be queued independantly from normal rendering commands, 
-		 *									allowing for async execution.
-		 *									
-		 *									It's up to the caller to ensure the usage is valid (e.g. not reading from
-		 *									something that is currently being written to, or writing to something that is
-		 *									currently being read).		
+		 * @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.
+		 *
+		 *							Note that when writing to a buffer that is being used on a command buffer with a
+		 *							different queue you must ensure to provide the command buffer with a valid sync mask
+		 *							so it knows to wait before the write operation completes.
+		 *
+		 *							This value is a global queue index which encodes both the queue type and queue index.
+		 *							Retrieve it from CommandSyncMask::getGlobalQueueIdx().
 		 */
-		virtual void copyData(HardwareBuffer& srcBuffer, UINT32 syncMask = 0x00000001)
+		virtual void copyData(HardwareBuffer& srcBuffer, UINT32 queueIdx = 1)
 		{
-			UINT32 sz = std::min(getSizeInBytes(), srcBuffer.getSizeInBytes()); 
-			copyData(srcBuffer, 0, 0, sz, true, syncMask);
+			UINT32 sz = std::min(getSize(), srcBuffer.getSize());
+			copyData(srcBuffer, 0, 0, sz, true, queueIdx);
 		}
 			
 		/** Returns the size of this buffer in bytes. */
-        UINT32 getSizeInBytes() const { return mSizeInBytes; }
-
-		/**	Returns the Usage flags with which this buffer was created. */
-        GpuBufferUsage getUsage() const { return mUsage; }
+        UINT32 getSize() const { return mSize; }
 
 		/**	Returns whether or not this buffer is currently locked. */
         bool isLocked() const { return mIsLocked; }	
@@ -178,23 +185,21 @@ namespace BansheeEngine
 		/**
 		 * Constructs a new buffer.
 		 *
-		 * @param[in]	usage			Determines most common usage of the buffer. Usually has effect on what type of 
-		 *								memory will be buffer allocated in but that depends on render API. Specify dynamic 
-		 *								if you plan on modifying it often, static otherwise.
+		 * @param[in]	size			Size of the buffer, in bytes.
 		 */
-		HardwareBuffer(GpuBufferUsage usage)
-			: mUsage(usage), mIsLocked(false)
+		HardwareBuffer(UINT32 size)
+			: mSize(size), mIsLocked(false)
 		{  }
 
 		/** @copydoc lock */
-		virtual void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) = 0;
+		virtual void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) { return nullptr; }
 
 		/** @copydoc unlock */
-		virtual void unmap() = 0;
+		virtual void unmap() { }
 
 	protected:
-		UINT32 mSizeInBytes;
-		GpuBufferUsage mUsage;
+		UINT32 mSize;
+
 		bool mIsLocked;
 		UINT32 mLockStart;
 		UINT32 mLockSize;

+ 13 - 1
Source/BansheeCore/Source/BsGpuBuffer.cpp

@@ -7,6 +7,18 @@
 
 namespace BansheeEngine
 {
+	UINT32 getBufferSize(const GPU_BUFFER_DESC& desc)
+	{
+		UINT32 elementSize;
+
+		if (desc.type == GBT_STANDARD)
+			elementSize = GpuBuffer::getFormatSize(desc.format);
+		else
+			elementSize = desc.elementSize;
+
+		return elementSize * desc.elementCount;
+	}
+
 	GpuBufferProperties::GpuBufferProperties(const GPU_BUFFER_DESC& desc)
 		: mDesc(desc)
 	{
@@ -15,7 +27,7 @@ namespace BansheeEngine
 	}
 
 	GpuBufferCore::GpuBufferCore(const GPU_BUFFER_DESC& desc, UINT32 deviceMask)
-		: mProperties(desc)
+		:HardwareBuffer(getBufferSize(desc)), mProperties(desc)
 	{
 	}
 

+ 0 - 33
Source/BansheeCore/Source/BsGpuParamBlockBuffer.cpp

@@ -87,39 +87,6 @@ namespace BansheeEngine
 		return HardwareBufferCoreManager::instance().createGpuParamBlockBuffer(size, usage, deviceMask);
 	}
 
-	GenericGpuParamBlockBufferCore::GenericGpuParamBlockBufferCore(UINT32 size, GpuParamBlockUsage usage, 
-		GpuDeviceFlags deviceMask)
-		:GpuParamBlockBufferCore(size, usage, deviceMask), mData(nullptr)
-	{ }
-
-	GenericGpuParamBlockBufferCore::~GenericGpuParamBlockBufferCore()
-	{
-		if (mData != nullptr)
-			bs_free(mData);
-	}
-
-	void GenericGpuParamBlockBufferCore::writeToGPU(const UINT8* data)
-	{
-		memcpy(mData, data, mSize);
-	}
-
-	void GenericGpuParamBlockBufferCore::readFromGPU(UINT8* data) const
-	{
-		memcpy(data, mData, mSize);
-	}
-
-	void GenericGpuParamBlockBufferCore::initialize()
-	{
-		if (mSize > 0)
-			mData = (UINT8*)bs_alloc(mSize);
-		else
-			mData = nullptr;
-
-		memset(mData, 0, mSize);
-
-		GpuParamBlockBufferCore::initialize();
-	}
-
 	GpuParamBlockBuffer::GpuParamBlockBuffer(UINT32 size, GpuParamBlockUsage usage)
 		:mUsage(usage), mSize(size), mCachedData(nullptr)
 	{

+ 11 - 11
Source/BansheeCore/Source/BsIndexBuffer.cpp

@@ -6,25 +6,25 @@
 
 namespace BansheeEngine 
 {
-	IndexBufferProperties::IndexBufferProperties(IndexType idxType, UINT32 numIndices)
-		:mIndexType(idxType), mNumIndices(numIndices)
+	UINT32 calcIndexSize(IndexType type)
 	{
-		switch (mIndexType)
+		switch (type)
 		{
 		case IT_16BIT:
-			mIndexSize = sizeof(unsigned short);
-			break;
+			return sizeof(unsigned short);
+		default:
 		case IT_32BIT:
-			mIndexSize = sizeof(unsigned int);
-			break;
+			return sizeof(unsigned int);
 		}
 	}
 
+	IndexBufferProperties::IndexBufferProperties(IndexType idxType, UINT32 numIndices)
+		:mIndexType(idxType), mNumIndices(numIndices), mIndexSize(calcIndexSize(idxType))
+	{ }
+
 	IndexBufferCore::IndexBufferCore(const INDEX_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
-		:HardwareBuffer(desc.usage), mProperties(desc.indexType, desc.numIndices)
-	{ 
-		mSizeInBytes = mProperties.mIndexSize * mProperties.mNumIndices;
-	}
+		:HardwareBuffer(calcIndexSize(desc.indexType) * desc.numIndices), mProperties(desc.indexType, desc.numIndices)
+	{ }
 
 	SPtr<IndexBufferCore> IndexBufferCore::create(const INDEX_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
 	{

+ 5 - 5
Source/BansheeCore/Source/BsMesh.cpp

@@ -132,9 +132,9 @@ namespace BansheeEngine
 			return;
 		}
 
-		if (indicesSize > mIndexBuffer->getSizeInBytes())
+		if (indicesSize > mIndexBuffer->getSize())
 		{
-			indicesSize = mIndexBuffer->getSizeInBytes();
+			indicesSize = mIndexBuffer->getSize();
 			LOGERR("Index buffer values are being written out of valid range.");
 		}
 
@@ -165,9 +165,9 @@ namespace BansheeEngine
 			UINT32 bufferSize = meshData.getStreamSize(i);
 			UINT8* srcVertBufferData = meshData.getStreamData(i);
 
-			if (bufferSize > vertexBuffer->getSizeInBytes())
+			if (bufferSize > vertexBuffer->getSize())
 			{
-				bufferSize = vertexBuffer->getSizeInBytes();
+				bufferSize = vertexBuffer->getSize();
 				LOGERR("Vertex buffer values for stream \"" + toString(i) + "\" are being written out of valid range.");
 			}
 
@@ -277,7 +277,7 @@ namespace BansheeEngine
 				UINT32 numVerticesToCopy = meshData.getNumVertices();
 				UINT32 bufferSize = vbProps.getVertexSize() * numVerticesToCopy;
 
-				if (bufferSize > vertexBuffer->getSizeInBytes())
+				if (bufferSize > vertexBuffer->getSize())
 				{
 					LOGERR("Vertex buffer values for stream \"" + toString(streamIdx) + "\" are being read out of valid range.");
 					continue;

+ 3 - 7
Source/BansheeCore/Source/BsVertexBuffer.cpp

@@ -7,15 +7,11 @@ namespace BansheeEngine
 {
 	VertexBufferProperties::VertexBufferProperties(UINT32 numVertices, UINT32 vertexSize)
 		:mNumVertices(numVertices), mVertexSize(vertexSize)
-	{
-
-	}
+	{ }
 
 	VertexBufferCore::VertexBufferCore(const VERTEX_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
-		:HardwareBuffer(desc.usage), mProperties(desc.numVerts, desc.vertexSize)
-	{
-		mSizeInBytes = mProperties.mVertexSize * mProperties.mNumVertices;
-	}
+		:HardwareBuffer(mProperties.mVertexSize * mProperties.mNumVertices), mProperties(desc.numVerts, desc.vertexSize)
+	{ }
 
 	SPtr<VertexBufferCore> VertexBufferCore::create(const VERTEX_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
 	{

+ 5 - 5
Source/BansheeD3D11RenderAPI/Include/BsD3D11GpuBuffer.h

@@ -19,21 +19,21 @@ namespace BansheeEngine
 		~D3D11GpuBufferCore();
 
 		/** @copydoc GpuBufferCore::lock */
-		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options) override;
+		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::unlock */
 		void unlock() override;
 
 		/** @copydoc GpuBufferCore::readData */
-		void readData(UINT32 offset, UINT32 length, void* pDest) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::writeData */
         void writeData(UINT32 offset, UINT32 length, const void* pSource,
-			BufferWriteType writeFlags = BWT_NORMAL) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::copyData */
-		void copyData(GpuBufferCore& srcBuffer, UINT32 srcOffset, 
-			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false) override;
+		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, 
+			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 		/**
 		 * Creates a buffer view that may be used for binding a buffer to a slot in the pipeline. Views allow you to specify

+ 0 - 3
Source/BansheeD3D11RenderAPI/Include/BsD3D11GpuParamBlockBuffer.h

@@ -21,9 +21,6 @@ namespace BansheeEngine
 		/** @copydoc GpuParamBlockBufferCore::writeToGPU */
 		void writeToGPU(const UINT8* data) override;
 
-		/** @copydoc GpuParamBlockBufferCore::readFromGPU */
-		void readFromGPU(UINT8* data) const override;
-
 		/**	Returns internal DX11 buffer object. */
 		ID3D11Buffer* getD3D11Buffer() const;
 	protected:

+ 5 - 4
Source/BansheeD3D11RenderAPI/Include/BsD3D11HardwareBuffer.h

@@ -42,22 +42,22 @@ namespace BansheeEngine
 		~D3D11HardwareBuffer();
 
 		/** @copydoc HardwareBuffer::readData */
-		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc HardwareBuffer::writeData */
 		void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc HardwareBuffer::copyData */
 		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, 
-			UINT32 length, bool discardWholeBuffer = false, UINT32 syncMask = 0x00000001) override;
+			UINT32 length, bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 		/**	Returns the internal DX11 buffer object. */
 		ID3D11Buffer* getD3DBuffer() const { return mD3DBuffer; }
 
 	protected:
 		/** @copydoc HardwareBuffer::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc HardwareBuffer::unmap */
 		void unmap() override;
@@ -67,6 +67,7 @@ namespace BansheeEngine
 		bool mUseCounter;
 		UINT32 mElementCount;
 		UINT32 mElementSize;
+		GpuBufferUsage mUsage;
 
 		ID3D11Buffer* mD3DBuffer;
 

+ 6 - 4
Source/BansheeD3D11RenderAPI/Include/BsD3D11IndexBuffer.h

@@ -21,22 +21,22 @@ namespace BansheeEngine
 		~D3D11IndexBufferCore();
 
 		/** @copydoc IndexBufferCore::readData */
-		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc IndexBufferCore::writeData */
 		void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc IndexBufferCore::copyData */
 		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, UINT32 length, 
-			bool discardWholeBuffer = false, UINT32 syncMask = 0x00000001) override;
+			bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 		/**	Gets the internal DX11 index buffer object. */
 		ID3D11Buffer* getD3DIndexBuffer() const { return mBuffer->getD3DBuffer(); }		
 
 	protected:
 		/** @copydoc IndexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc IndexBufferCore::unmap */
 		void unmap() override;
@@ -46,6 +46,8 @@ namespace BansheeEngine
 
 		D3D11HardwareBuffer* mBuffer;
 		D3D11Device& mDevice;
+		GpuBufferUsage mUsage;
+
 	};
 
 	/** @} */

+ 5 - 4
Source/BansheeD3D11RenderAPI/Include/BsD3D11VertexBuffer.h

@@ -21,22 +21,22 @@ namespace BansheeEngine
 		~D3D11VertexBufferCore();
 
 		/** @copydoc VertexBufferCore::readData */
-		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc VertexBufferCore::writeData */
 		void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc VertexBufferCore::copyData */
 		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, UINT32 length, 
-			bool discardWholeBuffer = false, UINT32 syncMask = 0x00000001) override;
+			bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 		/**	Get the D3D-specific index buffer */
 		ID3D11Buffer* getD3DVertexBuffer() const { return mBuffer->getD3DBuffer(); }		
 
 	protected: 
 		/** @copydoc VertexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc VertexBufferCore::unmap */
 		void unmap(void) override;
@@ -47,6 +47,7 @@ namespace BansheeEngine
 		D3D11HardwareBuffer* mBuffer;
 		D3D11Device& mDevice;
 		bool mStreamOut;
+		GpuBufferUsage mUsage;
 	};
 
 	/** @} */

+ 8 - 7
Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuBuffer.cpp

@@ -71,7 +71,7 @@ namespace BansheeEngine
 		GpuBufferCore::initialize();
 	}
 
-	void* D3D11GpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options)
+	void* D3D11GpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
@@ -93,22 +93,23 @@ namespace BansheeEngine
 		mBuffer->unlock();
 	}
 
-	void D3D11GpuBufferCore::readData(UINT32 offset, UINT32 length, void* pDest)
+	void D3D11GpuBufferCore::readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuBuffer);
 
-		mBuffer->readData(offset, length, pDest);
+		mBuffer->readData(offset, length, dest);
 	}
 
-	void D3D11GpuBufferCore::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags)
+	void D3D11GpuBufferCore::writeData(UINT32 offset, UINT32 length, const void* source, BufferWriteType writeFlags, 
+		UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_GpuBuffer);
 
-		mBuffer->writeData(offset, length, pSource, writeFlags);
+		mBuffer->writeData(offset, length, source, writeFlags);
 	}
 
-	void D3D11GpuBufferCore::copyData(GpuBufferCore& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer)
+	void D3D11GpuBufferCore::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 		D3D11GpuBufferCore* d3d11SrcBuffer = static_cast<D3D11GpuBufferCore*>(&srcBuffer);
 

+ 0 - 7
Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuParamBlockBuffer.cpp

@@ -52,11 +52,4 @@ namespace BansheeEngine
 
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_GpuParamBuffer);
 	}
-
-	void D3D11GpuParamBlockBufferCore::readFromGPU(UINT8* data) const
-	{
-		mBuffer->readData(0, mSize, data);
-
-		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuParamBuffer);
-	}
 }

+ 16 - 17
Source/BansheeD3D11RenderAPI/Source/BsD3D11HardwareBuffer.cpp

@@ -10,9 +10,9 @@ namespace BansheeEngine
 {
 	D3D11HardwareBuffer::D3D11HardwareBuffer(BufferType btype, GpuBufferUsage usage, UINT32 elementCount, UINT32 elementSize, 
 		D3D11Device& device, bool useSystemMem, bool streamOut, bool randomGpuWrite, bool useCounter)
-		: HardwareBuffer(usage), mD3DBuffer(nullptr), mpTempStagingBuffer(nullptr), mUseTempStagingBuffer(false),
-		 mBufferType(btype), mDevice(device), mElementCount(elementCount), mElementSize(elementSize), mRandomGpuWrite(randomGpuWrite),
-		 mUseCounter(useCounter)
+		: HardwareBuffer(elementCount * elementSize), mD3DBuffer(nullptr), mpTempStagingBuffer(nullptr)
+		, mUseTempStagingBuffer(false), mBufferType(btype), mDevice(device), mElementCount(elementCount)
+		, mElementSize(elementSize), mUsage(usage), mRandomGpuWrite(randomGpuWrite), mUseCounter(useCounter)
 	{
 		assert((!streamOut || btype == BT_VERTEX) && "Stream out flag is only supported on vertex buffers.");
 		assert(!randomGpuWrite || (btype & BT_GROUP_GENERIC) != 0 && "randomGpuWrite flag can only be enabled with standard, append/consume, indirect argument, structured or raw buffers.");
@@ -22,8 +22,7 @@ namespace BansheeEngine
 		assert(!randomGpuWrite || !useSystemMem && "randomGpuWrite and useSystemMem cannot be used together.");
 		assert(!(useSystemMem && streamOut) && "useSystemMem and streamOut cannot be used together.");
 
-		mSizeInBytes = elementCount * elementSize;
-		mDesc.ByteWidth = mSizeInBytes;
+		mDesc.ByteWidth = getSize();
 		mDesc.MiscFlags = 0;
 		mDesc.StructureByteStride = 0;
 
@@ -41,8 +40,8 @@ namespace BansheeEngine
 		}
 		else
 		{
-			mDesc.Usage = D3D11Mappings::getUsage(mUsage);
-			mDesc.CPUAccessFlags = D3D11Mappings::getAccessFlags(mUsage); 
+			mDesc.Usage = D3D11Mappings::getUsage(usage);
+			mDesc.CPUAccessFlags = D3D11Mappings::getAccessFlags(usage); 
 
 			switch(btype)
 			{
@@ -90,10 +89,10 @@ namespace BansheeEngine
 			bs_delete(mpTempStagingBuffer);
 	}
 
-	void* D3D11HardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask)
+	void* D3D11HardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
-		if (length > mSizeInBytes)
-			BS_EXCEPT(RenderingAPIException, "Provided length " + toString(length) + " larger than the buffer " + toString(mSizeInBytes) + ".");		
+		if (length > mSize)
+			BS_EXCEPT(RenderingAPIException, "Provided length " + toString(length) + " larger than the buffer " + toString(mSize) + ".");		
 
 		// Use direct (and faster) Map/Unmap if dynamic write, or a staging read/write
 		if((mDesc.Usage == D3D11_USAGE_DYNAMIC && options != GBL_READ_ONLY) || mDesc.Usage == D3D11_USAGE_STAGING)
@@ -179,12 +178,12 @@ namespace BansheeEngine
 			if (!mpTempStagingBuffer)
 			{
 				// Create another buffer instance but use system memory
-				mpTempStagingBuffer = bs_new<D3D11HardwareBuffer>(mBufferType, mUsage, 1, mSizeInBytes, std::ref(mDevice), true);
+				mpTempStagingBuffer = bs_new<D3D11HardwareBuffer>(mBufferType, mUsage, 1, mSize, std::ref(mDevice), true);
 			}
 
 			// Schedule a copy to the staging
 			if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
-				mpTempStagingBuffer->copyData(*this, 0, 0, mSizeInBytes, true);
+				mpTempStagingBuffer->copyData(*this, 0, 0, mSize, true);
 
 			// Register whether we'll need to upload on unlock
 			mStagingUploadNeeded = (options != GBL_READ_ONLY);
@@ -202,7 +201,7 @@ namespace BansheeEngine
 			mpTempStagingBuffer->unlock();
 
 			if (mStagingUploadNeeded)
-				copyData(*mpTempStagingBuffer, 0, 0, mSizeInBytes, true);
+				copyData(*mpTempStagingBuffer, 0, 0, mSize, true);
 
 			if(mpTempStagingBuffer != nullptr)
 			{
@@ -217,11 +216,11 @@ namespace BansheeEngine
 	}
 
 	void D3D11HardwareBuffer::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, 
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 syncMask)
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 		// If we're copying same-size buffers in their entirety
 		if (srcOffset == 0 && dstOffset == 0 &&
-			length == mSizeInBytes && mSizeInBytes == srcBuffer.getSizeInBytes())
+			length == mSize && mSize == srcBuffer.getSize())
 		{
 			mDevice.getImmediateContext()->CopyResource(mD3DBuffer, static_cast<D3D11HardwareBuffer&>(srcBuffer).getD3DBuffer());
 			if (mDevice.hasError())
@@ -251,7 +250,7 @@ namespace BansheeEngine
 		}
 	}
 
-	void D3D11HardwareBuffer::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 syncMask)
+	void D3D11HardwareBuffer::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 queueIdx)
 	{
 		// There is no functional interface in D3D, just do via manual lock, copy & unlock
 		void* pSrc = this->lock(offset, length, GBL_READ_ONLY);
@@ -260,7 +259,7 @@ namespace BansheeEngine
 	}
 
 	void D3D11HardwareBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, 
-		UINT32 syncMask)
+		UINT32 queueIdx)
 	{
 		if(mDesc.Usage == D3D11_USAGE_DYNAMIC || mDesc.Usage == D3D11_USAGE_STAGING)
 		{

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

@@ -8,7 +8,7 @@ namespace BansheeEngine
 {
 	D3D11IndexBufferCore::D3D11IndexBufferCore(D3D11Device& device, const INDEX_BUFFER_DESC& desc, 
 		GpuDeviceFlags deviceMask)
-		:IndexBufferCore(desc, deviceMask), mDevice(device), mBuffer(nullptr)
+		:IndexBufferCore(desc, deviceMask), mBuffer(nullptr), mDevice(device), mUsage(desc.usage)
 	{
 		assert((deviceMask == GDF_DEFAULT || deviceMask == GDF_PRIMARY) && "Multiple GPUs not supported natively on DirectX.");
 	}
@@ -23,13 +23,13 @@ namespace BansheeEngine
 
 	void D3D11IndexBufferCore::initialize()
 	{
-		mBuffer = bs_new<D3D11HardwareBuffer>(D3D11HardwareBuffer::BT_INDEX, mUsage, 1, mSizeInBytes, std::ref(mDevice), false);
+		mBuffer = bs_new<D3D11HardwareBuffer>(D3D11HardwareBuffer::BT_INDEX, mUsage, 1, mSize, std::ref(mDevice), false);
 
 		BS_INC_RENDER_STAT_CAT(ResCreated, RenderStatObject_IndexBuffer);
 		IndexBufferCore::initialize();
 	}
 
-	void* D3D11IndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask)
+	void* D3D11IndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
@@ -51,14 +51,14 @@ namespace BansheeEngine
 		mBuffer->unlock();
 	}
 
-	void D3D11IndexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 syncMask)
+	void D3D11IndexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 queueIdx)
 	{
 		mBuffer->readData(offset, length, pDest);
 
 		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_IndexBuffer);
 	}
 
-	void D3D11IndexBufferCore::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, UINT32 syncMask)
+	void D3D11IndexBufferCore::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, UINT32 queueIdx)
 	{
 		mBuffer->writeData(offset, length, pSource, writeFlags);
 
@@ -66,7 +66,7 @@ namespace BansheeEngine
 	}
 
 	void D3D11IndexBufferCore::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 syncMask)
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 		mBuffer->copyData(srcBuffer, srcOffset, dstOffset, length, discardWholeBuffer);
 	}

+ 7 - 6
Source/BansheeD3D11RenderAPI/Source/BsD3D11VertexBuffer.cpp

@@ -8,7 +8,8 @@ namespace BansheeEngine
 {
 	D3D11VertexBufferCore::D3D11VertexBufferCore(D3D11Device& device, const VERTEX_BUFFER_DESC& desc, 
 		GpuDeviceFlags deviceMask)
-		:VertexBufferCore(desc, deviceMask), mDevice(device), mStreamOut(desc.streamOut), mBuffer(nullptr)
+		: VertexBufferCore(desc, deviceMask), mBuffer(nullptr), mDevice(device), mStreamOut(desc.streamOut)
+		, mUsage(desc.usage)
 	{
 		assert((deviceMask == GDF_DEFAULT || deviceMask == GDF_PRIMARY) && "Multiple GPUs not supported natively on DirectX 11.");
 	}
@@ -21,7 +22,7 @@ namespace BansheeEngine
 		BS_INC_RENDER_STAT_CAT(ResDestroyed, RenderStatObject_VertexBuffer);
 	}
 
-	void* D3D11VertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask)
+	void* D3D11VertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
@@ -43,21 +44,21 @@ namespace BansheeEngine
 		mBuffer->unlock();
 	}
 
-	void D3D11VertexBufferCore::readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask)
+	void D3D11VertexBufferCore::readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx)
 	{
 		mBuffer->readData(offset, length, dest);
 		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_VertexBuffer);
 	}
 
 	void D3D11VertexBufferCore::writeData(UINT32 offset, UINT32 length, const void* source, BufferWriteType writeFlags, 
-		UINT32 syncMask)
+		UINT32 queueIdx)
 	{
 		mBuffer->writeData(offset, length, source, writeFlags);
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_VertexBuffer);
 	}
 
 	void D3D11VertexBufferCore::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 syncMask)
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 		mBuffer->copyData(srcBuffer, srcOffset, dstOffset, length, discardWholeBuffer);
 	}
@@ -65,7 +66,7 @@ namespace BansheeEngine
 	void D3D11VertexBufferCore::initialize()
 	{
 		mBuffer = bs_new<D3D11HardwareBuffer>(D3D11HardwareBuffer::BT_VERTEX, 
-			mUsage, 1, mSizeInBytes, std::ref(mDevice), false, mStreamOut);
+											  mUsage, 1, mSize, std::ref(mDevice), false, mStreamOut);
 
 		BS_INC_RENDER_STAT_CAT(ResCreated, RenderStatObject_VertexBuffer);
 		VertexBufferCore::initialize();

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

@@ -19,21 +19,21 @@ namespace BansheeEngine
 		~GLGpuBufferCore();
 
 		/** @copydoc GpuBufferCore::lock */
-		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options) override;
+		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::unlock */
 		void unlock() override;
 
 		/** @copydoc GpuBufferCore::readData */
-        void readData(UINT32 offset, UINT32 length, void* pDest) override;
+        void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::writeData */
         void writeData(UINT32 offset, UINT32 length, const void* pSource,
-				BufferWriteType writeFlags = BWT_NORMAL) override;
+				BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::copyData */
-		void copyData(GpuBufferCore& srcBuffer, UINT32 srcOffset,
-			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false) override;
+		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
+			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 		/**	
 		 * Returns internal OpenGL buffer ID. If binding the buffer to the pipeline, bind the texture using

+ 0 - 3
Source/BansheeGLRenderAPI/Include/BsGLGpuParamBlockBuffer.h

@@ -21,9 +21,6 @@ namespace BansheeEngine
 		/** @copydoc GpuParamBlockBufferCore::writeToGPU */
 		void writeToGPU(const UINT8* data) override;
 
-		/** @copydoc GpuParamBlockBufferCore::readFromGPU */
-		void readFromGPU(UINT8* data) const override;
-
 		/**	Returns internal OpenGL uniform buffer handle. */
 		GLuint getGLHandle() const { return mGLHandle; }
 	protected:

+ 3 - 3
Source/BansheeGLRenderAPI/Include/BsGLIndexBuffer.h

@@ -20,11 +20,11 @@ namespace BansheeEngine
 		~GLIndexBufferCore();
 
 		/** @copydoc IndexBufferCore::readData */
-        void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+        void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc IndexBufferCore::writeData */
         void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/**	Returns internal OpenGL index buffer handle. */
         GLuint getGLBufferId() const { return mBuffer.getGLBufferId(); }
@@ -34,7 +34,7 @@ namespace BansheeEngine
 		void initialize() override;	
 
 		/** @copydoc IndexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc IndexBufferCore::unmap */
 		void unmap() override;

+ 3 - 3
Source/BansheeGLRenderAPI/Include/BsGLVertexBuffer.h

@@ -21,11 +21,11 @@ namespace BansheeEngine
 		~GLVertexBufferCore();
 
 		/** @copydoc VertexBufferCore::readData */
-        void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+        void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc VertexBufferCore::writeData */
         void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/**	Returns internal OpenGL buffer ID. */
         GLuint getGLBufferId() const { return mBuffer.getGLBufferId(); }
@@ -41,7 +41,7 @@ namespace BansheeEngine
 		void initialize() override;
 
 		/** @copydoc VertexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc VertexBufferCore::unmap */
 		void unmap() override;

+ 10 - 8
Source/BansheeGLRenderAPI/Source/BsGLGpuBuffer.cpp

@@ -48,7 +48,7 @@ namespace BansheeEngine
 		GpuBufferCore::initialize();
 	}
 
-	void* GLGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options)
+	void* GLGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
@@ -56,7 +56,8 @@ namespace BansheeEngine
 			BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuBuffer);
 		}
 
-		if (options == GBL_READ_WRITE || options == GBL_WRITE_ONLY || options == GBL_WRITE_ONLY_DISCARD || options == GBL_WRITE_ONLY_NO_OVERWRITE)
+		if (options == GBL_READ_WRITE || options == GBL_WRITE_ONLY || options == GBL_WRITE_ONLY_DISCARD 
+			|| options == GBL_WRITE_ONLY_NO_OVERWRITE)
 		{
 			BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_GpuBuffer);
 		}
@@ -70,22 +71,23 @@ namespace BansheeEngine
 		mBuffer.unlock();
 	}
 
-	void GLGpuBufferCore::readData(UINT32 offset, UINT32 length, void* pDest)
+	void GLGpuBufferCore::readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx)
 	{
-		mBuffer.readData(offset, length, pDest);
+		mBuffer.readData(offset, length, dest);
 
 		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuBuffer);
 	}
 
-	void GLGpuBufferCore::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags)
+	void GLGpuBufferCore::writeData(UINT32 offset, UINT32 length, const void* source, BufferWriteType writeFlags,
+									UINT32 queueIdx)
 	{
-		mBuffer.writeData(offset, length, pSource, writeFlags);
+		mBuffer.writeData(offset, length, source, writeFlags);
 
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_GpuBuffer);
 	}
 
-	void GLGpuBufferCore::copyData(GpuBufferCore& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer)
+	void GLGpuBufferCore::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
+								   UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 		GLGpuBufferCore& glSrcBuffer = static_cast<GLGpuBufferCore&>(srcBuffer);
 

+ 0 - 9
Source/BansheeGLRenderAPI/Source/BsGLGpuParamBlockBuffer.cpp

@@ -44,13 +44,4 @@ namespace BansheeEngine
 
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_GpuParamBuffer);
 	}
-
-	void GLGpuParamBlockBufferCore::readFromGPU(UINT8* data) const
-	{
-		glBindBuffer(GL_UNIFORM_BUFFER, mGLHandle);
-		glGetBufferSubData(GL_UNIFORM_BUFFER, 0 , mSize, (GLvoid*)data);
-		glBindBuffer(GL_UNIFORM_BUFFER, 0);
-
-		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuParamBuffer);
-	}
 }

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

@@ -26,7 +26,7 @@ namespace BansheeEngine
 		IndexBufferCore::initialize();
 	}
 
-	void* GLIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask)
+	void* GLIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 		return mBuffer.lock(offset, length, options);
 	}
@@ -36,13 +36,13 @@ namespace BansheeEngine
 		mBuffer.unlock();
 	}
 
-	void GLIndexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 syncMask)
+	void GLIndexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 queueIdx)
 	{
 		mBuffer.readData(offset, length, pDest);
 	}
 
 	void GLIndexBufferCore::writeData(UINT32 offset, UINT32 length,
-		const void* pSource, BufferWriteType writeFlags, UINT32 syncMask)
+		const void* pSource, BufferWriteType writeFlags, UINT32 queueIdx)
 	{
 		mBuffer.writeData(offset, length, pSource, writeFlags);
 	}

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

@@ -43,7 +43,7 @@ namespace BansheeEngine
 			mVAObjects.erase(iterFind);
 	}
 
-	void* GLVertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask)
+	void* GLVertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
     {
 		return mBuffer.lock(offset, length, options);
     }
@@ -53,13 +53,13 @@ namespace BansheeEngine
 		mBuffer.unlock();
     }
 
-	void GLVertexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 syncMask)
+	void GLVertexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 queueIdx)
     {
 		mBuffer.readData(offset, length, pDest);
     }
 
 	void GLVertexBufferCore::writeData(UINT32 offset, UINT32 length,
-		const void* pSource, BufferWriteType writeFlags, UINT32 syncMask)
+		const void* pSource, BufferWriteType writeFlags, UINT32 queueIdx)
     {
 		mBuffer.writeData(offset, length, pSource, writeFlags);
     }

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

@@ -18,21 +18,21 @@ namespace BansheeEngine
 		~VulkanGpuBufferCore();
 
 		/** @copydoc GpuBufferCore::lock */
-		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options) override;
+		void* lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::unlock */
 		void unlock() override;
 
 		/** @copydoc GpuBufferCore::readData */
-		void readData(UINT32 offset, UINT32 length, void* pDest) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::writeData */
-        void writeData(UINT32 offset, UINT32 length, const void* pSource,
-			BufferWriteType writeFlags = BWT_NORMAL) override;
+        void writeData(UINT32 offset, UINT32 length, const void* source,
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc GpuBufferCore::copyData */
-		void copyData(GpuBufferCore& srcBuffer, UINT32 srcOffset, 
-			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false) override;
+		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, 
+			UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 		
 		/** 
 		 * Gets the resource wrapping the buffer object, on the specified device. If GPU param block buffer's device mask

+ 0 - 3
Source/BansheeVulkanRenderAPI/Include/BsVulkanGpuParamBlockBuffer.h

@@ -21,9 +21,6 @@ namespace BansheeEngine
 		/** @copydoc GpuParamBlockBufferCore::writeToGPU */
 		void writeToGPU(const UINT8* data) override;
 
-		/** @copydoc GpuParamBlockBufferCore::readFromGPU */
-		void readFromGPU(UINT8* data) const override;
-
 		/** 
 		 * Gets the resource wrapping the buffer object, on the specified device. If GPU param block buffer's device mask
 		 * doesn't include the provided device, null is returned. 

+ 4 - 4
Source/BansheeVulkanRenderAPI/Include/BsVulkanHardwareBuffer.h

@@ -57,15 +57,15 @@ namespace BansheeEngine
 		~VulkanHardwareBuffer();
 
 		/** @copydoc HardwareBuffer::readData */
-		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc HardwareBuffer::writeData */
 		void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc HardwareBuffer::copyData */
 		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, 
-			UINT32 length, bool discardWholeBuffer = false, UINT32 syncMask = 0x00000001) override;
+			UINT32 length, bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 		/** 
 		 * Gets the resource wrapping the buffer object, on the specified device. If hardware buffer device mask doesn't 
@@ -75,7 +75,7 @@ namespace BansheeEngine
 
 	protected:
 		/** @copydoc HardwareBuffer::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc HardwareBuffer::unmap */
 		void unmap() override;

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

@@ -20,19 +20,19 @@ namespace BansheeEngine
 		~VulkanIndexBufferCore();
 
 		/** @copydoc IndexBufferCore::readData */
-		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc IndexBufferCore::writeData */
 		void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc IndexBufferCore::copyData */
 		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, UINT32 length, 
-			bool discardWholeBuffer = false, UINT32 syncMask = 0x00000001) override;
+			bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 	protected:
 		/** @copydoc IndexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc IndexBufferCore::unmap */
 		void unmap() override;

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

@@ -19,19 +19,19 @@ namespace BansheeEngine
 		~VulkanVertexBufferCore();
 
 		/** @copydoc VertexBufferCore::readData */
-		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask = 0x00000001) override;
+		void readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx = 1) override;
 
 		/** @copydoc VertexBufferCore::writeData */
 		void writeData(UINT32 offset, UINT32 length, const void* source, 
-			BufferWriteType writeFlags = BWT_NORMAL, UINT32 syncMask = 0x00000001) override;
+			BufferWriteType writeFlags = BWT_NORMAL, UINT32 queueIdx = 1) override;
 
 		/** @copydoc VertexBufferCore::copyData */
 		void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, UINT32 length, 
-			bool discardWholeBuffer = false, UINT32 syncMask = 0x00000001) override;
+			bool discardWholeBuffer = false, UINT32 queueIdx = 1) override;
 
 	protected: 
 		/** @copydoc VertexBufferCore::map */
-		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask) override;
+		void* map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx) override;
 
 		/** @copydoc VertexBufferCore::unmap */
 		void unmap(void) override;

+ 6 - 5
Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuBuffer.cpp

@@ -42,7 +42,7 @@ namespace BansheeEngine
 		GpuBufferCore::initialize();
 	}
 
-	void* VulkanGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options)
+	void* VulkanGpuBufferCore::lock(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
@@ -64,18 +64,19 @@ namespace BansheeEngine
 		
 	}
 
-	void VulkanGpuBufferCore::readData(UINT32 offset, UINT32 length, void* pDest)
+	void VulkanGpuBufferCore::readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuBuffer);
 	}
 
-	void VulkanGpuBufferCore::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags)
+	void VulkanGpuBufferCore::writeData(UINT32 offset, UINT32 length, const void* source, BufferWriteType writeFlags,
+										UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_GpuBuffer);
 	}
 
-	void VulkanGpuBufferCore::copyData(GpuBufferCore& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer)
+	void VulkanGpuBufferCore::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 
 	}

+ 0 - 5
Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuParamBlockBuffer.cpp

@@ -35,11 +35,6 @@ namespace BansheeEngine
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_GpuParamBuffer);
 	}
 
-	void VulkanGpuParamBlockBufferCore::readFromGPU(UINT8* data) const
-	{
-		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_GpuParamBuffer);
-	}
-
 	VulkanBuffer* VulkanGpuParamBlockBufferCore::getResource(UINT32 deviceIdx) const
 	{
 		return mBuffer->getResource(deviceIdx);

+ 5 - 4
Source/BansheeVulkanRenderAPI/Source/BsVulkanHardwareBuffer.cpp

@@ -129,7 +129,7 @@ namespace BansheeEngine
 		}
 	}
 
-	void* VulkanHardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask)
+	void* VulkanHardwareBuffer::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 		if ((offset + length) > mSizeInBytes)
 			BS_EXCEPT(RenderingAPIException, "Provided offset(" + toString(offset) + ") + length(" + toString(length) + ") "
@@ -163,17 +163,18 @@ namespace BansheeEngine
 	}
 
 	void VulkanHardwareBuffer::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 syncMask)
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 
 	}
 
-	void VulkanHardwareBuffer::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 syncMask)
+	void VulkanHardwareBuffer::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 queueIdx)
 	{
 		
 	}
 
-	void VulkanHardwareBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, UINT32 syncMask)
+	void VulkanHardwareBuffer::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, 
+		UINT32 queueIdx)
 	{
 		
 	}

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

@@ -22,7 +22,7 @@ namespace BansheeEngine
 		IndexBufferCore::initialize();
 	}
 
-	void* VulkanIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 syncMask)
+	void* VulkanIndexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
@@ -45,18 +45,18 @@ namespace BansheeEngine
 
 	}
 
-	void VulkanIndexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 syncMask)
+	void VulkanIndexBufferCore::readData(UINT32 offset, UINT32 length, void* pDest, UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_IndexBuffer);
 	}
 
-	void VulkanIndexBufferCore::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, UINT32 syncMask)
+	void VulkanIndexBufferCore::writeData(UINT32 offset, UINT32 length, const void* pSource, BufferWriteType writeFlags, UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_IndexBuffer);
 	}
 
 	void VulkanIndexBufferCore::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 syncMask)
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 
 	}

+ 4 - 4
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 syncMask)
+	void* VulkanVertexBufferCore::map(UINT32 offset, UINT32 length, GpuLockOptions options, UINT32 queueIdx)
 	{
 #if BS_PROFILING_ENABLED
 		if (options == GBL_READ_ONLY || options == GBL_READ_WRITE)
@@ -36,19 +36,19 @@ namespace BansheeEngine
 
 	}
 
-	void VulkanVertexBufferCore::readData(UINT32 offset, UINT32 length, void* dest, UINT32 syncMask)
+	void VulkanVertexBufferCore::readData(UINT32 offset, UINT32 length, void* dest, UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResRead, RenderStatObject_VertexBuffer);
 	}
 
 	void VulkanVertexBufferCore::writeData(UINT32 offset, UINT32 length, const void* source, BufferWriteType writeFlags, 
-		UINT32 syncMask)
+		UINT32 queueIdx)
 	{
 		BS_INC_RENDER_STAT_CAT(ResWrite, RenderStatObject_VertexBuffer);
 	}
 
 	void VulkanVertexBufferCore::copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset,
-		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 syncMask)
+		UINT32 dstOffset, UINT32 length, bool discardWholeBuffer, UINT32 queueIdx)
 	{
 
 	}