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.
This commit is contained in:
Niklas Haas 2018-09-29 02:17:44 +02:00 committed by sfan5
parent cea4ff3e5f
commit 39d10e3359
1 changed files with 1 additions and 2 deletions

View File

@ -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");