Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this a bug or expected behavior of glGetTexParameterIuiv?

Tags:

c++

opengl

I have a problem with OpenGL code that only appears with Intel UHD GPUs/drivers (tried with different UHD and driver versions (Builds 26.20.100.7810, 27.20.100.8190)).

Basically glGetTexParameterIuiv(name, GL_TEXTURE_TARGET, &textureTarget) seems to not work at all. It always gives a GL_INVALID_ENUM error.

The driver reports OpenGL 4.6, the specs say GL_TEXTURE_TARGET is supported from v4.5 (with Nvidia drivers it works as expected, i.e. I get the type of the texture)

This is sample code reproducing the problem:

GLuint tex1;
glGenTextures(1, &tex1);
glBindTexture(GL_TEXTURE_2D, tex1);
glBindTexture(GL_TEXTURE_2D, 0);

GLuint tex2;
glGenTextures(1, &tex2);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, tex2);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0);
GLenum rslt1 = GL_INVALID_ENUM;
GLenum rslt2 = GL_INVALID_ENUM;

glGetTextureParameterIuiv(tex1, GL_TEXTURE_TARGET, &rslt1);
assert(glGetError() == GL_NO_ERROR);
glGetTextureParameterIuiv(tex2, GL_TEXTURE_TARGET, &rslt2);
assert(glGetError() == GL_NO_ERROR);

With Intel drivers the assertions fail. My question is now: IS it a bug? Or am I missing something and the NVidia driver is just more forgiving?

like image 988
Tom Avatar asked Dec 07 '25 08:12

Tom


1 Answers

I have checked your code sample on AMD, NVIDIA and Intel (HD Graphics 630) drivers at hand - and only the latter one failed with error on calling glGetTextureParameterIuiv(), and I also don't see from function description a reason for this misbehavior. Tested with GL_ARB_debug_output, which doesn't give more information.

I believe that OpenGL 4.5+ support in current Intel drivers is misleading and broken (it would be good adding the driver version in your question, to track if the problem will be fixed in newer drivers).

How driver could report supporting particular OpenGL version and not providing complete set of functions defined by this version? For instance, all Intel drivers I've checked do not expose glGetnCompressedTexImage function, which is not optional for OpenGL 4.5.

For this reason (missing symbols), my application reports error for Intel drivers pretending to support OpenGL and fallbacks to OpenGL 4.4.

Note that some OpenGL drivers may fail when calling glGet* function with different type, and success for others. But it doesn't look like this case.

like image 194
gkv311 Avatar answered Dec 10 '25 07:12

gkv311



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!