BsVulkanIndexBuffer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 "BsIndexBuffer.h"
  6. #include "BsVulkanHardwareBuffer.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup Vulkan
  10. * @{
  11. */
  12. /** Vulkan implementation of an index buffer. */
  13. class VulkanIndexBufferCore : public IndexBufferCore
  14. {
  15. public:
  16. VulkanIndexBufferCore(const INDEX_BUFFER_DESC& desc, GpuDeviceFlags deviceMask);
  17. ~VulkanIndexBufferCore();
  18. /** @copydoc IndexBufferCore::readData */
  19. void readData(UINT32 offset, UINT32 length, void* dest) override;
  20. /** @copydoc IndexBufferCore::writeData */
  21. void writeData(UINT32 offset, UINT32 length, const void* source,
  22. BufferWriteType writeFlags = BufferWriteType::Normal) override;
  23. /** @copydoc IndexBufferCore::copyData */
  24. void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, UINT32 length,
  25. bool discardWholeBuffer = false) override;
  26. protected:
  27. /** @copydoc IndexBufferCore::map */
  28. void* map(UINT32 offset, UINT32 length, GpuLockOptions options) override;
  29. /** @copydoc IndexBufferCore::unmap */
  30. void unmap() override;
  31. /** @copydoc IndexBufferCore::initialize */
  32. void initialize() override;
  33. };
  34. /** @} */
  35. }