freedreno/ir3: disable early-z for SSBO/image writes
authorRob Clark <robdclark@gmail.com>
Thu, 21 Mar 2019 19:57:06 +0000 (15:57 -0400)
committerRob Clark <robdclark@gmail.com>
Fri, 22 Mar 2019 12:53:28 +0000 (08:53 -0400)
Fixes:

dEQP-GLES31.functional.image_load_store.early_fragment_tests.no_early_fragment_tests_depth
dEQP-GLES31.functional.image_load_store.early_fragment_tests.no_early_fragment_tests_stencil
dEQP-GLES31.functional.image_load_store.early_fragment_tests.no_early_fragment_tests_depth_fbo
dEQP-GLES31.functional.image_load_store.early_fragment_tests.no_early_fragment_tests_stencil_fbo

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_compiler_nir.c

index f7a68627a4cc06b005c715bf881bb5b18dab57cd..402da13792bd8951dac2a48896bc3853ac1a110d 100644 (file)
@@ -1202,6 +1202,9 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr)
                ctx->funcs->emit_intrinsic_load_ssbo(ctx, intr, dst);
                break;
        case nir_intrinsic_store_ssbo_ir3:
+               if ((ctx->so->type == MESA_SHADER_FRAGMENT) &&
+                               !ctx->s->info.fs.early_fragment_tests)
+                       ctx->so->no_earlyz = true;
                ctx->funcs->emit_intrinsic_store_ssbo(ctx, intr);
                break;
        case nir_intrinsic_get_buffer_size:
@@ -1217,6 +1220,9 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr)
        case nir_intrinsic_ssbo_atomic_xor_ir3:
        case nir_intrinsic_ssbo_atomic_exchange_ir3:
        case nir_intrinsic_ssbo_atomic_comp_swap_ir3:
+               if ((ctx->so->type == MESA_SHADER_FRAGMENT) &&
+                               !ctx->s->info.fs.early_fragment_tests)
+                       ctx->so->no_earlyz = true;
                dst[0] = ctx->funcs->emit_intrinsic_atomic_ssbo(ctx, intr);
                break;
        case nir_intrinsic_load_shared:
@@ -1241,6 +1247,9 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr)
                emit_intrinsic_load_image(ctx, intr, dst);
                break;
        case nir_intrinsic_image_deref_store:
+               if ((ctx->so->type == MESA_SHADER_FRAGMENT) &&
+                               !ctx->s->info.fs.early_fragment_tests)
+                       ctx->so->no_earlyz = true;
                ctx->funcs->emit_intrinsic_store_image(ctx, intr);
                break;
        case nir_intrinsic_image_deref_size:
@@ -1254,6 +1263,9 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr)
        case nir_intrinsic_image_deref_atomic_xor:
        case nir_intrinsic_image_deref_atomic_exchange:
        case nir_intrinsic_image_deref_atomic_comp_swap:
+               if ((ctx->so->type == MESA_SHADER_FRAGMENT) &&
+                               !ctx->s->info.fs.early_fragment_tests)
+                       ctx->so->no_earlyz = true;
                dst[0] = ctx->funcs->emit_intrinsic_atomic_image(ctx, intr);
                break;
        case nir_intrinsic_barrier: