nir: Add a pass for lowering shaders to single-sampled

On Intel, we have to do this because we can't ask for the per-sample
barycentrics without setting the per-sample dispatch bit or the GPU will
hang.  However, nothing we're doing in this pass is Intel-specific and
it may be a useful optimization for someone else so we may as well make
it a generic NIR pass.  This version actually does a bit more than the
current brw_nir_demote_sample_qualifiers() pass as it also handles
pre-nir_lower_io interp_dref_at* as well as a couple system values which
we can easily constant-fold.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14020>
This commit is contained in:
Jason Ekstrand
2021-12-01 16:30:08 -06:00
committed by Marge Bot
parent ca9f0f72db
commit 23b2d625dd
3 changed files with 131 additions and 0 deletions

View File

@@ -194,6 +194,7 @@ files_libnir = files(
'nir_lower_samplers.c',
'nir_lower_scratch.c',
'nir_lower_shader_calls.c',
'nir_lower_single_sampled.c',
'nir_lower_ssbo.c',
'nir_lower_subgroups.c',
'nir_lower_system_values.c',