ray_tracing_gltf/hello_vulkan.cpp
void HelloVulkan::updateDescriptorSet()
{
  std::vector<VkWriteDescriptorSet> writes;

  // Camera matrices and scene description
  VkDescriptorBufferInfo dbiUnif{m_bGlobals.buffer, 0, VK_WHOLE_SIZE};
  VkDescriptorBufferInfo sceneDesc{m_sceneDesc.buffer, 0, VK_WHOLE_SIZE};

  writes.emplace_back(m_descSetLayoutBind.makeWrite(m_descSet, SceneBindings::eGlobals, &dbiUnif));
  writes.emplace_back(m_descSetLayoutBind.makeWrite(m_descSet, eSceneDesc, &sceneDesc));

  // All texture samplers
  std::vector<VkDescriptorImageInfo> diit;
  for(auto& texture : m_textures)
    diit.emplace_back(texture.descriptor);
  writes.emplace_back(m_descSetLayoutBind.makeWriteArray(m_descSet, SceneBindings::eTextures, diit.data()));

  // Writing the information
  vkUpdateDescriptorSets(m_device, static_cast<uint32_t>(writes.size()), writes.data(), 0, nullptr);
}
//--------------------------------------------------------------------------------------------------
// Setting up the buffers in the descriptor set
//
Setting up the buffers in the descriptor set
Setting up the buffers in the descriptor set
void HelloVulkan::updateDescriptorSet()
{
  std::vector<VkWriteDescriptorSet> writes;
  VkDescriptorBufferInfo dbiUnif{m_bGlobals.buffer, 0, VK_WHOLE_SIZE};
  VkDescriptorBufferInfo sceneDesc{m_sceneDesc.buffer, 0, VK_WHOLE_SIZE};
  writes.emplace_back(m_descSetLayoutBind.makeWrite(m_descSet, SceneBindings::eGlobals, &dbiUnif));
  writes.emplace_back(m_descSetLayoutBind.makeWrite(m_descSet, eSceneDesc, &sceneDesc));
  std::vector<VkDescriptorImageInfo> diit;
  for(auto& texture : m_textures)
    diit.emplace_back(texture.descriptor);
  writes.emplace_back(m_descSetLayoutBind.makeWriteArray(m_descSet, SceneBindings::eTextures, diit.data()));
  vkUpdateDescriptorSets(m_device, static_cast<uint32_t>(writes.size()), writes.data(), 0, nullptr);
}
void HelloVulkan :: updateDescriptorSet ( ) { std :: vector < VkWriteDescriptorSet > writes ; VkDescriptorBufferInfo dbiUnif { m_bGlobals . buffer , 0 , VK_WHOLE_SIZE } ; VkDescriptorBufferInfo sceneDesc { m_sceneDesc . buffer , 0 , VK_WHOLE_SIZE } ; writes . emplace_back ( m_descSetLayoutBind . makeWrite ( m_descSet , SceneBindings :: eGlobals , & dbiUnif ) ) ; writes . emplace_back ( m_descSetLayoutBind . makeWrite ( m_descSet , eSceneDesc , & sceneDesc ) ) ; std :: vector < VkDescriptorImageInfo > diit ; for ( auto & texture : m_textures ) diit . emplace_back ( texture . descriptor ) ; writes . emplace_back ( m_descSetLayoutBind . makeWriteArray ( m_descSet , SceneBindings :: eTextures , diit . data ( ) ) ) ; vkUpdateDescriptorSets ( m_device , static_cast < uint32_t > ( writes . size ( ) ) , writes . data ( ) , 0 , nullptr ) ; }
Setting up the buffers in the descriptor set
Setting up the buffers in the descriptor set
// Camera matrices and scene description // All texture samplers // Writing the information