Vulkan SDK 之 Descriptor Set Layouts and Pipeline Layouts

当我们有了一个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

posted on 2020-02-06 16:32  KHacker  阅读(310)  评论(0编辑  收藏  举报