Enable the glStringMarker logger when available
glStringMarker is usually only available when running under some kind of GL debugger, and can be used to insert strings into the GL command string. Writing logs using it can be useful, since it lets us correspond GL calls with what happens in compton. More info about the extension can be found here: https://www.khronos.org/registry/OpenGL/extensions/GREMEDY/GREMEDY_string_marker.txt Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef CONFIG_OPENGL
|
||||
#include <GL/glx.h>
|
||||
#include <opengl.h>
|
||||
#endif
|
||||
|
||||
#include "compiler.h"
|
||||
@@ -326,6 +326,10 @@ static const struct log_ops glx_string_marker_logger_ops = {
|
||||
};
|
||||
|
||||
struct log_target *glx_string_marker_logger_new(void) {
|
||||
if (!glx_hasglext("GL_GREMEDY_string_marker")) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *fnptr = glXGetProcAddress((GLubyte *)"glStringMarkerGREMEDY");
|
||||
if (!fnptr)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user