diff options
author | Niklas Haas <git@haasn.xyz> | 2017-08-26 05:48:12 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-08-27 14:36:00 +0200 |
commit | 136cf2b770f08a435710f71fe2fa597c908cc8a0 (patch) | |
tree | 10371ef916d52e8b8b8560a75f19e7eb1dac1dce /video/out/opengl/shader_cache.c | |
parent | 8404a354e546bd0636fcc1ebf2719f1dea7ad8e9 (diff) | |
download | mpv-136cf2b770f08a435710f71fe2fa597c908cc8a0.tar.bz2 mpv-136cf2b770f08a435710f71fe2fa597c908cc8a0.tar.xz |
vo_opengl: add support for UBOs
Not actually used by anything yet, but straightforward enough to add to
the RA API for starters.
Diffstat (limited to 'video/out/opengl/shader_cache.c')
-rw-r--r-- | video/out/opengl/shader_cache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/opengl/shader_cache.c b/video/out/opengl/shader_cache.c index 97374e781b..e5bddd7960 100644 --- a/video/out/opengl/shader_cache.c +++ b/video/out/opengl/shader_cache.c @@ -277,6 +277,7 @@ void gl_sc_uniform_image2D_wo(struct gl_shader_cache *sc, const char *name, void gl_sc_ssbo(struct gl_shader_cache *sc, char *name, struct ra_buf *buf, char *format, ...) { + assert(sc->ra->caps & RA_CAP_BUF_RW); gl_sc_enable_extension(sc, "GL_ARB_shader_storage_buffer_object"); struct sc_uniform *u = find_uniform(sc, name); @@ -526,6 +527,10 @@ static void add_uniforms(struct gl_shader_cache *sc, bstr *dst) case RA_VARTYPE_IMG_W: ADD(dst, "uniform %s %s;\n", u->glsl_type, u->input.name); break; + case RA_VARTYPE_BUF_RO: + ADD(dst, "layout(std140, binding=%d) uniform %s { %s };\n", + u->input.binding, u->input.name, u->buffer_format); + break; case RA_VARTYPE_BUF_RW: ADD(dst, "layout(std430, binding=%d) buffer %s { %s };\n", u->input.binding, u->input.name, u->buffer_format); |