WebGL 调用是否保证总顺序?
Is total order guaranteed on WebGL calls?
通过阅读 我现在知道 WebGL 总是 运行 在一个单独的进程上,它的调用实际上与主要的 JavaScript 代码是异步的。但是,由于命令被 JavaScript 代码排入队列,我可以期望它们按照在我的代码中调用的相同顺序执行吗?即使当我继续我的 JavaScript 时另一个命令仍在执行,如果我碰巧 运行 另一个对 WebGL
的调用它应该进入队列并在前一个结束时执行,或者在至少我是这么理解的。
我应该注意什么,以避免以意想不到的方式执行 WebGL
命令 运行,如果可能的话?
Is total order guaranteed on WebGL calls?
是的。来自 the spec
Commands are always processed in the order in which they are received, although there may be an indeterminate delay before the effects of a command are
realized. This means, for example, that one primitive must be drawn completely
before any subsequent one can affect the framebuffer. It also means that queries
and pixel read operations return state consistent with complete execution of all previously invoked GL commands. In general, the effects of a GL command on either
GL modes or the framebuffer must be complete before any subsequent command
can have any such effects.
通过阅读 WebGL
的调用它应该进入队列并在前一个结束时执行,或者在至少我是这么理解的。
我应该注意什么,以避免以意想不到的方式执行 WebGL
命令 运行,如果可能的话?
Is total order guaranteed on WebGL calls?
是的。来自 the spec
Commands are always processed in the order in which they are received, although there may be an indeterminate delay before the effects of a command are realized. This means, for example, that one primitive must be drawn completely before any subsequent one can affect the framebuffer. It also means that queries and pixel read operations return state consistent with complete execution of all previously invoked GL commands. In general, the effects of a GL command on either GL modes or the framebuffer must be complete before any subsequent command can have any such effects.