# Bindless texture bug?

## Recommended Posts

Chris_F    3030

I'm trying out bindless textures and I noticed what I think may be a driver bug, but I am not certain.

Basically, if my shader looks like this:

#version 440 core
#extension GL_ARB_bindless_texture : require

layout(location = 0) uniform sampler2D texture0;


I get an error saying that sampler handle updates are not allowed if the bindless_sampler qualifier is not set. Fair enough. Change the shader to this and all is well.

#version 440 core
#extension GL_ARB_bindless_texture : require

layout(location = 0, bindless_sampler) uniform sampler2D texture0;


However, if I do this:

#version 440 core

layout(location = 0) uniform sampler2D texture0;


Then I get no errors and everything works fine, despite the fact that I am still using a bindless handle. The GL code is:

GLuint64 texture_handle = glGetTextureHandleARB(texture);

glMakeTextureHandleResidentARB(texture_handle);


Edited by Chris_F

##### Share on other sites
richardurich    1352

Undefined behavior is allowed to result in "everything works fine" and is not a driver bug. You can use GL_ARB_debug_output to help find cases of undefined behavior.

##### Share on other sites
Chris_F    3030

Undefined behavior is allowed to result in "everything works fine" and is not a driver bug. You can use GL_ARB_debug_output to help find cases of undefined behavior.

I am using GL_ARB_debug_output, and that's what I mean by "no error" and "I think this is a 'bug'". Surely debug output should give some kind of warning for this.

##### Share on other sites
richardurich    1352

Short answer is yes, it should tell you about this type of stuff. As my prior post suggested, I expected that so strongly I assumed you must not even be using GL_ARB_debug_output.

Unfortunately, it is not technically a bug though. GL_ARB_debug_output only requires information about errors, and undefined behavior may or may not generate an error. All other information reported is optional.

Are you using nVidia drivers? I know nVidia is a bit more lax about generating errors, so I'm just curious if that's all this is or if maybe I'm wrong in thinking this is undefined in the first place.

##### Share on other sites
Chris_F    3030

Since this is OpenGL 4.4 it means Nvidia is currently the only possibility. This may not technically be a bug, but just the same I am going to report this in hopes that they will improve their debug output.