}
static void
-gather_intrinsic_info(const nir_intrinsic_instr *instr,
+gather_intrinsic_info(const nir_shader *nir, const nir_intrinsic_instr *instr,
struct ac_shader_info *info)
{
switch (instr->intrinsic) {
dim == GLSL_SAMPLER_DIM_SUBPASS_MS)
info->ps.uses_input_attachments = true;
mark_sampler_desc(instr->variables[0]->var, info);
+
+ if (nir_intrinsic_image_store ||
+ nir_intrinsic_image_atomic_add ||
+ nir_intrinsic_image_atomic_min ||
+ nir_intrinsic_image_atomic_max ||
+ nir_intrinsic_image_atomic_and ||
+ nir_intrinsic_image_atomic_or ||
+ nir_intrinsic_image_atomic_xor ||
+ nir_intrinsic_image_atomic_exchange ||
+ nir_intrinsic_image_atomic_comp_swap) {
+ if (nir->info.stage == MESA_SHADER_FRAGMENT)
+ info->ps.writes_memory = true;
+ }
break;
}
+ case nir_intrinsic_store_ssbo:
+ case nir_intrinsic_ssbo_atomic_add:
+ case nir_intrinsic_ssbo_atomic_imin:
+ case nir_intrinsic_ssbo_atomic_umin:
+ case nir_intrinsic_ssbo_atomic_imax:
+ case nir_intrinsic_ssbo_atomic_umax:
+ case nir_intrinsic_ssbo_atomic_and:
+ case nir_intrinsic_ssbo_atomic_or:
+ case nir_intrinsic_ssbo_atomic_xor:
+ case nir_intrinsic_ssbo_atomic_exchange:
+ case nir_intrinsic_ssbo_atomic_comp_swap:
+ if (nir->info.stage == MESA_SHADER_FRAGMENT)
+ info->ps.writes_memory = true;
+ break;
default:
break;
}
}
static void
-gather_tex_info(const nir_tex_instr *instr, struct ac_shader_info *info)
+gather_tex_info(const nir_shader *nir, const nir_tex_instr *instr,
+ struct ac_shader_info *info)
{
if (instr->sampler)
mark_sampler_desc(instr->sampler->var, info);
}
static void
-gather_info_block(const nir_block *block, struct ac_shader_info *info)
+gather_info_block(const nir_shader *nir, const nir_block *block,
+ struct ac_shader_info *info)
{
nir_foreach_instr(instr, block) {
switch (instr->type) {
case nir_instr_type_intrinsic:
- gather_intrinsic_info(nir_instr_as_intrinsic(instr), info);
+ gather_intrinsic_info(nir, nir_instr_as_intrinsic(instr), info);
break;
case nir_instr_type_tex:
- gather_tex_info(nir_instr_as_tex(instr), info);
+ gather_tex_info(nir, nir_instr_as_tex(instr), info);
break;
default:
break;
gather_info_input_decl(nir, variable, info);
nir_foreach_block(block, func->impl) {
- gather_info_block(block, info);
+ gather_info_block(nir, block, info);
}
}
unsigned z_order;
pipeline->graphics.db_shader_control = 0;
- if (ps->info.fs.early_fragment_test || !ps->info.fs.writes_memory)
+ if (ps->info.fs.early_fragment_test || !ps->info.info.ps.writes_memory)
z_order = V_02880C_EARLY_Z_THEN_LATE_Z;
else
z_order = V_02880C_LATE_Z;
S_02880C_MASK_EXPORT_ENABLE(ps->info.fs.writes_sample_mask) |
S_02880C_Z_ORDER(z_order) |
S_02880C_DEPTH_BEFORE_SHADER(ps->info.fs.early_fragment_test) |
- S_02880C_EXEC_ON_HIER_FAIL(ps->info.fs.writes_memory) |
- S_02880C_EXEC_ON_NOOP(ps->info.fs.writes_memory);
+ S_02880C_EXEC_ON_HIER_FAIL(ps->info.info.ps.writes_memory) |
+ S_02880C_EXEC_ON_NOOP(ps->info.info.ps.writes_memory);
if (pipeline->device->physical_device->has_rbplus)
pipeline->graphics.db_shader_control |= S_02880C_DUAL_QUAD_DISABLE(1);