BsVulkanDescriptorSet.cpp 939 B

12345678910111213141516171819202122232425
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsVulkanDescriptorSet.h"
  4. #include "BsVulkanDevice.h"
  5. namespace bs { namespace ct
  6. {
  7. VulkanDescriptorSet::VulkanDescriptorSet(VulkanResourceManager* owner, VkDescriptorSet set, VkDescriptorPool pool)
  8. :VulkanResource(owner, true), mSet(set), mPool(pool)
  9. { }
  10. VulkanDescriptorSet::~VulkanDescriptorSet()
  11. {
  12. VkResult result = vkFreeDescriptorSets(mOwner->getDevice().getLogical(), mPool, 1, &mSet);
  13. assert(result == VK_SUCCESS);
  14. }
  15. void VulkanDescriptorSet::write(VkWriteDescriptorSet* entries, UINT32 count)
  16. {
  17. for (UINT32 i = 0; i < count; i++)
  18. entries[i].dstSet = mSet;
  19. vkUpdateDescriptorSets(mOwner->getDevice().getLogical(), count, entries, 0, nullptr);
  20. }
  21. }}