Vulkan SDK 之 Descriptor Set Layouts and Pipeline Layouts

不问归期 提交于 2020-02-06 17:02:57

当我们有了一个uniform buff之后,vulkan 还不知道这个信息,需要通过descriptor进行描述。

Descriptors and Descriptor Sets

A descriptor is a special opaque shader variable(隐藏变量) that shaders use to access buffer and image resources in an indirect fashion. It can be thought of as a "pointer" to a resource. The Vulkan API allows these variables to be changed between draw operations so that the shaders can access different resources for each draw.

A descriptor set layout is used to describe the content of a list of descriptor sets.

A descriptor set is called a "set" because it can refer to an array of homogenous resources that can be described with the same layout binding. (The "layout binding" will be explained shortly.)

 

Pipeline Layouts

A pipeline layout contains a list of descriptor set layouts. It also can contain a list of push constant ranges, which is an alternate way to pass constants to a shader and will not be covered here.

Shader Referencing of Descriptors

Create a Descriptor Set

 Recall that the descriptor set that you defined is used to inform the GPU how the data contained in the uniform buffer is mapped to the shader program's uniform variables. 

Descriptor Pool

Allocate a Descriptor Set from the Pool

Update the Descriptor Set

 

Reference

1、ARB_uniform_buffer_object.txt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!