diff --git a/src/gallium/drivers/panfrost/pan_assemble.c b/src/gallium/drivers/panfrost/pan_assemble.c index bd8c0fd5718..771cb2d7f61 100644 --- a/src/gallium/drivers/panfrost/pan_assemble.c +++ b/src/gallium/drivers/panfrost/pan_assemble.c @@ -347,6 +347,8 @@ panfrost_shader_compile(struct panfrost_context *ctx, s->info.writes_memory || s->info.fs.uses_discard || s->info.fs.uses_demote; + + state->can_discard = s->info.fs.uses_discard; break; case MESA_SHADER_COMPUTE: attribute_count = util_bitcount(s->info.images_used); @@ -356,10 +358,7 @@ panfrost_shader_compile(struct panfrost_context *ctx, unreachable("Unknown shader state"); } - state->can_discard = s->info.fs.uses_discard; - state->helper_invocations = s->info.fs.needs_quad_helper_invocations; state->stack_size = program->tls_size; - state->reads_frag_coord = (s->info.inputs_read & (1 << VARYING_SLOT_POS)) || BITSET_TEST(s->info.system_values_read, SYSTEM_VALUE_FRAG_COORD); state->reads_point_coord = s->info.inputs_read & (1 << VARYING_SLOT_PNTC); @@ -411,8 +410,17 @@ panfrost_shader_compile(struct panfrost_context *ctx, else pan_prepare_midgard_props(state, program, stage); + state->properties.shader_contains_barrier = + s->info.uses_memory_barrier | + s->info.uses_control_barrier; + + /* Ordering gaurantees are the same */ + if (stage == MESA_SHADER_FRAGMENT) { + state->properties.shader_contains_barrier |= + s->info.fs.needs_quad_helper_invocations; + } + state->properties.stencil_from_shader = state->writes_stencil; - state->properties.shader_contains_barrier = state->helper_invocations; state->properties.depth_source = state->writes_depth ? MALI_DEPTH_SOURCE_SHADER : MALI_DEPTH_SOURCE_FIXED_FUNCTION; diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index c9fb1e3cfa6..c4a3cd7b9bf 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -245,9 +245,6 @@ struct panfrost_shader_state { struct panfrost_ubo_push push; - /* Should we enable helper invocations */ - bool helper_invocations; - /* GPU-executable memory */ struct panfrost_bo *bo;