summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/common.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-08-19 13:51:50 +0200
committerNiklas Haas <git@haasn.dev>2022-08-19 13:54:50 +0200
commit37aea112c15958052bcc6d0582593edf3bfead8f (patch)
treea70138a21f1dc53fab4eef165c4b9f2511988820 /video/out/opengl/common.h
parent891c9c869f61bfe16e46a9244a6af2ed93f67b23 (diff)
downloadmpv-37aea112c15958052bcc6d0582593edf3bfead8f.tar.bz2
mpv-37aea112c15958052bcc6d0582593edf3bfead8f.tar.xz
vo_gpu_next: pass GL get_proc_addr pointer to libplacebo
Facing down the multitude of ways to somehow wrangle the get_fn pointer out of the GL environment and into libplacebo, I decided the easiest is to just store it inside the GL struct itself. The lifetime of this get_fn function is a bit murky, since it's not clear on whether or not it survives the VO init call (especially in the case of the GL render API, which explicitly states that parameters do not need to survive the call they're passed to), so just add a disclaimer. (It's fine for us to use like this because `gpu_ctx_create` is still part of VO init) Closes https://code.videolan.org/videolan/libplacebo/-/issues/216
Diffstat (limited to 'video/out/opengl/common.h')
-rw-r--r--video/out/opengl/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h
index 1292be45b2..a9e67d9756 100644
--- a/video/out/opengl/common.h
+++ b/video/out/opengl/common.h
@@ -87,6 +87,11 @@ struct GL {
int mpgl_caps; // Bitfield of MPGL_CAP_* constants
bool debug_context; // use of e.g. GLX_CONTEXT_DEBUG_BIT_ARB
+ // Copy of function pointer used to load GL.
+ // Caution: Not necessarily valid to use after VO init has completed!
+ void *(*get_fn)(void *ctx, const char *n);
+ void *fn_ctx;
+
void (GLAPIENTRY *Viewport)(GLint, GLint, GLsizei, GLsizei);
void (GLAPIENTRY *Clear)(GLbitfield);
void (GLAPIENTRY *GenTextures)(GLsizei, GLuint *);