I'm a little fuzzy on the concepts of RenderPass, Image, and Framebuffer, especially FrameBuffer, but is it a piece of memory for storing pixel data or not, and if so, how is it different from Image? Or does the rendering flow like this: The rendered pixels are stored in Framebuffer first, and then in Image?
Asked
Active
Viewed 713 times
0
-
Do you know what [FrameBuffers do in OpenGL](https://learnopengl.com/Advanced-OpenGL/Framebuffers)? – Polygnome Jul 06 '20 at 11:08
-
@Polygnome I just looked at it and still don't understand, the framebuffer is just a structure for combining several buffers?The GPU doesn't actually write pixels to it but to the buffer that attaches it? – AndLightLight Jul 06 '20 at 12:49
-
Does this answer your question? [What is the difference between framebuffer and image in Vulkan?](https://stackoverflow.com/questions/39557141/what-is-the-difference-between-framebuffer-and-image-in-vulkan) – krOoze Jul 06 '20 at 17:02
1 Answers
0
Objects in Vulkan are pretty much what the API suggests that they are. VkFramebuffer
does not get attached to any VkDeviceMemory
allocations (directly), so it clearly is not "a piece of memory for storing pixel data". The Vulkan specification lays out the role of a VkFramebuffer
pretty simply:
Framebuffers represent a collection of specific memory attachments that a render pass instance uses.
That's all they do: they hold all of the image attachments that a particular render pass instance will use.

Nicol Bolas
- 449,505
- 63
- 781
- 982
-
Thank you very much, this answer is very clear, but if so, why did I get the pixel of the Image bound to the Framebuffer through texture2D() in shader not the pixel of the real-time rendering but the pixel of the previous frame, which means that the pixel is not written directly to the Image?There's a buffer in the middle, right? – AndLightLight Jul 07 '20 at 04:14
-
@AndLightLight: I don't know what you mean by that. And since I can't see your code, I can't tell you why whatever you described happened. – Nicol Bolas Jul 07 '20 at 05:00