nir: Add a lowering pass for backends wanting load_ubo with vec4 offsets. This is very common for backends -- r600, freedreno, and nir_to_tgsi all needed versions of it. Make a common intrinsic to use for it with a shared, slightly-tuned-from-ir3 lowering pass. Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6378>
nir: Add a structurizer v2 (Karol): renamed pathes to paths use more bool use _mesa_set_intersects deduplicated some code fixed some typos v3 (Karol): don't enable structurizer as we do this in vtn now v4 (Jason): A few clean-ups due to unstructured NIR changes v5 (Jason): Misc whitespace and style cleanups Signed-off-by: Karol Herbst <kherbst@redhat.com> Tested-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2401>
nir: Remove the old nir_opt_shrink_load. The old pass only handled intrinsic load_constant, while the new nir_opt_shrink_vectors handles ALU ops, nir load_consts, along with all the load intrinsics. Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6050>
nir: Add a pass to cut the trailing ends of vectors. Ideally we'd also handle unused middles of vectors and reswizzle ALU-only uses of it so we could write fewer channels, but that's future work/ Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6050>
nir,radv/aco: add and use pass to lower make available/visible barriers Lower them to ACCESS_COHERENT to simplify the backend and probably give better performance than invalidating or writing back the entire L0/L1 cache. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>
nir/scheduler: Move nir_scheduler to its own header nir_schedule already has a struct for options which makes it more than just a function declaration. Later patches intend to add more structs to complement these options. In order to make the code easier to manage, this moves the nir_scheduler-related parts out of nir.h to their own header. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5953>
nir/tests: Add tests for opt_if_simplification Test cases: opt_if_simplification - the most trivial test case. opt_if_simplification_single_source_phi_after_if - tests that opt_if_simplification correctly handles single-source phis after the if, found in https://gitlab.freedesktop.org/mesa/mesa/-/issues/3282 Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5945>
nir: add lowering pass for fragcolor -> fragdata this is needed for zink and other drivers which can support fragcolor but not fragdata and want to correctly handle EXT_multiview_draw_buffers Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5687>
nir: add lowering pass for clip plane enabling a pass which rewrites gl_ClipDistance[n] to an undef if the corresponding clip plane is disabled in the rasterizer state this pass is needed for zink to handle api disables of clip planes Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5529>
meson: use gnu_symbol_visibility argument This uses a meson builtin to handle -fvisibility=hidden. This is nice because we don't need to track which languages are used, if C++ is suddenly added meson just does the right thing. Acked-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
nir: add pass to lower disjoint wrmask's Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Eric Anholt <eric@anholt.net>
nir: Move nir_lower_mediump_outputs from ir3 (Original code from ir3) Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Acked-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4716>
nir: add common convert_ycbcr for vulkan csc Copied from anv, replaced state with passing model/range directly. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Acked-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: D Scott Phillips <d.scott.phillips@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4528>
meson: inline `inc_common` Let's make it clear what includes are being added everywhere, so that they can be cleaned up. Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
nir: add a bool bitsize lowering pass The pass lowers 1-bit booleans produced by NIR to the native bitsize of the operations that produce them. v2: change on lower_load_const_instr after upstream changes. Added TODO2 to explain it, as it was not properly tested yet (see already existing TODO) (Neil) Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>
nir: Add pass to combine adjacent scoped memory barriers SPIR-V generates very granular barriers, however HW and backends might not necessarily take advantage of those. This pass provides a general mechanism to combine such barriers. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3224>
nir: add pass to lower discard() to demote() This pass is intended to work around game bugs, only! It also lowers nir_intrinsic_load_helper_invocation to nir_intrinsic_is_helper_invocation for consistency. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4047>
nir: Add SSBO->global lowering pass To facilitate lowering SSBOs to globals, we need a load_ssbo_address intrinsic. This intrinsic takes an SSBO index and loads the address in global memory of the SSBO (likely implemented via a uniform in the driver). In the future, we'll support bounds checking, but at the moment this is not supported (this pass should only be used for trusted contexts at the moment, i.e. contexts without robustness extensions). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2753>
Rename nir_lower_constant_initializers to nir_lower_variable_initalizers This is naming is more clear as nir_variables can be initializes not just with a nir_constant but with a pointer to another nir_variable. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3047> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3047>
gitlab-ci: Add ppc64el and s390x cross-build jobs Using LLVM 8 for ppc64el and 7 for s390x (which hits some coroutine related issues with LLVM 8). There are some test failures we need to ignore for now. Also, the timeout needs to be bumped from the default 30s for some tests, because they can take longer under emulation. Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3643>