gallium/ntt: Fix emitting UBO declarations.

Fixes: d70fff99c5 ("nir: Use a single list for all shader variables")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8196>
(cherry picked from commit ec0bab8ca9)
This commit is contained in:
Eric Anholt 2020-12-11 13:11:26 -08:00 committed by Dylan Baker
parent 071a87ac7f
commit cf5fe357d6
2 changed files with 5 additions and 3 deletions

View file

@ -589,7 +589,7 @@
"description": "gallium/ntt: Fix emitting UBO declarations.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "d70fff99c5bc3a721e20869e7f0be8024ffe5ecd"
},

View file

@ -258,8 +258,6 @@ ntt_setup_uniforms(struct ntt_compile *c)
var->data.image.format,
!var->data.read_only,
false);
} else if (var->data.mode == nir_var_mem_ubo) {
ureg_DECL_constant2D(c->ureg, 0, 0, var->data.driver_location + 1);
} else {
unsigned size;
if (packed) {
@ -274,6 +272,10 @@ ntt_setup_uniforms(struct ntt_compile *c)
}
}
nir_foreach_variable_with_modes(var, c->s, nir_var_mem_ubo) {
ureg_DECL_constant2D(c->ureg, 0, 0, var->data.driver_location + 1);
}
for (int i = 0; i < PIPE_MAX_SAMPLERS; i++) {
if (c->s->info.textures_used & (1 << i))
ureg_DECL_sampler(c->ureg, i);