glPortal icon indicating copy to clipboard operation
glPortal copied to clipboard

Validation Failed: No vertex array object bound. Mac OS X

Open caffeinum opened this issue 6 years ago • 2 comments

Describe the bug

Build worked fine, but running does not work: app shows only the black screen. Related: #156

Console shows this error:

Validation Failed: No vertex array object bound.

To Reproduce Steps to reproduce the behavior:

  1. clone on Mac OS X
  2. build
  3. run

Expected behavior App runs OK.

Desktop (please complete the following information):

  • OS: Mac OS X Mojave 10.14
  • Computer: Macbook Pro Early 2015

Additional context

  • Shaders had another error, which I fixed replacing #version 120 to #version 140, as in #125
  • Some references I googled: (https://stackoverflow.com/questions/32067530/vertex-array-object-not-binding-correctly-in-opengl-4-1, https://www.opengl.org/discussion_boards/showthread.php/185964-vertex-array-object-not-bound-opengl-core-4-1) basically say about deleting #define glGenVertexArrays glGenVertexArraysAPPLE
  • The error even shows for this small shader:
$ cat data/shaders/whitefill.frag
#version 140

out vec4 out_Color;

void main(void) {
	out_Color = vec4(1, 1, 1, 1);
}

caffeinum avatar Jan 04 '19 17:01 caffeinum

anyone got solution of this?

aj-sapkota avatar Oct 10 '20 10:10 aj-sapkota

I'm programming OpenGL in Java, not C++, but it should be the same concept. You can't validate your shader if you haven't assigned a VAO to the shader. glValidateProgram() checks whether the "executables contained in the program [shader] can execute given the current OpenGL state." If you haven't assigned a VAO to the shader, it can't validate because there's no VAO to check. Bind your VAO with glBindVertexArray(vaoID).

FreshSupaSulley avatar Dec 14 '20 17:12 FreshSupaSulley