PDA

View Full Version : ATI: glCreateShader not sharing across contexts



BrianDFS
10-03-2010, 02:23 PM
As the subject line states, glCreateShader does not appear to be sharing shader objects between multiple shared contexts.

Has anyone else experienced this? Have I misunderstood something. i.e. are shader objects not actually shared?

I'm currently using latest Catalyst 10.9 drivers on an HD4850.

The same code works on NVidia (I realize that doesn't necessarily mean it's correct though).

mfort
10-04-2010, 05:30 AM
OpenGL documentation says:


Like texture objects, the name space for shader objects may be shared across a set of contexts, as long as the server sides of the contexts share the same address space. If the name space is shared across contexts, any attached objects and the data associated with those attached objects are shared as well.


Be sure the sharing was done correctly. Test that texture sharing works.

BrianDFS
10-04-2010, 06:53 AM
OpenGL documentation says:


Like texture objects, the name space for shader objects may be shared across a set of contexts, as long as the server sides of the contexts share the same address space. If the name space is shared across contexts, any attached objects and the data associated with those attached objects are shared as well.


Be sure the sharing was done correctly. Test that texture sharing works.


I'll double check with texture sharing just to be sure, and report back this afternoon.

BrianDFS
10-04-2010, 03:33 PM
I tested texture sharing and it appears to work as expected.

i.e. Create a texture with one context, switch to another and call glIsTexture to confirm that the second context returns true.

The same (instead calling glIsShader) does not work for shaders.

Can anyone else with an ATI card confirm this?

Pierre Boudier
10-05-2010, 08:29 AM
fyi, we have some tests showing that sharing of program works (with drawing), although it is not directly testing that the shader names are shared; since most of the code is shared for all types, I am not expecting any big difference there.

BrianDFS
10-05-2010, 01:49 PM
fyi, we have some tests showing that sharing of program works (with drawing)
Since you mentioned it, I tested that as well, and glIsProgram does return true for shared shader programs.

However, the shader objects themselves do not appear to be sharing properly. I build shader programs on the fly, so it's possible that shader programs may be built from shaders that were compiled with a different (shared) context.

Without the shader objects sharing properly, the following code fails:

glAttachShader( ProgramID, SharedShaderID ); Because the current context does not recognize the shared ShaderID.

BrianDFS
10-11-2010, 11:33 AM
I just wanted to follow up. ATI/AMD is in the clear. My bad on this one. I'm using Qt for some OpenGL GUI work and it turns out that something less than kosher was happening on the application/Qt side of things.