Vulkan命令执行顺序 [英] Vulkan command execution order

查看:140
本文介绍了Vulkan命令执行顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

引用Vulkan 1.0规范文档,第5章(命令缓冲区)第4段,

除非另有规定,并且没有明确的同步,提交给通过命令缓冲区的队列可以以相对于彼此的任意顺序执行,和/或同时发生

在章节2.1.1(队列操作)的第一段中, b
$ b

...提交给单个队列的命令缓冲区按照它们提交的顺序播放,并且每个缓冲区中的命令按照它们被记录的顺序播放



第5章中的任意顺序是否意味着乱序?那么对于第2.1.1章按照他们提交顺序进行回放的说法,这不是一个冲突吗?或者命令是按顺序播放的命令,但是执行命令是乱序的? 第二章2.1.1定义了命令的API排序:提交到队列中的命令缓冲区的顺序以及顺序命令缓冲区中的命令(以及命令中的基元的顺序)。



第5章说API命令排序并不意味着什么

em>关于执行命令,除非 第2.1.1章包含了对此的特定例外(混合,深度测试),第6章介绍了执行依赖关系,这些依赖关系可以根据2.1.1中定义的API排序强制执行排序。但除了明确声明排序的情况外,API排序并不禁止队列执行其他任何想要执行的操作。

就是说,规范解释那很糟糕。


Quoting Vulkan 1.0 specification document, chapter.5(Command Buffers) 4th paragraph,

"Unless otherwise specified, and without explicit synchronization, the various commands submitted to a queue via command buffers may execute in arbitrary order relative to each other, and/or concurrently"

In 1st paragraph of chapter 2.1.1(Queue Operation), it also states

"... Command buffers submitted to a single queue are played back in the order they were submitted, and commands within each buffer are played back in the order they were recorded"

Does "arbitrary order" in chapter 5 mean even out-of-order? Then isn't it a conflict to statement of chapter 2.1.1 "played back in the order they were submitted"? Or are commands just "PLAYED BACK" in-order but "EXECUTED" out-of-order?

解决方案

Chapter 2.1.1 is defining the API ordering of commands: the order of command buffers submitted into the queue, and the order of commands within the command buffer (and the order of primitives within a command).

Chapter 5 is saying that the API ordering doesn't mean anything about execution ordering unless some text specifically says otherwise. Chapter 2.1.1 includes specific exceptions to this (blending, depth test), and Chapter 6 introduces execution dependencies which can enforce execution ordering, based on the API ordering defined in 2.1.1. But outside of cases that explicitly declare ordering, the API ordering does not prohibit the queue from doing whatever else it wants with regard to execution.

That being said, the spec explains that poorly.

这篇关于Vulkan命令执行顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆