pan/midgard,bifrost: Expand nir_const_load_to_arr
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 17:50:31 +0000 (10:50 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 22 Aug 2019 19:24:13 +0000 (12:24 -0700)
Panfrost is the only user of the macro; we are better off expanding than
having random stuff in nir.h.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/panfrost/bifrost/bifrost_compile.c
src/panfrost/midgard/midgard_compile.c

index 061eab11a9d89cafd9a389206c1ebd112a3df689..5e34b95d30836dd5ceb9f0915cbae1a8b7686ab4 100644 (file)
@@ -117,7 +117,7 @@ emit_load_const(struct compiler_context *ctx, nir_load_const_instr *instr)
         nir_ssa_def def = instr->def;
 
         float *v = ralloc_array(NULL, float, 1);
-        nir_const_load_to_arr(v, instr, f32);
+        nir_const_value_to_array(v, instr->value, instr->def.num_components, f32);
         _mesa_hash_table_u64_insert(ctx->ssa_constants, def.index + 1, v);
 }
 
index aacd8e19989565f385e1eef927b2639d6ef07dee..9d11ad25ea80a18f7dd28c32a7bd78363c9da6d7 100644 (file)
@@ -562,7 +562,7 @@ emit_load_const(compiler_context *ctx, nir_load_const_instr *instr)
         nir_ssa_def def = instr->def;
 
         float *v = rzalloc_array(NULL, float, 4);
-        nir_const_load_to_arr(v, instr, f32);
+        nir_const_value_to_array(v, instr->value, instr->def.num_components, f32);
 
         /* Shifted for SSA, +1 for off-by-one */
         _mesa_hash_table_u64_insert(ctx->ssa_constants, (def.index << 1) + 1, v);