BsVulkanGpuParams.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "BsGpuParams.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Vulkan
  9. * @{
  10. */
  11. /** Vulkan implementation of GpuParams, containing resource descriptors for all shader stages. */
  12. class VulkanGpuParams : public GpuParamsCore
  13. {
  14. public:
  15. ~VulkanGpuParams();
  16. /** @copydoc GpuParamsCore::setParamBlockBuffer(UINT32, UINT32, const ParamsBufferType&) */
  17. void setParamBlockBuffer(UINT32 set, UINT32 slot, const ParamsBufferType& paramBlockBuffer) override;
  18. /** @copydoc GpuParamsCore::setTexture */
  19. void setTexture(UINT32 set, UINT32 slot, const TextureType& texture) override;
  20. /** @copydoc GpuParamsCore::setLoadStoreTexture */
  21. void setLoadStoreTexture(UINT32 set, UINT32 slot, const TextureType& texture,
  22. const TextureSurface& surface) override;
  23. /** @copydoc GpuParamsCore::setBuffer */
  24. void setBuffer(UINT32 set, UINT32 slot, const BufferType& buffer) override;
  25. /** @copydoc GpuParamsCore::setSamplerState */
  26. void setSamplerState(UINT32 set, UINT32 slot, const SamplerType& sampler) override;
  27. /** @copydoc GpuParamsCore::setLoadStoreSurface */
  28. void setLoadStoreSurface(UINT32 set, UINT32 slot, const TextureSurface& surface) override;
  29. protected:
  30. /** All GPU param data related to a single descriptor set. */
  31. struct PerSetData
  32. {
  33. VulkanDescriptorLayout* layout;
  34. };
  35. /** All GPU param data beloning to a single device. */
  36. struct PerDeviceData
  37. {
  38. PerSetData* perSetData;
  39. UINT32 numSets;
  40. };
  41. friend class VulkanHardwareBufferCoreManager;
  42. VulkanGpuParams(const GPU_PARAMS_DESC& desc, GpuDeviceFlags deviceMask);
  43. PerDeviceData mPerDeviceData[BS_MAX_LINKED_DEVICES];
  44. UINT32 mNumDevices;
  45. };
  46. /** @} */
  47. }