【发布时间】:2018-08-03 12:41:10
【问题描述】:
正如标题所说,驱动程序是否以某种方式优化了 opengl 状态机上的幂等操作?
例如,如果我将同一个缓冲区重新绑定到同一个目标两次怎么办?
glBindBuffer(GL_ARRAY_BUFFER, buf_id)
...
...
//No previous binding operation on the target, this should be idempotent
//and ideally with no cost.
glBindBuffer(GL_ARRAY_BUFFER, buf_id)
顶点数组对象 (glBindVertexArray)、着色器 (glUseProgram) 帧缓冲区等也有同样的问题。
【问题讨论】:
-
这将取决于具体的 API 实现。即使是特定的,除非它是开源的,否则也很难知道。