Jump to content
  • Advertisement
Sign in to follow this  

OpenGL glUniformHandleui64ARB - Invalid Operation

This topic is 1674 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I've started learning about ARB_Bindless_texture, allowing me to use memory pointers for textures instead of binding to the limited texture units.


I currently load my textures into the GPU, read the handle using  ARBBindlessTexture.glGetTextureHandleARB(tex);


and then bind that to a sampler uniform later on when rendering. Although I get an "Invalid Oparation" opengl error when calling glUniformHandleui64ARB() to link the texture with the sampler... in the documentation, it says:


The error INVALID_OPERATION is generated by UniformHandleui64{v}ARB if the
sampler or image uniform being updated has the "bound_sampler" or
"bound_image" layout qualifier.


But I don't properly understand what this means... I've never heard of a 'bound_sampler' qualifier...


Please could someone more experienced help me out with this one... I'm stumped as the documentation is very limited at this point.



Share this post

Link to post
Share on other sites

I just implemented this a couple of days ago :) But the only samples I found on the matter only used uniform blocks to store the "pointer" :

        #extension GL_ARB_bindless_texture : require
        layout(binding = 0) uniform BindlessTexturesBuffer
            uniform uvec2 Texture0;

One more thing that made my AMD drivers just error out pixels from my desktop was that you shouldn't call glMakeTextureResident more than once, I now do a call to glIsTextureResident prior to doing that.


Other than that works ok on AMD/280X and I get a +6% performance boost just from using bindless textures.


One more thing, subsequent calls to glTexParameter will fail, I think you can't modify the sampler state after making it resident so I don't even call glActiveTexture/glBindTexture anymore when using bindless textures.

Share this post

Link to post
Share on other sites



Try this:

layout(location = 0, bindless_sampler) uniform sampler2D Texture0;
glGenTextures(1, &texture);
//set up sampler state
GLuint64 texture_handle = glGetTextureHandleARB(texture);


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

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!