BsVulkanGpuPipelineParamInfo.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 "BsGpuPipelineParamInfo.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Vulkan
  9. * @{
  10. */
  11. /** Holds meta-data about a set of GPU parameters used by a single pipeline state. */
  12. class VulkanGpuPipelineParamInfo : public GpuPipelineParamInfoCore
  13. {
  14. public:
  15. VulkanGpuPipelineParamInfo(const GPU_PIPELINE_PARAMS_DESC& desc, GpuDeviceFlags deviceMask);
  16. ~VulkanGpuPipelineParamInfo();
  17. /** Returns the number of bindings present at the layout at the specified index. */
  18. UINT32 getNumBindings(UINT32 layoutIdx) const { return mLayoutInfos[layoutIdx].numBindings; }
  19. /** Returns a pointer to an array of bindings for the layout at the specified index. */
  20. VkDescriptorSetLayoutBinding* getBindings(UINT32 layoutIdx) const { return mLayoutInfos[layoutIdx].bindings; }
  21. /**
  22. * Returns a layout for the specified device, at the specified index. Returns null if no layout for the specified
  23. * device index.
  24. */
  25. VulkanDescriptorLayout* getLayout(UINT32 deviceIdx, UINT32 layoutIdx) const;
  26. private:
  27. /** @copydoc GpuPipelineParamInfoCore::initialize */
  28. void initialize() override;
  29. /** Data related to a single descriptor set layout. */
  30. struct LayoutInfo
  31. {
  32. VkDescriptorSetLayoutBinding* bindings;
  33. UINT32 numBindings;
  34. };
  35. GpuDeviceFlags mDeviceMask;
  36. VulkanDescriptorLayout** mLayouts[BS_MAX_DEVICES];
  37. LayoutInfo* mLayoutInfos;
  38. UINT8* mData;
  39. };
  40. /** @} */
  41. }