Skip to content
  • Faith Ekstrand's avatar
    nir: Add a ptr_as_array deref type · e94a027a
    Faith Ekstrand authored
    
    
    These correspond directly to SPIR-V's OpPtrAccessChain.  As such, they
    treat whatever their parent gives them as if it's the first element in
    some array and dereferences that array.  If the parent is, itself, an
    array deref, then the two indices can just be added together to get the
    final array deref.  However, it can also be used in cases where what you
    have is a dereference to some random vec2 value somewhere.  In this
    case, we require a cast before the ptr_as_array and use the ptr_stride
    field in the cast to provide a stride for the ptr_as_array derefs.
    
    Reviewed-by: default avatarAlejandro Piñeiro <apinheiro@igalia.com>
    Reviewed-by: default avatarCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
    e94a027a