BsVulkanGpuParamBlockBuffer.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 "BsGpuParamBlockBuffer.h"
  6. namespace bs
  7. {
  8. /** @addtogroup Vulkan
  9. * @{
  10. */
  11. /** Vulkan implementation of a parameter block buffer (uniform buffer in Vulkan lingo). */
  12. class VulkanGpuParamBlockBufferCore : public GpuParamBlockBufferCore
  13. {
  14. public:
  15. VulkanGpuParamBlockBufferCore(UINT32 size, GpuParamBlockUsage usage, GpuDeviceFlags deviceMask);
  16. ~VulkanGpuParamBlockBufferCore();
  17. /** @copydoc GpuParamBlockBufferCore::writeToGPU */
  18. void writeToGPU(const UINT8* data, UINT32 queueIdx = 0) override;
  19. /**
  20. * Gets the resource wrapping the buffer object, on the specified device. If GPU param block buffer's device mask
  21. * doesn't include the provided device, null is returned.
  22. */
  23. VulkanBuffer* getResource(UINT32 deviceIdx) const;
  24. protected:
  25. /** @copydoc GpuParamBlockBufferCore::initialize */
  26. void initialize() override;
  27. private:
  28. VulkanHardwareBuffer* mBuffer;
  29. GpuDeviceFlags mDeviceMask;
  30. };
  31. /** @} */
  32. }