0

An open GL error I get seems to be linked to the MAX_VERTEX_UNIFORM_COMPONENTS_ARB. (as suggested in the answer here

What determines this constant (graphic hardware, graphic driver, openGL version ?), and how can I check its value under Linux (nvidia hardware)?

sayanel
  • 301
  • 2
  • 12

1 Answers1

0

This limit is related to used gfx HW and its driver. In OpenGL you can obtain such values on CPU side using this:

GLint x;
glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB,&x);

On my setup:

Vendor: NVIDIA Corporation
OpenGL 4.5.0 NVIDIA 368.22
Render: GeForce GTX 550 Ti/PCIe/SSE2

it returns:

max vertex uniform components: 4096

In order to use this you need working OpenGL 1.0 context or better and know the numeric value of the queried stuff. That is usually stored in gl.h or glext.h in your case its the latter and in case you do not want to include glext.h just add this to your code (C++) before use:

#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
Spektre
  • 49,595
  • 11
  • 110
  • 380
  • Is this C++ code? Can you provide the full program and includes needed? – sayanel May 21 '21 at 08:07
  • @sayanel You need OpenGL context. I do not have any Linux example as I have only windows ones [this one is simplest](https://stackoverflow.com/q/19099162/2521214). However the only thing you need is OpenGL 1.0 context and the queried constant id from `glext.h` so either include it or just use `#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A` instead. If you do not know how to create GL context use some lib like GLUT or google a OpenGL tutorial for linux. Yes the code is in C++ however as you can see the `GLint` is OpenGL type and there is no code just single OpenGL function call. – Spektre May 21 '21 at 09:17
  • @sayanel here is my [complete GL+GLSL+VAO/VBO C++ example](https://stackoverflow.com/a/31913542/2521214) with all the GL extentions (using GLEW) and includes. The difference between Windows and Linux will be in the function starting with `wgl...` prefix Most likely they will be called the same with the same parameters just with different prefix I bet `glX...` – Spektre May 21 '21 at 09:23
  • @sayanel Also if you want more info from the gfx and OpenGL see [3D texture size affecting program output without error being thrown](https://stackoverflow.com/a/50385807/2521214) as some stuff is obtained with different GL functions – Spektre May 21 '21 at 09:29