Why does glValidateProgram fail when no VAO is bound?

我只是一个虾纸丫 提交于 2019-12-05 09:37:12

This behavior matches the OpenGL spec. I'm using the OpenGL 3.3 spec as reference.

In appendix E.2.2 "Removed Features" on page 344, it says:

The default vertex array object (the name zero) is also deprecated. Calling VertexAttribPointer when no buffer object or no vertex array object is bound will generate an INVALID_OPERATION error, as will calling any array drawing command when no vertex array object is bound.

The spec for glValidateProgram() on page 82 says:

ValidateProgram will check for all the conditions that could lead to an INVALID_OPERATION error when rendering commands are issued, and may check for other conditions as well.

So because issuing a draw command without a VAO bound will given a GL_INVALID_OPERATION error, and glValidateProgram() checks if a draw command would give a GL_INVALID_OPERATION error, what you're seeing is exactly as expected.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!