diff --git a/bookcontents/chapter-05/chapter-05.md b/bookcontents/chapter-05/chapter-05.md index ac9e685b..de94a324 100644 --- a/bookcontents/chapter-05/chapter-05.md +++ b/bookcontents/chapter-05/chapter-05.md @@ -51,7 +51,7 @@ The class receives as a parameter a `SwapChain` instance, and it first allocates - `format`: Specifies the format of the image to be used. In our case, it should match the format of the images of the `SwapChain`. - `samples`: The number of the samples of the image, in our case, just one bit. -- `loadOp`: Specifies what will happen to the contents of this attachment when the subpass where it is used starts. In our case we want to clear the contents so we use the `VK_ATTACHMENT_LOAD_OP_CLEAR` value. Other possible values are `VK_ATTACHMENT_LOAD_OP_LOAD` to preserve the contents of the attachment (from a previous pass) or `VK_ATTACHMENT_LOAD_OP_DONT_CARE` if just simply don't care (for example, we may be sure that we are going to fill up again the attachment contents and we do not want to waste tim ein clearing it). +- `loadOp`: Specifies what will happen to the contents of this attachment when the subpass where it is used starts. In our case we want to clear the contents so we use the `VK_ATTACHMENT_LOAD_OP_CLEAR` value. Other possible values are `VK_ATTACHMENT_LOAD_OP_LOAD` to preserve the contents of the attachment (from a previous pass) or `VK_ATTACHMENT_LOAD_OP_DONT_CARE` if just simply don't care (for example, we may be sure that we are going to fill up again the attachment contents and we do not want to waste time in clearing it). - `storeOp`: Specifies what will happen to the contents of this attachment when subpass where it is used finishes. In our case, we want the contents to be presented on the screen so we want to preserve them so we use the `VK_ATTACHMENT_STORE_OP_STORE`. Another option is to use the `VK_ATTACHMENT_STORE_OP_DONT_CARE` value if we just simply don`t care. - `initialLayout`: It specifies what should be the layout of the image of this attachment when the subpass where it is used starts. But what is an image layout? Images can be used for many different purposes, they can be used to render into them, to use them as samplers for textures, or in copy operations. Each of these purposes require a different layout in memory. Therefore, when setting up the layout we need to check that is compatible with the usage that it s going to have. We will explain this in more detail later on. By now, in this the case, we don't care about the image initial layout since we are clearing the attachment, so we just set it to: `VK_IMAGE_LAYOUT_UNDEFINED`. - `finalLayout`: It specifies the layout of the image of the image of this attachment when the subpass where it is used finished. In this case, when we are done with rendering we want it to be presented, so the desired `finalLayout` is `VK_IMAGE_LAYOUT_PRESENT_SRC_KHR`. Any swap chain image must be in that state before presenting it. @@ -970,4 +970,4 @@ We have finished by now! With all that code we are no able to see a wonderful em This chapter is a little bit long, but I think is important to present all these concepts together. Now you are really starting to understand why Vulkan is called an explicit API. The good news is that, in my opinion, the elements presented here are the harder to get. Although we still need to define some important topics, such as pipelines or data buffers, I think they will be easier to understand once you have made your head around this. -[Next chapter](../chapter-06/chapter-06.md) \ No newline at end of file +[Next chapter](../chapter-06/chapter-06.md)