From 39d10e33595847e576b6b1c1379ba8d3f27d9323 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sat, 29 Sep 2018 02:17:44 +0200 Subject: 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. --- video/out/gpu/shader_cache.c | 3 +-- 1 file changed, 1 insertion(+), 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"); -- cgit v1.2.3