Sign in to follow this  
Chris_F

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);

glProgramUniformHandleui64ARB(shader_program, 0, texture_handle);
Edited by Chris_F

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this