static void setup_output(struct ir3_context *ctx, nir_intrinsic_instr *intr);
static void
-switch_to_late_z_if_fs(struct ir3_context *ctx)
-{
- if ((ctx->so->type == MESA_SHADER_FRAGMENT) &&
- !ctx->s->info.fs.early_fragment_tests)
- ctx->so->no_earlyz = true;
-}
-
-static void
emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr)
{
const nir_intrinsic_info *info = &nir_intrinsic_infos[intr->intrinsic];
break;
case nir_intrinsic_store_global_ir3:
- switch_to_late_z_if_fs(ctx);
ctx->funcs->emit_intrinsic_store_global_ir3(ctx, intr);
break;
case nir_intrinsic_load_global_ir3:
emit_intrinsic_load_ssbo(ctx, intr, dst);
break;
case nir_intrinsic_store_ssbo_ir3:
- switch_to_late_z_if_fs(ctx);
ctx->funcs->emit_intrinsic_store_ssbo(ctx, intr);
break;
case nir_intrinsic_get_ssbo_size:
case nir_intrinsic_ssbo_atomic_xor_ir3:
case nir_intrinsic_ssbo_atomic_exchange_ir3:
case nir_intrinsic_ssbo_atomic_comp_swap_ir3:
- switch_to_late_z_if_fs(ctx);
dst[0] = ctx->funcs->emit_intrinsic_atomic_ssbo(ctx, intr);
break;
case nir_intrinsic_load_shared:
break;
case nir_intrinsic_image_store:
case nir_intrinsic_bindless_image_store:
- switch_to_late_z_if_fs(ctx);
ctx->funcs->emit_intrinsic_store_image(ctx, intr);
break;
case nir_intrinsic_image_size:
case nir_intrinsic_bindless_image_atomic_exchange:
case nir_intrinsic_image_atomic_comp_swap:
case nir_intrinsic_bindless_image_atomic_comp_swap:
- switch_to_late_z_if_fs(ctx);
dst[0] = ctx->funcs->emit_intrinsic_atomic_image(ctx, intr);
break;
case nir_intrinsic_scoped_barrier:
case nir_intrinsic_global_atomic_xor_ir3:
case nir_intrinsic_global_atomic_exchange_ir3:
case nir_intrinsic_global_atomic_comp_swap_ir3: {
- switch_to_late_z_if_fs(ctx);
dst[0] = ctx->funcs->emit_intrinsic_atomic_global(ctx, intr);
break;
}
ctx->s->info.fs.needs_quad_helper_invocations)
so->need_pixlod = true;
+ if ((ctx->so->type == MESA_SHADER_FRAGMENT) &&
+ !ctx->s->info.fs.early_fragment_tests)
+ ctx->so->no_earlyz |= ctx->s->info.writes_memory;
+
out:
if (ret) {
if (so->ir)