aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_locals_to_regs.c
diff options
context:
space:
mode:
authorArcady Goldmints-Orlov <[email protected]>2019-12-10 15:37:53 -0500
committerCaio Marcelo de Oliveira Filho <[email protected]>2020-02-12 15:41:49 +0000
commit7acc81056f7ac6a869ef6403573b2572c77dbecf (patch)
treec7035d0b3318f330d19a08b2c834043dd27e6e1c /src/compiler/nir/nir_lower_locals_to_regs.c
parent461c40e0fd5d67dc8155ae4f6c53ddd9acd995b1 (diff)
compiler/nir: Add support for variable initialization from a pointer
Add a pointer_initializer field to nir_variable analogous to constant_initializer, which can be used to initialize the nir_variable to a pointer to another nir_variable. Just like the constant_initializer, the pointer_initializer gets eliminated in the nir_lower_constant_initializers pass. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3047>
Diffstat (limited to 'src/compiler/nir/nir_lower_locals_to_regs.c')
-rw-r--r--src/compiler/nir/nir_lower_locals_to_regs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c b/src/compiler/nir/nir_lower_locals_to_regs.c
index 37e17d5b980..e417c6419fa 100644
--- a/src/compiler/nir/nir_lower_locals_to_regs.c
+++ b/src/compiler/nir/nir_lower_locals_to_regs.c
@@ -101,7 +101,8 @@ get_reg_for_deref(nir_deref_instr *deref, struct locals_to_regs_state *state)
{
uint32_t hash = hash_deref(deref);
- assert(nir_deref_instr_get_variable(deref)->constant_initializer == NULL);
+ assert(nir_deref_instr_get_variable(deref)->constant_initializer == NULL &&
+ nir_deref_instr_get_variable(deref)->pointer_initializer == NULL);
struct hash_entry *entry =
_mesa_hash_table_search_pre_hashed(state->regs_table, hash, deref);