3

I have the following GLSL shader (being loaded into an OpenGL 3.3 forward context, but I get the same behavior in 2.1):

const GLchar* const glsl_vertex_timeseries = {
    "#version 330\n"
    "#extension GL_EXT_gpu_shader4 : enable\n"
    ""
    "in vec2 in_Y;"
    ""
    "void main()"
    "{"
//  "   int dummy = gl_VertexID;"
    "   gl_Position = vec4(in_Y, 0.0, 1.0);"
    "}"
};

It's very much simplified in order to locate the problem.

As shown, it compiles, links, and my geometry displays.

If the commented line is activated, it compiles and links without warnings, but nothing renders (glClear still works, but not glDrawArrays).

What is needed to make gl_VertexID work?

The application is a 32-bit C++ program running on Windows 7 64-bit. Video card is an ATI Mobility Radeon 5650, Catalyst 8.812

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720

1 Answers1

0

Miraculously, it doesn't happen any more with Catalyst 8.821.

I'm not sure whether this is because of a bug fix, or because the driver installer reset some weird state.

EDIT: Given that updated drivers fixed the problem on two separate computers, looks like it must have been a very recent bug fix.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • I remember seeing a thread at the OpenGL boards some 2-3 months ago about ATI drivers generating incorrect gl_VertexID with non-zero _first_ parameter, so my bet would be "bug fix". – Damon Feb 28 '11 at 23:58
  • Just determined that the problem also occurs on another computer, Radeon 5770 Catalyst 8.791. Upgrading now, if the new version fixes it here as well I'll be convinced. – Ben Voigt Mar 01 '11 at 00:53
  • I saw the same behaviour nearly a year ago. In a simple case the gl_VertexID didn't work. When I made the shader doing more work, it worked miraculously. It looks like ATI still has some problems with it... – kvark Mar 01 '11 at 02:12
  • @kvark: In my case, it's not even that `gl_VertexID` didn't work, reading it actually breaks everything else (although using it in a useful way was the next step). But it's nice to know that others have trod this ground before. – Ben Voigt Mar 01 '11 at 02:15
  • No, what I experienced was exactly the same as described - nothing was drawn if I try to read this value. – kvark Mar 01 '11 at 02:47