What happens when framebuffer is assigned a larger size than the swapchain images in vulkan driver?

huangapple go评论57阅读模式
英文:

What happens when framebuffer is assigned a larger size than the swapchain images in vulkan driver?

问题

我明白这不符合规范,验证层会弹出警告,但我在我的电脑上进行了测试,结果似乎还不错(基本上是将一个较大的图像渲染到显示器上,而不是使交换链和帧缓冲区的大小相同)。我想知道在这种情况下驱动程序会做什么?驱动程序是否会自动缩小帧缓冲区/渲染区域/视口的大小以避免不必要的渲染工作,或者会在呈现之前渲染一个较大的图像然后再进行缩小?

英文:

I understand this does not respect the spec and warnings will pop from the validation layer, but I tested on my computer and the result seemed fine (basically rendering a larger image to the display vs making the swapchain and frambbuffer the same size)
I'm curious what does the driver do in this situation? Does the driver automatically shrink the framebuffer/render area/viewport to the size of the swapchain to avoid the unnecessary rendering work in the first place or a larger image will be rendered anyway and downscaled just before presented?

答案1

得分: 3

违反任何有效使用规则的结果是未定义行为。而根据定义,未定义行为是... 未定义 的。它可以做 任何事情。它可以工作。它可以失败。它可以在一段时间内工作然后失败。它可能会打开一个安全漏洞,供有人在未来的3年里利用。

确切 发生了什么是未知的;如果它可以被知道,那就是 定义 行为。

英文:

The result of violating any valid usage rule is undefined behavior. And by definition, undefined behavior is... undefined. It could do anything. It could work. It could fail. It could work for a while then fail. It could open up a security hole to your OS that someone exploits 3 years from now.

What precisely happens is unknown; if it could be known, it would be defined behavior.

huangapple
  • 本文由 发表于 2023年7月18日 01:19:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76706756.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定