Quantcast
Channel: AMD Developer Forums: Message List - OpenGL & Vulkan
Viewing all articles
Browse latest Browse all 631

invalid gl_TessLevelOuter in evaluation shader with isolines

$
0
0

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];

...

}


Viewing all articles
Browse latest Browse all 631

Trending Articles