Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of 'attachment' when speaking about the Vulkan API?

Tags:

vulkan

In relation to the Vulkan API, what does an 'attachment' mean? I see that word used in relation to render passes (i.e.: color attachments). I have vague idea of what I think they are, but would like to hear the definition from an expert.

I'm doing graphics programming for the first time and decided to jump straight into the deep end by starting with Vulkan.

like image 207
Dess Avatar asked Sep 23 '17 20:09

Dess


People also ask

What is an attachment in Vulkan?

But if we want to be fully correct: images are specific Vulkan resources that can be used for many purposes (descriptors/textures, attachments, staging resources); attachments are descriptions of resources used during rendering.

What is resolve attachment?

Resolve Attachment. A subpass attachment point, or image view, that is the target of a multisample resolve operation from the corresponding color attachment at the end of the subpass. Can I get a more noob-friendly description of what a Resolve Attachment is? vulkan.

What is color attachment?

A Colour attachment is a texture which attaches to a frame buffer as a render target, used for off-screen rendering. Colour attachments are used in several techniques, including reflection, refraction, and deferred shading.

What is a render pass in Vulkan?

In Vulkan, a render pass is the set of attachments, the way they are used, and the rendering work that is performed using them. In a traditional API, a change to a new render pass might correspond to binding a new framebuffer.


1 Answers

To understand attachments in Vulkan, You first need to understand render-passes and sub-passes.

Render-pass is a general description of steps Your drawing commands are divided into and of resources used during rendering. We can't render anything in Vulkan without a render pass. And each render pass must have one or more steps. These steps are called,

Sub-passes and each sub-pass uses a (sub)collection of resources defined for the render-pass. Render-pass's resources may include render-targets (color, depth/stencil, resolve) and input data (resources that, potentially, were render-targets in previous sub-passes of the same render-pass). And these resources are called,

Attachments (they don't include descriptors/textures/samplers and buffers).

Why don't we call them just render-targets or images? Because we not only render into them (input attachments) and because they are only descriptions (meta data). Images that should be used as attachments inside render-passes are provided through framebuffers.

So, in general, we can call them images, because (as far as I know) only images can be used for attachments. But if we want to be fully correct: images are specific Vulkan resources that can be used for many purposes (descriptors/textures, attachments, staging resources); attachments are descriptions of resources used during rendering.

like image 63
Ekzuzy Avatar answered Oct 21 '22 22:10

Ekzuzy