mirror of
https://github.com/mpv-player/mpv
synced 2025-02-21 15:27:00 +00:00
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:
parent
cea4ff3e5f
commit
39d10e3359
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user