summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2018-09-29 02:17:44 +0200
committersfan5 <sfan5@live.de>2018-09-29 20:15:10 +0200
commit39d10e33595847e576b6b1c1379ba8d3f27d9323 (patch)
tree1e51f9124d547f8443e16892f364527c0b65f091
parentcea4ff3e5fb5766d34f068742d00b127fa66013f (diff)
downloadmpv-39d10e33595847e576b6b1c1379ba8d3f27d9323.tar.bz2
mpv-39d10e33595847e576b6b1c1379ba8d3f27d9323.tar.xz
vo_gpu: use explicit offsets for push constants
These used to be unsupported long ago, but it seems glslang added support in the meantime. (I don't know which version, but I'm guessing it was long enough ago that we don't have to add a feature check) Should hopefully help make push constant layouts more robust against possible bugs either in our code or in the driver.
-rw-r--r--video/out/gpu/shader_cache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/video/out/gpu/shader_cache.c b/video/out/gpu/shader_cache.c
index f38f0a49fc..fa4560597f 100644
--- a/video/out/gpu/shader_cache.c
+++ b/video/out/gpu/shader_cache.c
@@ -666,8 +666,7 @@ static void add_uniforms(struct gl_shader_cache *sc, bstr *dst)
struct sc_uniform *u = &sc->uniforms[n];
if (u->type != SC_UNIFORM_TYPE_PUSHC)
continue;
- // push constants don't support explicit offsets
- ADD(dst, "/*offset=%zu*/ %s %s;\n", u->offset, u->glsl_type,
+ ADD(dst, "layout(offset=%zu) %s %s;\n", u->offset, u->glsl_type,
u->input.name);
}
ADD(dst, "};\n");