mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
panfrost: Unify barrier+helper handling
These are unified in the hardware, so let's unify them in pan_shader_info. Hoisting this logic to pan_shader.c avoids the need to duplicate this logic for Midgard/Bifrost (RSD packing) and Valhall (SPD packing). Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15204>
This commit is contained in:
parent
30d0c2e390
commit
2604c65174
3 changed files with 11 additions and 5 deletions
|
|
@ -241,7 +241,6 @@ GENX(pan_shader_compile)(nir_shader *s,
|
|||
info->fs.outputs_read;
|
||||
|
||||
info->fs.can_discard = s->info.fs.uses_discard;
|
||||
info->fs.helper_invocations = s->info.fs.needs_quad_helper_invocations;
|
||||
info->fs.early_fragment_tests = s->info.fs.early_fragment_tests;
|
||||
|
||||
/* List of reasons we need to execute frag shaders when things
|
||||
|
|
@ -266,6 +265,11 @@ GENX(pan_shader_compile)(nir_shader *s,
|
|||
!info->fs.can_discard &&
|
||||
!info->fs.outputs_read;
|
||||
|
||||
/* Requires the same hardware guarantees, so grouped as one bit
|
||||
* in the hardware.
|
||||
*/
|
||||
info->contains_barrier |= s->info.fs.needs_quad_helper_invocations;
|
||||
|
||||
info->fs.reads_frag_coord =
|
||||
(s->info.inputs_read & (1 << VARYING_SLOT_POS)) ||
|
||||
BITSET_TEST(s->info.system_values_read, SYSTEM_VALUE_FRAG_COORD);
|
||||
|
|
|
|||
|
|
@ -255,8 +255,6 @@ pan_shader_prepare_rsd(const struct pan_shader_info *shader_info,
|
|||
rsd->properties.uniform_buffer_count = shader_info->ubo_count;
|
||||
|
||||
if (shader_info->stage == MESA_SHADER_FRAGMENT) {
|
||||
rsd->properties.shader_contains_barrier |=
|
||||
shader_info->fs.helper_invocations;
|
||||
rsd->properties.stencil_from_shader =
|
||||
shader_info->fs.writes_stencil;
|
||||
rsd->properties.depth_source =
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ struct pan_shader_info {
|
|||
bool reads_frag_coord;
|
||||
bool reads_point_coord;
|
||||
bool reads_face;
|
||||
bool helper_invocations;
|
||||
bool can_discard;
|
||||
bool writes_depth;
|
||||
bool writes_stencil;
|
||||
|
|
@ -295,8 +294,13 @@ struct pan_shader_info {
|
|||
} vs;
|
||||
};
|
||||
|
||||
bool separable;
|
||||
/* Does the shader contains a barrier? or (for fragment shaders) does it
|
||||
* require helper invocations, which demand the same ordering guarantees
|
||||
* of the hardware? These notions are unified in the hardware, so we
|
||||
* unify them here as well.
|
||||
*/
|
||||
bool contains_barrier;
|
||||
bool separable;
|
||||
bool writes_global;
|
||||
uint64_t outputs_written;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue