freedreno: fix crash w/ masked non-SSA dst
authorRob Clark <robdclark@gmail.com>
Tue, 19 Feb 2019 18:25:02 +0000 (13:25 -0500)
committerRob Clark <robdclark@gmail.com>
Wed, 20 Feb 2019 23:50:08 +0000 (18:50 -0500)
Fixes
dEQP-GLES3.functional.shaders.indexing.varying_array.vec3_dynamic_write_dynamic_loop_read
regression.

Fixes: c1a27ba9baf freedreno/ir3: HIGH reg w/a for a6xx
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_context.c

index 1fc453c15b39f8ba03ce28004fdd74371807f5d9..d768c21e6f5f11f1ac9f3faa026224739f6340fa 100644 (file)
@@ -251,6 +251,8 @@ put_dst(struct ir3_context *ctx, nir_dest *dst)
         * ir3_cp will clean up the extra mov:
         */
        for (unsigned i = 0; i < ctx->last_dst_n; i++) {
+               if (!ctx->last_dst[i])
+                       continue;
                if (ctx->last_dst[i]->regs[0]->flags & IR3_REG_HIGH) {
                        ctx->last_dst[i] = ir3_MOV(ctx->block, ctx->last_dst[i], TYPE_U32);
                }