summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2018-02-04 23:32:31 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-05 02:49:03 -0800
commit599724850549221abc5a23b3b10d2b327e3ab31a (patch)
treecd7c090c41e103b91089cad5072f9ea49a607b5b
parentf151ac57cb835408598e964beac17356e8c4f1cc (diff)
downloadmpv-599724850549221abc5a23b3b10d2b327e3ab31a.tar.bz2
mpv-599724850549221abc5a23b3b10d2b327e3ab31a.tar.xz
vo_gpu: vulkan: correctly enable textureGatherOffset
This also requires a vulkan feature / SPIR-V capability to function
-rw-r--r--video/out/vulkan/ra_vk.c4
-rw-r--r--video/out/vulkan/utils.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c
index a4b6f3e6ad..5e6fae74ed 100644
--- a/video/out/vulkan/ra_vk.c
+++ b/video/out/vulkan/ra_vk.c
@@ -222,8 +222,8 @@ struct ra *ra_create_vk(struct mpvk_ctx *vk, struct mp_log *log)
// UBO support is required
ra->caps |= RA_CAP_BUF_RO | RA_CAP_FRAGCOORD;
- // textureGather is only supported in GLSL 400+
- if (ra->glsl_version >= 400)
+ // textureGather requires the ImageGatherExtended capability
+ if (vk->features.shaderImageGatherExtended)
ra->caps |= RA_CAP_GATHER;
// Try creating a shader storage buffer
diff --git a/video/out/vulkan/utils.c b/video/out/vulkan/utils.c
index b32ae4968b..cfe97377c0 100644
--- a/video/out/vulkan/utils.c
+++ b/video/out/vulkan/utils.c
@@ -502,6 +502,7 @@ bool mpvk_device_init(struct mpvk_ctx *vk, struct mpvk_device_opts opts)
// Enable all features we optionally use
#define FEATURE(name) .name = vk->features.name
VkPhysicalDeviceFeatures feats = {
+ FEATURE(shaderImageGatherExtended),
FEATURE(shaderStorageImageExtendedFormats),
};
#undef FEATURE