cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

florianlink
Journeyman III

[BUG REPORT] GLSL Shader link error

Hi,

I experienced link errors in our GLSL VolumeRenderer, the fragment and vertex shader compile successfully and the linking then fails with the error:

unexpected error.
unexpected error.

(On an AMD Radeon HD 6900M Series
OpenGL version string: 4.1.10767 Compatibility Profile Context, but also on older FireGL cards with OpenGL 2.1)

I boiled it down to the attached shaders, which fail to link on ATI, but work fine on NVidia. The problem seems to be passing a uniform of struct type where the struct contains a sampler. Passing it through one function call works, but passing it through nested function calls fails.

If you comment the sampler in the example shader it links fine, and if only someCall2 is called from main() it also links, so the problem really seems to pass the sampler inside the struct through nested functions.

Fragment Shader:

struct VolumeInfo {
   sampler3D volumeDataTexture;
   vec4 data;
};

uniform VolumeInfo primaryVolumeInfo;

vec4 someCall2(in VolumeInfo info) {
   return vec4(info.data);
}

vec4 someCall(in VolumeInfo info) {
   return someCall2(info);
}

void main() {
   gl_FragColor = someCall(primaryVolumeInfo);
}

Vertex Shader:

void main() {
  gl_Position = ftransform();
}

 

Can you please fix this in the driver or give me an idea of a workaround?

(passing the sampler as a single extra argument is not really an option for our VolumeRenderer, since the struct will contain various samplers, depending on the render mode, and it not an option to pass all those as extra arguments)

regards,
Florian Link

0 Likes
4 Replies
gsellers
Staff

This does appear to be a bug. I have sent your post to our shader compiler team and they will take a look at it.

Cheers,

Graham

0 Likes

The bug has been found and squashed. It'll be included in an upcoming Catalyst release.

Thanks for reporting it.

As for a workaround you can use in the mean-time, please email me directly at graham 'dot' sellers 'at' amd 'dot' com to discuss in more detail and I'll do what I can to help.

Cheers,

Graham

0 Likes

Hi Graham,

is there any news on when this fix will make it into a realease? Last tried with Catalyst 11.11, OpenGL 4.1.11251 Compatibility Profile Context (AMD Radeon HD 6900M Series / 2048MB). It's still present there.

We're desperatly waiting for the fix, as it breaks a good chunk of functionality of our Volume Renderer.

 

Kind regards,

Florian Weiler

0 Likes

Any news?

 

-- Florian

0 Likes