diff --git a/video/out/d3d11/ra_d3d11.c b/video/out/d3d11/ra_d3d11.c index df9b3c0095..e6b37ef2b9 100644 --- a/video/out/d3d11/ra_d3d11.c +++ b/video/out/d3d11/ra_d3d11.c @@ -233,6 +233,9 @@ static void setup_formats(struct ra *ra) .pixel_size = d3dfmt->bytes, .linear_filter = (support & sup_filter) == sup_filter, .renderable = (support & sup_render) == sup_render, + // TODO: Check whether it's a storage format + // https://docs.microsoft.com/en-us/windows/desktop/direct3d12/typed-unordered-access-view-loads + .storable = true, }; if (support & D3D11_FORMAT_SUPPORT_TEXTURE1D) diff --git a/video/out/gpu/ra.h b/video/out/gpu/ra.h index f35489e25d..58bf55357b 100644 --- a/video/out/gpu/ra.h +++ b/video/out/gpu/ra.h @@ -107,6 +107,7 @@ struct ra_format { // only applies to 2-component textures bool linear_filter; // linear filtering available from shader bool renderable; // can be used for render targets + bool storable; // can be used for storage images bool dummy_format; // is not a real ra_format but a fake one (e.g. FBO). // dummy formats cannot be used to create textures diff --git a/video/out/gpu/utils.c b/video/out/gpu/utils.c index 9234545a71..b59208776d 100644 --- a/video/out/gpu/utils.c +++ b/video/out/gpu/utils.c @@ -185,7 +185,7 @@ bool ra_tex_resize(struct ra *ra, struct mp_log *log, struct ra_tex **tex, mp_dbg(log, "Resizing texture: %dx%d\n", w, h); - if (!fmt || !fmt->renderable || !fmt->linear_filter) { + if (!fmt || !fmt->renderable || !fmt->linear_filter || !fmt->storable) { mp_err(log, "Format %s not supported.\n", fmt ? fmt->name : "(unset)"); return false; } 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; diff --git a/video/out/placebo/ra_pl.c b/video/out/placebo/ra_pl.c index 18d8f37070..28d4297f6f 100644 --- a/video/out/placebo/ra_pl.c +++ b/video/out/placebo/ra_pl.c @@ -88,6 +88,7 @@ struct ra *ra_create_pl(const struct pl_gpu *gpu, struct mp_log *log) .pixel_size = plfmt->texel_size, .linear_filter = plfmt->caps & PL_FMT_CAP_LINEAR, .renderable = plfmt->caps & PL_FMT_CAP_RENDERABLE, + .storable = plfmt->caps & PL_FMT_CAP_STORABLE, .glsl_format = plfmt->glsl_format, };