简体   繁体   English

OpenGL命令 - 顺序或并行

[英]OpenGL commands - sequential or parallel

I'm reading this document and I have a question about this sentence: 我正在阅读这份文件 ,我对这句话有疑问:

While OpenGL explicitly requires that commands are completed in order, that does not mean that two (or more) commands cannot be concurrently executing. 虽然OpenGL明确要求按顺序完成命令,但这并不意味着两个(或更多)命令不能同时执行。 As such, it is possible for shader invocations from one command to be exeucting in tandem with shader invocations from other commands. 因此,来自一个命令的着色器调用可以与来自其他命令的着色器调用一起执行。

Does this mean that, for example, when I issue two consecutive glDrawArrays calls it is possible that the second call is processed immediately before the first one has finished? 这是否意味着,例如,当我发出两个连续的glDrawArrays调用时,第二个调用可能会在第一个调用完成之前立即处理?

My first idea was that the OpenGL calls merely map to internal commands of the gpu and that the OpenGL call returns immediately without those commands completed, thus enabling the second OpenGL call to issue its own internal commands. 我的第一个想法是,OpenGL调用仅映射到gpu的内部命令,并且OpenGL调用在没有完成这些命令的情况下立即返回,从而使第二个OpenGL调用能够发出自己的内部命令。 The internal commands created by the OpenGL calls can then be parallelized. 然后可以并行化OpenGL调用创建的内部命令。

What is says is, that the exact order in which the commands are executed and any concurrency is left to the judgement of the implementation with the only constraint being that the final result must look exactly as if all the commands would have been executed one after another in the very order they were called by the client program. 所说的是,执行命令的确切顺序和任何并发都留给了实现的判断,唯一的限制是最终结果必须看起来就像所有命令一个接一个地执行一样按照客户端程序调用它们的顺序。

EDIT: Certain OpenGL calls cause an implicit or explicit synchronization. 编辑:某些OpenGL调用会导致隐式或显式同步。 Reading back pixels for example or waiting for a synchronization event. 回读像素或等待同步事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM