0

I found out that running tessellation control shader which contains barrier() call on my integrated Intel videocard yields no geometry (????)

So just for example, the following simple shader works well on my dedicated Nvidia card, but doesn't work with Intel:

#version 450 core

layout (vertices = 4) out;

void main() {
    gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
    gl_TessLevelInner[0] = 1;
    gl_TessLevelInner[1] = 1;
    gl_TessLevelOuter[0] = 1;
    gl_TessLevelOuter[1] = 1;
    gl_TessLevelOuter[2] = 1;
    gl_TessLevelOuter[3] = 1;
    barrier();
}

However, the same code without barrier() call works on Intel card too.

Would be grateful if someone could guess, where to look for the cause of the problem

UPDATE

Found out that when barrier() is called before gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; everything works fine, so I just need to move this statement to the end:

#version 450 core

layout (vertices = 4) out;

void main() {
    gl_TessLevelInner[0] = 1;
    gl_TessLevelInner[1] = 1;
    gl_TessLevelOuter[0] = 1;
    gl_TessLevelOuter[1] = 1;
    gl_TessLevelOuter[2] = 1;
    gl_TessLevelOuter[3] = 1;
    barrier();
    gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
}

This behavior is still not clear for me, so would be cool if someone could explain it to me, why I shouldn't write to gl_out before barrier()

YaaZ
  • 380
  • 2
  • 11
  • 2
    Um... what's the point of that `barrier` call? – Nicol Bolas Jun 15 '19 at 00:36
  • 1
    @NicolBolas: this is just the most simple example which reproduces the problem, there is no point in `barrier` call, but this example shows that exactly `barrier` causes this strange artifact. Originally I was computing outer levels and then calling barrier to make them visible to all invokations to compute inner levels as average of corresponding outer levels. – YaaZ Jun 15 '19 at 10:44

1 Answers1

0

This looks like a graphics driver or hardware bug to me - there is nothing wrong with what you are doing from a specification point of view.

solidpixel
  • 10,688
  • 1
  • 20
  • 33