What is the difference between framebuffer and image in Vulkan?

Answers:

  1. VkFramebuffer + VkRenderPass defines the render target.
  2. Render pass defines which attachment will be written with colors.
  3. VkFramebuffer defines which VkImageView is to be which attachment.
  4. VkImageView defines which part of VkImage to use.
  5. VkImage defines which VkMemory is used and a format of the texel.

Or maybe in opposite sequence:

  1. VkMemory is just a sequence of N bytes in memory.
  2. VkImage object adds to it e.g. information about the format (so you
    can address by texels, not bytes).
  3. VkImageView object helps select only part (array or mip) of the
    VkImage (like stringView, arrayView or whathaveyou does). Also can
    help to match to some incompatible interface (by type casting
    format).
  4. VkFramebuffer binds a VkImageView with an attachment.
  5. VkRenderpass defines which attachment will be drawn into

Swapchain image is no different from any other image. Except that the driver is the owner of the image. You can’t destroy it directly or allocate it yourself. You just borrow it from the driver for the duration between acquire and present operation.

There’s (usually) more of the swapchain images for the purposes of buffering and advance rendering. AFAIK you would need a separate VkFramebuffer for each image (which is annoying, but more in tune with what actually happens underneath).

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值