SpiecsEngine
 
Loading...
Searching...
No Matches

◆ UpdateDescriptorSet() [5/5]

void Spices::VulkanDescriptorSet::UpdateDescriptorSet ( uint32_t binding,
std::shared_ptr< VulkanBuffer > buffer ) const

Update this descriptor set.

Parameters
[in]bindingWhich binging location is.
[in]bufferVulkanBuffer.

Instance a VkWriteDescriptorSet.

Update DescriptorSet.

Instance a VkWriteDescriptorSet.

Update DescriptorSet.

Definition at line 405 of file VulkanDescriptor.cpp.

406 {
408
409 VkDescriptorType type = m_Bindings.find(binding)->second.descriptorType;
410
411 assert(type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER || type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
412
416 VkWriteDescriptorSet write{};
417 write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
418 write.dstBinding = binding;
419 write.dstSet = m_DescriptorSet;
420 write.descriptorType = type;
421 write.pBufferInfo = buffer->GetBufferInfo();
422 write.descriptorCount = 1;
423
427 vkUpdateDescriptorSets(m_VulkanState.m_Device, 1, &write, 0, nullptr);
428 }
#define SPICES_PROFILE_ZONE
std::unordered_map< uint32_t, VkDescriptorSetLayoutBinding > m_Bindings
The bindings this descriptor set in use.
VkDescriptorSet m_DescriptorSet
The VkDescriptorSet this class handled.
VulkanState & m_VulkanState
The global VulkanState Referenced from VulkanRenderBackend.