Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vulkan 3对2 VkSwapchain图像?_Vulkan - Fatal编程技术网

Vulkan 3对2 VkSwapchain图像?

Vulkan 3对2 VkSwapchain图像?,vulkan,Vulkan,因此,Vulkan swapchain基本上有一个图像池,用户定义数量,在创建时分配,以及来自池循环的图像,如下所示: 1. An unused image is acquired by the program from the swapchain 2. The image is rendered by the program 3. The image is delivered for presentation to the surface. 4. The image is returned t

因此,Vulkan swapchain基本上有一个图像池,用户定义数量,在创建时分配,以及来自池循环的图像,如下所示:

1. An unused image is acquired by the program from the swapchain
2. The image is rendered by the program
3. The image is delivered for presentation to the surface.
4. The image is returned to the pool.
鉴于此,在交换链中有3个图像而不是2个图像有什么优势

我这样问是因为我收到了一个最佳实践验证投诉,说我使用的是2而不是3

如果有两张图片,那么一张会被呈现在第三张图片上,不是吗。而另一个是2。,然后他们来回交替这些角色

对于3个图像,这三个图像中的一个不是处于空闲状态吗?尤其是循环被锁定为刷新率时


我可能遗漏了一些东西。

那么,如果一个图像正在呈现,一个图像已经被GPU渲染完毕,并且您还有一些工作要为以后的呈现进行渲染,会发生什么呢?嗯,如果要渲染到swapchain图像,则在图像0完成呈现之前,GPU工作无法启动

因此,如果呈现帧的时间大于渲染帧的时间,则双缓冲将导致GPU暂停。是的,如果渲染时间始终比当前时间短,但帧时间正好在当前时间的边缘,则三重缓冲也会有同样的效果,那么双缓冲浪费GPU时间的可能性更大


当然,缺点是延迟;三重缓冲意味着显示的图像将比双缓冲晚一帧。

因此,如果一个图像正在呈现,一个图像已由GPU完成呈现,并且您有一些工作要呈现以供以后呈现,会发生什么情况?嗯,如果要渲染到swapchain图像,则在图像0完成呈现之前,GPU工作无法启动

因此,如果呈现帧的时间大于渲染帧的时间,则双缓冲将导致GPU暂停。是的,如果渲染时间始终比当前时间短,但帧时间正好在当前时间的边缘,则三重缓冲也会有同样的效果,那么双缓冲浪费GPU时间的可能性更大

当然,缺点是延迟;三重缓冲意味着显示的图像将比双缓冲晚一帧