nir/lower_explicit_io: Assert that compute address sizes match derefs
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 21 Aug 2020 21:55:02 +0000 (16:55 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 20:50:04 +0000 (20:50 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6379>

src/compiler/nir/nir_lower_io.c

index 6fb90c6efbd5e07f541b7c7857dbb15c5f4fae5b..2cff415eb43a781c24c19010b65fc0f74e4aa147 100644 (file)
@@ -1376,6 +1376,8 @@ lower_explicit_io_deref(nir_builder *b, nir_deref_instr *deref,
 
    nir_ssa_def *addr = nir_explicit_io_address_from_deref(b, deref, base_addr,
                                                           addr_format);
+   assert(addr->bit_size == deref->dest.ssa.bit_size);
+   assert(addr->num_components == deref->dest.ssa.num_components);
 
    nir_instr_remove(&deref->instr);
    nir_ssa_def_rewrite_uses(&deref->dest.ssa, nir_src_for_ssa(addr));