summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/opengl/hwdec.h2
-rw-r--r--video/out/opengl/hwdec_d3d11egl.c5
-rw-r--r--video/out/opengl/video.c3
3 files changed, 10 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec.h b/video/out/opengl/hwdec.h
index ae48d485cb..4a074ec4a5 100644
--- a/video/out/opengl/hwdec.h
+++ b/video/out/opengl/hwdec.h
@@ -10,6 +10,8 @@ struct gl_hwdec {
struct mpv_global *global;
GL *gl;
struct mp_hwdec_devices *devs;
+ // GLSL extensions required to sample textures from this.
+ const char **glsl_extensions;
// For free use by hwdec driver
void *priv;
// For working around the vdpau vs. vaapi mess.
diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c
index 6d34e6905a..c257145470 100644
--- a/video/out/opengl/hwdec_d3d11egl.c
+++ b/video/out/opengl/hwdec_d3d11egl.c
@@ -201,6 +201,11 @@ static int create(struct gl_hwdec *hw)
MP_ERR(hw, "Failed to load some EGLStream functions.\n");
goto fail;
}
+
+ static const char *es2_exts[] = {"GL_NV_EGL_stream_consumer_external", 0};
+ static const char *es3_exts[] = {"GL_NV_EGL_stream_consumer_external",
+ "GL_OES_EGL_image_external_essl3", 0};
+ hw->glsl_extensions = hw->gl->es == 200 ? es2_exts : es3_exts;
}
if (use_native_device) {
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index cb8da859c8..90c511290f 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -784,6 +784,9 @@ static void init_video(struct gl_video *p)
if (p->hwdec->driver->reinit(p->hwdec, &p->image_params) < 0)
MP_ERR(p, "Initializing texture for hardware decoding failed.\n");
init_image_desc(p, p->image_params.imgfmt);
+ const char **exts = p->hwdec->glsl_extensions;
+ for (int n = 0; exts && exts[n]; n++)
+ gl_sc_enable_extension(p->sc, (char *)exts[n]);
p->hwdec_active = true;
} else {
init_format(p, p->image_params.imgfmt, false);