Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

glUniformHandleui64ARB - Invalid Operation

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 TRONJon   Members   

236
Like
0Likes
Like

Posted 09 May 2014 - 04:30 PM

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[i]);

 

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.

 

Jon.



#2 Ciprian Stanciu   Members   

223
Like
0Likes
Like

Posted 12 May 2014 - 09:36 AM

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.


Relative Games - My apps


#3 Chris_F   Members   

3030
Like
0Likes
Like

Posted 12 May 2014 - 10:06 AM

https://www.opengl.org/registry/specs/ARB/bindless_texture.txt

 

Try this:

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

glMakeTextureHandleResidentARB(texture_handle);

glProgramUniformHandleui64ARB(shader_program, 0, texture_handle);

Edited by Chris_F, 12 May 2014 - 10:06 AM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.