BsVulkanHardwareBuffer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsVulkanPrerequisites.h"
  5. #include "BsHardwareBuffer.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Vulkan
  9. * @{
  10. */
  11. /** Class containing common functionality for all Vulkan hardware buffers. */
  12. class VulkanHardwareBuffer : public HardwareBuffer
  13. {
  14. public:
  15. VulkanHardwareBuffer(GpuBufferUsage usage, UINT32 elementCount, UINT32 elementSize, bool systemMemory = false,
  16. bool streamOut = false, bool randomGpuWrite = false, bool useCounter = false);
  17. ~VulkanHardwareBuffer();
  18. /** @copydoc HardwareBuffer::readData */
  19. void readData(UINT32 offset, UINT32 length, void* dest) override;
  20. /** @copydoc HardwareBuffer::writeData */
  21. void writeData(UINT32 offset, UINT32 length, const void* source,
  22. BufferWriteType writeFlags = BufferWriteType::Normal) override;
  23. /** @copydoc HardwareBuffer::copyData */
  24. void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset,
  25. UINT32 length, bool discardWholeBuffer = false) override;
  26. protected:
  27. /** @copydoc HardwareBuffer::map */
  28. void* map(UINT32 offset, UINT32 length, GpuLockOptions options) override;
  29. /** @copydoc HardwareBuffer::unmap */
  30. void unmap() override;
  31. bool mRandomGpuWrite;
  32. bool mUseCounter;
  33. UINT32 mElementCount;
  34. UINT32 mElementSize;
  35. };
  36. /** @} */
  37. }