【问题标题】:Understanding Vulkan uniform layout's 'set' index了解 Vulkan 统一布局的“设置”索引
【发布时间】:2021-03-30 19:15:18
【问题描述】:

我一直在学习(非常棒的)nvpro 光线追踪教程,并且对使用 layout(binding = 0, set = 1) 绑定 CameraProperties 统一缓冲区的方式有疑问 - 我理解绑定 = 0,但为什么要设置 = 1?

教程说“set = 1 来自于它是传递给pipelineLayoutCreateInfo.setPSetLayouts 的第二个描述符集”,但是当我查看HelloVulkan::createGraphicsPipeline() 时,我看到布局计数是一,这就是@使用 987654326@(绑定相机统一缓冲区的内容)。我错过了什么?

教程的相关部分是here

谢谢!

【问题讨论】:

    标签: graphics vulkan


    【解决方案1】:

    参见第 7.1 章:

      std::vector<vk::DescriptorSetLayout> rtDescSetLayouts = {m_rtDescSetLayout, m_descSetLayout};
      pipelineLayoutCreateInfo.setSetLayoutCount(static_cast<uint32_t>(rtDescSetLayouts.size()));
      pipelineLayoutCreateInfo.setPSetLayouts(rtDescSetLayouts.data());
    

    管道布局包含两个描述符集合布局,m_rtDescSetLayout 用于索引 0(集合 0)处的加速结构,m_descSetLayout 用于索引 1(集合 1)中的屏幕描述符。在 Vulkan 中,集合是从管道布局创建信息中的描述符集合布局索引自动派生的。

    【讨论】:

    • 啊,现在我明白了。感谢您为我将其链接在一起!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多