Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create debugging markers in OpenGL?

I'm trying to debug some OpenGL 3.3+ graphics code using RenderDoc and I would like to define some debug markers for render passes that can be recognised by RenderDoc.

I use GLEW and I tried to use glPushGroupMarkerEXT/glPopGroupMarkerEXT to define these markers but I get an access violation when I call glPushGroupMarkerEXT, so I guess that the extension that provides that functionality is not loaded. I also tried to check if the extension GL_EXT_debug_marker is available using glewIsSupported but that returns false.

Is this functionality not supported or am I not using it properly? Or is there any other way of achieving this?

like image 606
bishopp Avatar asked Jan 20 '19 16:01

bishopp


1 Answers

EXT_debug_marker is not the extension you want to use. It is old and was never really widely supported. Its functionality was absorbed into KHR_debug, which is more widely supported and itself has been core OpenGL since 4.3 (aka: 5+ years ago).

Now, debug marker functionality is different between the two. KHR_debug makes markers into just another kind of user-defined debug notification. So, where you would have called glInsertEventMarkerEXT, you instead call the more generic glDebugMessageInsert, using the GL_DEBUG_TYPE_MARKER as the message's type. Where you would use glPush/PopGroupMarkerEXT, you instead use glPush/PopDebugGroup, which is used for arbitrary scoping. Such groupings don't use the marker type; they use the GL_DEBUG_TYPE_PUSH/POP_GROUP types, so that you can tell the difference between grouping and markers.

like image 77
Nicol Bolas Avatar answered Sep 19 '22 20:09

Nicol Bolas