mesa/src/intel
Jason Ekstrand 3cc58e6470 nir: Add and use some deref mode helpers
NIR derefs currently have exactly one variable mode.  This is about to
change so we can handle OpenCL generic pointers.  In order to transition
safely, we need to audit every deref->mode check.  This commit adds a
set of helpers that provide more nuanced mode checks and converts most
of NIR to use them.

For simple cases, we add nir_deref_mode_is and nir_deref_mode_is_one_of
helpers.  These can be used in passes which don't have to bother with
generic pointers and just want to know what mode a thing is.  If the
pass ever encounters generic pointers in a way that this check would be
unsafe, it will assert-fail to alert developers that they need to think
harder about things and fix the pass.

For more complex passes which require a more nuanced understanding of
modes, we add nir_deref_mode_may_be and nir_deref_mode_must_be helpers
which accurately describe the compiler's best knowledge about the given
deref.  Unfortunately, we may not be able to exactly identify the mode
in a generic pointers scenario so we have to be very careful when we use
these.  Conversion of these passes is left to later commits.

For the case of mass lowering of a particular mode (nir_lower_explicit_io
is one good example), we add nir_deref_mode_is_in_set.  This is also
pretty assert-happy like nir_deref_mode_is but is for a set containment
comparison on deref modes where you expect the deref to either be all-in
or all-out.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
2020-11-03 22:18:28 +00:00
..
blorp nir/builder: Add a nir_ieq_imm helper 2020-11-03 22:18:28 +00:00
common intel/mi_builder: Support gen11 command-streamer based register offsets 2020-10-27 16:11:12 -07:00
compiler intel/compiler: remove branch weight heuristic 2020-11-03 10:49:04 +00:00
dev intel: remove dead code 2020-11-02 19:58:56 +00:00
genxml intel: remove dead code 2020-11-02 19:58:56 +00:00
isl genxml: drop gen10 2020-10-20 07:56:40 +00:00
perf intel: remove dead code 2020-11-02 19:58:56 +00:00
tools intel/tools: fix invalid type in argument to printf 2020-10-29 12:49:36 +00:00
vulkan nir: Add and use some deref mode helpers 2020-11-03 22:18:28 +00:00
Android.blorp.mk intel: android: remove libdrm_intel requirement 2017-03-30 19:07:23 +01:00
Android.common.mk intel: split driver/device UUID generators 2020-10-07 11:11:23 +03:00
Android.compiler.mk android: fix build issues with brw_nir_trig_workarounds.c 2017-10-04 07:39:05 +03:00
Android.dev.mk intel: add identifier for debug purposes 2020-05-20 15:58:22 +00:00
Android.genxml.mk genxml: drop gen10 2020-10-20 07:56:40 +00:00
Android.isl.mk intel/isl: Don't generate Gen10-specific functions 2020-10-15 09:29:54 -07:00
Android.mk i965: extract performance query metrics 2019-04-17 14:10:42 +01:00
Android.perf.mk i965: extract performance query metrics 2019-04-17 14:10:42 +01:00
Android.vulkan.mk anv: Don't generate Gen10-specific functions 2020-10-15 09:29:54 -07:00
Makefile.perf.am i965: extract performance query metrics 2019-04-17 14:10:42 +01:00
Makefile.sources genxml: drop gen10 2020-10-20 07:56:40 +00:00
meson.build meson: only build imgui when needed 2019-11-25 07:51:56 +00:00