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/utils.h | |
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/utils.h')
-rw-r--r-- | video/out/opengl/utils.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/video/out/opengl/utils.h b/video/out/opengl/utils.h index 4327b74b8f..3dc7e5d72d 100644 --- a/video/out/opengl/utils.h +++ b/video/out/opengl/utils.h @@ -66,6 +66,7 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h, #define FBOTEX_FUZZY_W 1 #define FBOTEX_FUZZY_H 2 #define FBOTEX_FUZZY (FBOTEX_FUZZY_W | FBOTEX_FUZZY_H) +#define FBOTEX_COMPUTE 4 void fbotex_set_filter(struct fbotex *fbo, GLenum gl_filter); void fbotex_invalidate(struct fbotex *fbo); @@ -141,9 +142,13 @@ void gl_sc_hadd(struct gl_shader_cache *sc, const char *text); void gl_sc_haddf(struct gl_shader_cache *sc, const char *textf, ...) PRINTF_ATTRIBUTE(2, 3); void gl_sc_hadd_bstr(struct gl_shader_cache *sc, struct bstr text); +void gl_sc_paddf(struct gl_shader_cache *sc, const char *textf, ...) + PRINTF_ATTRIBUTE(2, 3); void gl_sc_uniform_tex(struct gl_shader_cache *sc, char *name, GLenum target, GLuint texture); void gl_sc_uniform_tex_ui(struct gl_shader_cache *sc, char *name, GLuint texture); +void gl_sc_uniform_image2D(struct gl_shader_cache *sc, char *name, GLuint texture, + GLuint iformat, GLenum access); void gl_sc_uniform_f(struct gl_shader_cache *sc, char *name, GLfloat f); void gl_sc_uniform_i(struct gl_shader_cache *sc, char *name, GLint f); void gl_sc_uniform_vec2(struct gl_shader_cache *sc, char *name, GLfloat f[2]); @@ -156,7 +161,7 @@ void gl_sc_set_vertex_format(struct gl_shader_cache *sc, const struct gl_vao_entry *entries, size_t vertex_size); void gl_sc_enable_extension(struct gl_shader_cache *sc, char *name); -struct mp_pass_perf gl_sc_generate(struct gl_shader_cache *sc); +struct mp_pass_perf gl_sc_generate(struct gl_shader_cache *sc, GLenum type); void gl_sc_draw_data(struct gl_shader_cache *sc, GLenum prim, void *ptr, size_t num); void gl_sc_reset(struct gl_shader_cache *sc); |