From 8020a62953926cd6d672e9151290bd4d65e8ee08 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Sun, 22 Oct 2017 01:18:31 +1100 Subject: vo_gpu: export the GLSL format qualifier for ra_format Backported from @haasn's change to libplacebo, except in the current RA, there's nothing to indicate an ra_format can be bound as a storage image, so there's no way to force all of these formats to have a glsl_format. Instead, the layout qualifier will be removed if glsl_format is NULL. This is needed for the upcoming ra_d3d11 backend. In Direct3D 11, while loading float values from unorm images often works as expected, it's technically undefined behaviour, and in Windows 10, it will cause the debug layer to spam the log with error messages. Also, apparently in GLSL, the format name must match the image's format exactly (but in Direct3D, it just has to have the same component type.) --- video/out/vulkan/ra_vk.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'video/out/vulkan') diff --git a/video/out/vulkan/ra_vk.c b/video/out/vulkan/ra_vk.c index a39261f049..58213bd0e9 100644 --- a/video/out/vulkan/ra_vk.c +++ b/video/out/vulkan/ra_vk.c @@ -114,6 +114,8 @@ static bool vk_setup_formats(struct ra *ra) for (int i = 0; i < 4; i++) fmt->component_size[i] = fmt->component_depth[i] = vk_fmt->bits[i]; + fmt->glsl_format = ra_fmt_glsl_format(fmt); + MP_TARRAY_APPEND(ra, ra->formats, ra->num_formats, fmt); } -- cgit v1.2.3