From 639c236e74e99524245c22f1fa0758603f558cf2 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 25 Oct 2018 10:34:34 -0500 Subject: spirv: Emit NIR deref instructions on-the-fly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This simplifies our deref handling by emitting the actual NIR deref instructions on-the-fly instead of of building up a deref chain and then emitting them at the last moment. In order for this to work with the parts of the compiler that assume they can chase deref chains, we have to run nir_rematerialize_derefs_in_use_blocks_impl to put the derefs back in the right places. Otherwise, in cases such as loop continues where the SPIR-V blocks are not in the same order as the NIR blocks, we may end up with a deref chain with a parent that does not dominate it's child and nir_repair_ssa_impl will insert phis in the deref chain. Reviewed-by: Alejandro PiƱeiro Reviewed-by: Caio Marcelo de Oliveira Filho --- src/compiler/spirv/vtn_private.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/compiler/spirv/vtn_private.h') diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index da7a04ce59f..defcbb8e69d 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -443,20 +443,9 @@ struct vtn_pointer { */ struct vtn_variable *var; - /** The deref at the base of the chain - * - * This field may be NULL if the pointer uses a (block_index, offset) pair - * instead of an access chain or if the access chain starts at a variable. - */ + /** The NIR deref corresponding to this pointer */ nir_deref_instr *deref; - /** An access chain describing how to get from var to the referenced data - * - * This field may be NULL if the pointer references the entire variable or - * if a (block_index, offset) pair is used instead of an access chain. - */ - struct vtn_access_chain *chain; - /** A (block_index, offset) pair representing a UBO or SSBO position. */ struct nir_ssa_def *block_index; struct nir_ssa_def *offset; -- cgit v1.2.3