amd/common: Handle nir_deref_type_ptr_as_array for shared memory.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 24 Jan 2019 00:21:28 +0000 (01:21 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 6 Feb 2019 21:35:58 +0000 (22:35 +0100)
Fixes: a2b5cc3c399 "radv: enable variable pointers"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/common/ac_nir_to_llvm.c

index 3a830591a24fb9fc11265b3864e0ad8555d6461d..ab3db270f0c025e0348b481b2423a4d1b72865a6 100644 (file)
@@ -3844,6 +3844,10 @@ static void visit_deref(struct ac_nir_context *ctx,
                result = ac_build_gep0(&ctx->ac, get_src(ctx, instr->parent),
                                       get_src(ctx, instr->arr.index));
                break;
+       case nir_deref_type_ptr_as_array:
+               result = ac_build_gep_ptr(&ctx->ac, get_src(ctx, instr->parent),
+                                         get_src(ctx, instr->arr.index));
+               break;
        case nir_deref_type_cast:
                result = get_src(ctx, instr->parent);
                break;