🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

invalid gl_PrimitiveIDIn (geometry shader)

Started by
2 comments, last by Tommato 3 years, 5 months ago

Hi All

I (naively) assumed the gl_PrimitiveIDIn is automatically reset to zero when a new glDrawElements starts. But it's not always so (value is 198) and, of course, my code is crashed, Worse yet, it happens only on one/specific client's machine, so I do a large logs etc. No any OpenGL errors, so I'm turning on/off pieces of code to localize “where is it”. For now it looks related with TransformFeedback API that I use. Of course I googled all about gl_PrimitiveIDIn but found nothing new.

Such “blind debugging” is very time-consuming but absolute ineffective. Can you please suggest any info/idea to make my efforts more productive?

Thx

Advertisement

Tommato said:
Such “blind debugging” is very time-consuming but absolute ineffective. Can you please suggest any info/idea to make my efforts more productive?

Try this… I guess it is officially called debug output?

https://vallentin.dev/2015/02/23/debugging-opengl

You don't have to use OpenGl 4.3, just have a card that supports it. I put the error handling routine in my GLFW window creation class using glDebugMessageCallback and it works great.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

fleabay said:

Try this… I guess it is officially called debug output?

Sorry for absolute not-constructive “but” I use Core Profile 3.3 (my card is 4.1) on OSX. Also I've no one OpenGL error, so no any clue what/where to find.

From logs I see following

  • first draw call is always ok, my geometry shader receives gl_PrimitiveIDIn from zero (as it should)
  • any further call is wrong, the gl_PrimitiveIDIn starts from some non-zero value. For example my object has 1836 triangles,. First id = 1592 (not zero), becomes ok from triangle 900

It looks like “resources are not released properly”, so checked shaders, attributes, vao etc many times - still no luck.

Any idea would be very appreciated

Thx

This topic is closed to new replies.

Advertisement