ray_tracing_indirect_scissor/hello_vulkan.cpp
void HelloVulkan::createBottomLevelAS()
{
  // BLAS - Storing each primitive in a geometry
  std::vector<nvvk::RaytracingBuilderKHR::BlasInput> allBlas;
  allBlas.reserve(m_objModel.size() + 1);

  // Add OBJ models.
  for(const auto& obj : m_objModel)
  {
    auto blas = objectToVkGeometryKHR(obj);

    // We could add more geometry in each BLAS, but we add only one for now
    allBlas.emplace_back(blas);
  }

  // Add lantern model.
  createLanternModel();
  m_lanternBlasId = allBlas.size();
  allBlas.emplace_back(m_lanternBlasInput);

  m_rtBuilder.buildBlas(allBlas, VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR);
}
//--------------------------------------------------------------------------------------------------
//
// Build the array of BLAS in m_rtBuilder. There are `m_objModel.size() + 1`-many BLASes.
// The first `m_objModel.size()` are used for OBJ model BLASes, and the last one
// is used for the lanterns (model generated at runtime).
Build the array of BLAS in m_rtBuilder.
Build the array of BLAS in m_rtBuilder .
void HelloVulkan::createBottomLevelAS()
{
  std::vector<nvvk::RaytracingBuilderKHR::BlasInput> allBlas;
  allBlas.reserve(m_objModel.size() + 1);
  for(const auto& obj : m_objModel)
  {
    auto blas = objectToVkGeometryKHR(obj);
    allBlas.emplace_back(blas);
  }
  createLanternModel();
  m_lanternBlasId = allBlas.size();
  allBlas.emplace_back(m_lanternBlasInput);
  m_rtBuilder.buildBlas(allBlas, VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR);
}
void HelloVulkan :: createBottomLevelAS ( ) { std :: vector < nvvk :: RaytracingBuilderKHR :: BlasInput > allBlas ; allBlas . reserve ( m_objModel . size ( ) + 1 ) ; for ( const auto & obj : m_objModel ) { auto blas = objectToVkGeometryKHR ( obj ) ; allBlas . emplace_back ( blas ) ; } createLanternModel ( ) ; m_lanternBlasId = allBlas . size ( ) ; allBlas . emplace_back ( m_lanternBlasInput ) ; m_rtBuilder . buildBlas ( allBlas , VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR ) ; }
Build the array of BLAS in m_rtBuilder.
Build the array of BLAS in m_rtBuilder .
// BLAS - Storing each primitive in a geometry // Add OBJ models. // We could add more geometry in each BLAS, but we add only one for now // Add lantern model.