From 6441e906e8b00f45e55589c68cb563e529fa5648 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Tue, 18 Sep 2018 14:22:34 -0700 Subject: [PATCH] iris: Set num_uniforms in bytes Ref: brw_nir_lower_uniforms, type_size_scalar_bytes Signed-off-by: Jordan Justen --- src/gallium/drivers/iris/iris_program.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- 2.30.2