Implemented KRDevice::createDescriptorSets
This commit is contained in:
@@ -475,9 +475,18 @@ bool KRDevice::initDescriptorPool()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkDescriptorPool KRDevice::getDescriptorPool()
|
void KRDevice::createDescriptorSets(const std::vector<VkDescriptorSetLayout>& layouts, std::vector<VkDescriptorSet>& descriptorSets)
|
||||||
{
|
{
|
||||||
return m_descriptorPool;
|
VkDescriptorSetAllocateInfo allocInfo{};
|
||||||
|
allocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
|
||||||
|
allocInfo.descriptorPool = m_descriptorPool;
|
||||||
|
allocInfo.descriptorSetCount = descriptorSets.size();
|
||||||
|
allocInfo.pSetLayouts = layouts.data();
|
||||||
|
if (vkAllocateDescriptorSets(m_logicalDevice, &allocInfo, descriptorSets.data()) != VK_SUCCESS) {
|
||||||
|
// TODO - Vulkan Refactoring - Error Handling
|
||||||
|
// In event of failure, should allocate an additional descriptor pool and try again
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KRDevice::initialize(const std::vector<const char*>& deviceExtensions)
|
bool KRDevice::initialize(const std::vector<const char*>& deviceExtensions)
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
void graphicsUpload(VkCommandBuffer& commandBuffer, KRDataBlock& data, VkBuffer destination);
|
void graphicsUpload(VkCommandBuffer& commandBuffer, KRDataBlock& data, VkBuffer destination);
|
||||||
void graphicsUpload(VkCommandBuffer& commandBuffer, void* data, size_t size, VkBuffer destination);
|
void graphicsUpload(VkCommandBuffer& commandBuffer, void* data, size_t size, VkBuffer destination);
|
||||||
|
|
||||||
VkDescriptorPool getDescriptorPool();
|
void createDescriptorSets(const std::vector<VkDescriptorSetLayout>& layouts, std::vector<VkDescriptorSet>& descriptorSets);
|
||||||
|
|
||||||
VkPhysicalDevice m_device;
|
VkPhysicalDevice m_device;
|
||||||
VkDevice m_logicalDevice;
|
VkDevice m_logicalDevice;
|
||||||
|
|||||||
Reference in New Issue
Block a user