diff options
author | Niklas Haas <git@haasn.xyz> | 2017-07-17 18:11:32 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-07-24 17:19:31 +0200 |
commit | aad6ba018a17eded2b3f4af2212e0123cfb29b79 (patch) | |
tree | 4fd0376511b794c001ba0fd1675a940a764bb728 /video/out/opengl/common.c | |
parent | eb54d2ad4d46b6c1f91564604fad05f092772e84 (diff) | |
download | mpv-aad6ba018a17eded2b3f4af2212e0123cfb29b79.tar.bz2 mpv-aad6ba018a17eded2b3f4af2212e0123cfb29b79.tar.xz |
vo_opengl: support compute shaders
These can either be invoked as dispatch_compute to do a single
computation, or finish_pass_fbo (after setting compute_size_minimum) to
render to a new texture using a compute shader. To make this stuff all
work transparently, we try really, really hard to make compute shaders
as identical to fragment shaders as possible in their behavior.
Diffstat (limited to 'video/out/opengl/common.c')
-rw-r--r-- | video/out/opengl/common.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index c7eee414ac..b9536b6c59 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -335,6 +335,23 @@ static const struct gl_functions gl_functions[] = { {0} }, }, + { + .ver_core = 420, + .extension = "GL_ARB_shader_image_load_store", + .functions = (const struct gl_function[]) { + DEF_FN(BindImageTexture), + DEF_FN(MemoryBarrier), + {0} + }, + }, + { + .ver_core = 430, + .extension = "GL_ARB_compute_shader", + .functions = (const struct gl_function[]) { + DEF_FN(DispatchCompute), + {0}, + }, + }, // Swap control, always an OS specific extension // The OSX code loads this manually. { @@ -589,7 +606,7 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n), if (shader && sscanf(shader, "%d.%d", &glsl_major, &glsl_minor) == 2) gl->glsl_version = glsl_major * 100 + glsl_minor; // restrict GLSL version to be forwards compatible - gl->glsl_version = MPMIN(gl->glsl_version, 400); + gl->glsl_version = MPMIN(gl->glsl_version, 430); } if (is_software_gl(gl)) { |