summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/ra_gl.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@cloudera.com>2019-06-13 12:30:18 -0700
committersfan5 <sfan5@live.de>2019-07-08 00:59:28 +0200
commite2976e662d9215b5a466b108efc89e19fc718616 (patch)
treead5b58e82af5477dfe640e775efad85f2b45de25 /video/out/opengl/ra_gl.c
parentc379950ce08932dec839f18926183c7b05b57d00 (diff)
downloadmpv-e2976e662d9215b5a466b108efc89e19fc718616.tar.bz2
mpv-e2976e662d9215b5a466b108efc89e19fc718616.tar.xz
video/out/gpu: Add a `storable` flag to ra_format
While `ra` supports the concept of a texture as a storage destination, it does not support the concept of a texture format being usable for a storage texture. This can lead to us attempting to create a texture from an incompatible format, with undefined results. So, let's introduce an explicit format flag for storage and use it. In `ra_pl` we can simply reflect the `storable` flag. For GL and D3D, we'll need to write some new code to do the compatibility checks. I'm not going to do it here because it's not a regression; we were already implicitly assuming all formats were storable. Fixes #6657
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r--video/out/opengl/ra_gl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c
index e4c9c36562..46caca1eea 100644
--- a/video/out/opengl/ra_gl.c
+++ b/video/out/opengl/ra_gl.c
@@ -150,6 +150,9 @@ static int ra_init_gl(struct ra *ra, GL *gl)
.linear_filter = gl_fmt->flags & F_TF,
.renderable = (gl_fmt->flags & F_CR) &&
(gl->mpgl_caps & MPGL_CAP_FB),
+ // TODO: Check whether it's a storable format
+ // https://www.khronos.org/opengl/wiki/Image_Load_Store
+ .storable = true,
};
int csize = gl_component_size(gl_fmt->type) * 8;