summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/context.h
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2021-10-02 21:22:46 +0100
committerDudemanguy <random342@airmail.cc>2021-10-16 20:33:53 +0000
commit538fb6541e621fd6eb1c0fe42bb88520e8e45dda (patch)
tree9cdf85b6194fe0ee154ba975309e15658661e324 /video/out/opengl/context.h
parente3883512b119429004376cefff8a29043dbaff8d (diff)
downloadmpv-538fb6541e621fd6eb1c0fe42bb88520e8e45dda.tar.bz2
mpv-538fb6541e621fd6eb1c0fe42bb88520e8e45dda.tar.xz
video: opengl: rework and remove ra_gl_ctx_test_version()
The ra_gl_ctx_test_version() helper is quite clunky, in that it pushes a simple check too deep into the call chain. As such it makes it hard to reason, let alone have the GLX and EGL code paths symmetrical. Introduce a simple helper ra_gl_ctx_get_glesmode() which returns the current glesmode, so the platforms can clearly reason about should and should not be executed. v2: - mpgl_preferred_gl_versions -> mpgl_min_required_gl_versions - 320 -> 300 (in glx code path) Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'video/out/opengl/context.h')
-rw-r--r--video/out/opengl/context.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/video/out/opengl/context.h b/video/out/opengl/context.h
index d78d17094c..222661ad83 100644
--- a/video/out/opengl/context.h
+++ b/video/out/opengl/context.h
@@ -6,10 +6,14 @@
extern const int mpgl_min_required_gl_versions[];
-// Returns whether or not a candidate GL version should be accepted or not
-// (based on the --opengl opts). Implementations may call this before
-// ra_gl_ctx_init if they wish to probe for multiple possible GL versions.
-bool ra_gl_ctx_test_version(struct ra_ctx *ctx, int version, bool es);
+enum gles_mode {
+ GLES_AUTO = 0,
+ GLES_YES,
+ GLES_NO,
+};
+
+// Returns the gles mode based on the --opengl opts.
+enum gles_mode ra_gl_ctx_get_glesmode(struct ra_ctx *ctx);
// These are a set of helpers for ra_ctx providers based on ra_gl.
// The init function also initializes ctx->ra and ctx->swapchain, so the user