From: Jordan Justen Date: Tue, 18 Sep 2018 21:22:34 +0000 (-0700) Subject: iris: Set num_uniforms in bytes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6441e906e8b00f45e55589c68cb563e529fa5648;p=mesa.git iris: Set num_uniforms in bytes Ref: brw_nir_lower_uniforms, type_size_scalar_bytes Signed-off-by: Jordan Justen --- diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 56709dae5b4..ba09c087d69 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -410,6 +410,12 @@ iris_setup_uniforms(const struct brw_compiler *compiler, struct brw_stage_prog_data *prog_data) { prog_data->nr_params = nir->num_uniforms; + /* The intel compiler assumes that num_uniforms is in bytes. For + * scalar that means 4 bytes per uniform slot. + * + * Ref: brw_nir_lower_uniforms, type_size_scalar_bytes. + */ + nir->num_uniforms *= 4; prog_data->param = rzalloc_array(mem_ctx, uint32_t, prog_data->nr_params); nir_foreach_variable(var, &nir->uniforms) {