cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

reidm
Adept I

invalid gl_TessLevelOuter in evaluation shader with isolines

I'm having a problem where the value read from gl_TessLevelOuter in my tessellation evaluation shader does not match the value written by my tessellation control shader. If I pass the value as a patch variable (called csStripCount here), the result is correct.

Can anyone else replicate this or am I doing something wrong? See code below, tested on AMD Radeon HD 7770.

Tessellation Control shader

#version 410 core

layout(vertices = 3) out;

patch out float csStripCount;

void main()

{

...

  csStripCount = stripCount;

  gl_TessLevelOuter[0] = segmentCount;

  gl_TessLevelOuter[1] = stripCount;

}

Tesselation Evaluation shader

#version 410 core

layout(isolines) in;

patch in float csStripCount;

void main()

{

  //int stripIndex = int(gl_TessCoord.y * gl_TessLevelOuter[1]); // incorrect result

  int stripIndex = int(gl_TessCoord.y * csStripCount); // correct result

  vec3 interpolationWeights = barycentricSamples[stripIndex];

...

}

0 Likes
1 Solution
reidm
Adept I

This issue was occurring with 12.4 drivers. I updated to 13.4 and gl_TessLevelOuter can now be correctly read in the Tessellation Evaluation shader, except that now the gl_TessLevelOuter appear to be swapped (in both control and evaluation shaders). See this thread for details.

View solution in original post

0 Likes
2 Replies
reidm
Adept I

This issue was occurring with 12.4 drivers. I updated to 13.4 and gl_TessLevelOuter can now be correctly read in the Tessellation Evaluation shader, except that now the gl_TessLevelOuter appear to be swapped (in both control and evaluation shaders). See this thread for details.

0 Likes

Hi,

I'm glad that things work better on newer drivers. If you have any more issues, feel free to keep posting here.

I did reply to the other thread. The apparently swapped tessellation factors are due to a specification bug in the older specification. As mentioned in the other thread, the bug has been fixed in recent versions of the specification and our drivers match the current wording (as I believe do those from other vendors).

Thanks,

Graham

0 Likes