nir/locals_to_regs: adapt to different bit sizes
authorConnor Abbott <connor.w.abbott@intel.com>
Tue, 17 Nov 2015 14:50:00 +0000 (15:50 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 11 Apr 2016 06:27:04 +0000 (08:27 +0200)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_lower_locals_to_regs.c

index 0438802d3b22b6bd273973d76ae940f6e944252d..cda652d135fba97913a22db539fdd0c5ee310c29 100644 (file)
@@ -119,6 +119,7 @@ get_reg_for_deref(nir_deref_var *deref, struct locals_to_regs_state *state)
    nir_register *reg = nir_local_reg_create(state->impl);
    reg->num_components = glsl_get_vector_elements(tail->type);
    reg->num_array_elems = array_size > 1 ? array_size : 0;
+   reg->bit_size = glsl_get_bit_size(glsl_get_base_type(tail->type));
 
    _mesa_hash_table_insert_pre_hashed(state->regs_table, hash, deref, reg);
    nir_array_add(&state->derefs_array, nir_deref_var *, deref);