Skip to content

Commit

Permalink
igl | opengl | Add workround for OpenGL + Tracy
Browse files Browse the repository at this point in the history
Summary:
Tracy requires an implementation for glQueryCounterEXT, which isn't available on Android with the default configuration.

This workaround provides the implementation for the function to silence a linking error when compiling IGL OpenGL.

Reviewed By: corporateshark, rameshviswanathan

Differential Revision: D63145793

fbshipit-source-id: cf066cfb2acab8e4f81c380ba10d7655ebfd7696
  • Loading branch information
mmaurer authored and facebook-github-bot committed Sep 23, 2024
1 parent a074d64 commit fa341da
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/igl/opengl/GLFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
#define IGL_GET_PROC_ADDRESS(funcName) nullptr
#endif // IGL_EGL

// When using OpenGL, Tracy needs glQueryCounterEXT to be defined, but it's not available in all
// platforms or OpenGL versions. The following is a workaround to make Tracy work in all platforms.
// Note: OpenGL has not been tested with Tracy yet, and that's why the workaround works with OpenGL
#if defined(IGL_WITH_TRACY)
#if !defined GL_TIMESTAMP && defined GL_TIMESTAMP_EXT
extern "C" void glQueryCounterEXT(GLuint, GLenum) {}
#endif
#endif

#define GLEXTENSION_DIRECT_CALL(funcName, funcType, ...) funcName(__VA_ARGS__);
#define GLEXTENSION_DIRECT_CALL_WITH_RETURN(funcName, funcType, returnOnError, ...) \
return funcName(__VA_ARGS__);
Expand Down

0 comments on commit fa341da

Please sign in to comment.