summaryrefslogtreecommitdiffstats
path: root/video/out/vulkan
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-24 15:21:37 +0200
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2017-12-25 00:47:53 +0100
commitdcda8bd36aa8eb0003c301b4564cd01f7870fe34 (patch)
treee24046b6e4c85c7dcabf32f6d69159f50f2d2dbf /video/out/vulkan
parentbded247fb53558dd5cba26560d1f24e9234ae24e (diff)
downloadmpv-dcda8bd36aa8eb0003c301b4564cd01f7870fe34.tar.bz2
mpv-dcda8bd36aa8eb0003c301b4564cd01f7870fe34.tar.xz
vo_gpu: aggressively prefer async compute
On AMD devices, we only get one graphics pipe but several compute pipes which can (in theory) run independently. As such, we should prefer compute shaders over fragment shaders in scenarios where we expect them to be better for parallelism. This is amusingly trivial to do, and actually improves performance even in a single-queue scenario.
Diffstat (limited to 'video/out/vulkan')
-rw-r--r--video/out/vulkan/ra_vk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c
index 905fc89596..f0353629e6 100644
--- a/video/out/vulkan/ra_vk.c
+++ b/video/out/vulkan/ra_vk.c
@@ -208,8 +208,13 @@ struct ra *ra_create_vk(struct mpvk_ctx *vk, struct mp_log *log)
ra->max_shmem = vk->limits.maxComputeSharedMemorySize;
ra->max_pushc_size = vk->limits.maxPushConstantsSize;
- if (vk->pool_compute)
+ if (vk->pool_compute) {
ra->caps |= RA_CAP_COMPUTE;
+ // If we have more compute queues than graphics queues, we probably
+ // want to be using them. (This seems mostly relevant for AMD)
+ if (vk->pool_compute->num_queues > vk->pool_graphics->num_queues)
+ ra->caps |= RA_CAP_PARALLEL_COMPUTE;
+ }
if (!vk_setup_formats(ra))
goto error;