iris: Set num_uniforms in bytes
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 18 Sep 2018 21:22:34 +0000 (14:22 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
Ref: brw_nir_lower_uniforms, type_size_scalar_bytes

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/iris/iris_program.c

index 56709dae5b46a8f08fe2c801499b52255c7ca3b1..ba09c087d69eba58fe395cfe335a370b3074a289 100644 (file)
@@ -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) {