diff options
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 0674e4fd01a..c6b7edb9aef 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -114,6 +114,13 @@ add_uniform(struct vc4_compile *c, enum quniform_contents contents, uint32_t data) { + for (int i = 0; i < c->num_uniforms; i++) { + if (c->uniform_contents[i] == contents && + c->uniform_data[i] == data) { + return (struct qreg) { QFILE_UNIF, i }; + } + } + uint32_t uniform = c->num_uniforms++; struct qreg u = { QFILE_UNIF, uniform }; |