summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/ra_gl.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-08-26 05:33:00 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-27 14:36:00 +0200
commit45bae90f4d98c64f01ec2fe419a6aa6c068331b2 (patch)
treefeffd338887dd828212b64e3ab79f4c4bde256d5 /video/out/opengl/ra_gl.c
parentf40717a66430c238fbe3fa28fc39a88d804bdc9c (diff)
downloadmpv-45bae90f4d98c64f01ec2fe419a6aa6c068331b2.tar.bz2
mpv-45bae90f4d98c64f01ec2fe419a6aa6c068331b2.tar.xz
vo_opengl: be explicit about IMG_RW
Both vulkan and opengl distinguish between rendering to an image and using an image as a storage attachment. So make this an explicit capability instead of lumping it in with render_dst. (That way we could support, for example, using an image as a storage attachment without requiring a framebuffer) The real reason for this change is that you can directly use the output FBO as a storage attachment on vulkan but you can't on opengl, which makes this param structly separate from render_dst.
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r--video/out/opengl/ra_gl.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c
index e31948c2b1..d9c7205815 100644
--- a/video/out/opengl/ra_gl.c
+++ b/video/out/opengl/ra_gl.c
@@ -893,18 +893,20 @@ static void update_uniform(struct ra *ra, struct ra_renderpass *pass,
}
break;
}
- case RA_VARTYPE_IMG_W: /* fall through */
+ case RA_VARTYPE_IMG_W: {
+ struct ra_tex *tex = *(struct ra_tex **)val->data;
+ struct ra_tex_gl *tex_gl = tex->priv;
+ assert(tex->params.storage_dst);
+ gl->BindImageTexture(input->binding, tex_gl->texture, 0, GL_FALSE, 0,
+ GL_WRITE_ONLY, tex_gl->internal_format);
+ break;
+ }
case RA_VARTYPE_TEX: {
struct ra_tex *tex = *(struct ra_tex **)val->data;
struct ra_tex_gl *tex_gl = tex->priv;
assert(tex->params.render_src);
- if (input->type == RA_VARTYPE_TEX) {
- gl->ActiveTexture(GL_TEXTURE0 + input->binding);
- gl->BindTexture(tex_gl->target, tex_gl->texture);
- } else {
- gl->BindImageTexture(input->binding, tex_gl->texture, 0, GL_FALSE, 0,
- GL_WRITE_ONLY, tex_gl->internal_format);
- }
+ gl->ActiveTexture(GL_TEXTURE0 + input->binding);
+ gl->BindTexture(tex_gl->target, tex_gl->texture);
break;
}
case RA_VARTYPE_BUF_RW: {