summaryrefslogtreecommitdiffstats
path: root/video/out/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gpu')
-rw-r--r--video/out/gpu/utils.c4
-rw-r--r--video/out/gpu/video.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/video/out/gpu/utils.c b/video/out/gpu/utils.c
index b59208776d..2c625dc26a 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 || !fmt->storable) {
+ if (!fmt || !fmt->renderable || !fmt->linear_filter) {
mp_err(log, "Format %s not supported.\n", fmt ? fmt->name : "(unset)");
return false;
}
@@ -200,7 +200,7 @@ bool ra_tex_resize(struct ra *ra, struct mp_log *log, struct ra_tex **tex,
.src_linear = true,
.render_src = true,
.render_dst = true,
- .storage_dst = true,
+ .storage_dst = fmt->storable,
.blit_src = true,
};
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 13b7d55877..3c06751959 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -1290,8 +1290,11 @@ static void finish_pass_tex(struct gl_video *p, struct ra_tex **dst_tex,
// If RA_CAP_PARALLEL_COMPUTE is set, try to prefer compute shaders
// over fragment shaders wherever possible.
- if (!p->pass_compute.active && (p->ra->caps & RA_CAP_PARALLEL_COMPUTE))
+ if (!p->pass_compute.active && (p->ra->caps & RA_CAP_PARALLEL_COMPUTE) &&
+ (*dst_tex)->params.storage_dst)
+ {
pass_is_compute(p, 16, 16, true);
+ }
if (p->pass_compute.active) {
gl_sc_uniform_image2D_wo(p->sc, "out_image", *dst_tex);
@@ -3709,6 +3712,12 @@ static void check_gl_features(struct gl_video *p)
"available! See your FBO format configuration!\n");
}
+ if (have_compute && have_fbo && !p->fbo_format->storable) {
+ have_compute = false;
+ MP_WARN(p, "Force-disabling compute shaders as the chosen FBO format "
+ "is not storable! See your FBO format configuration!\n");
+ }
+
if (!have_compute && p->opts.dither_algo == DITHER_ERROR_DIFFUSION) {
MP_WARN(p, "Disabling error diffusion dithering because compute shader "
"was not supported. Fallback to dither=fruit instead.\n");