nir: use enum operator helper for nir_variable_mode and nir_metadata those are used quite a bit Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6520>
nir,amd: remove trinary_minmax opcodes These consist of the variations nir_op_{i|u|f}{min|max|med}3 which are either lowered in the backend (LLVM) anyway or can be recombined by the backend (ACO). Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6421>
aco: use nir_intrinsic_has_access Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6402>
aco: set constant_data_offset correctly in the case of merged shaders setup_nir() is done for all shaders before any of them are selected, so constant_data_offset could be incorrect for the first shader. Fixes incorrect geometry in Mafia III and Max Payne 3. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2768 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6205>
aco: disable SMEM stores on GFX10.3 These are removed in GFX10.3 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/5546>
amd: Swap from nir_opt_shrink_load() to nir_opt_shrink_vectors(). This should do much more trimming than shrink_load, and is a win on i965's vec4 and nir-to-tgsi. For scalar backends like this that don't need ALU shrinking, it still gets more load intrinsics covered. 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: Stop passing an options arg to nir_lower_int64() This information is exposed through shader->options->lower_int64_options. Removing the extra arg forces drivers to initialize this field correctly. This also allows us to check the int64 lowering options from each int64 lowering helper and decide if we should lower the instructions we introduce. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Rob Clark <robdclark@chromium.org> Acked-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5588>
aco: Use nir_foreach_variable_with_modes to walk SSBOs Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>
nir: Add nir_foreach_shader_in/out_variable helpers Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>
radv: align the LDS size in calculate_tess_lds_size() Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5837>
aco: add support for nir_intrinsic_shared_atomic_fadd Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6000>
aco: move some setup code into helpers Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6013>
aco: use nir_addition_might_overflow to combine additions into SMEM fossil-db (Navi): Totals from 24656 (18.14% of 135946) affected shaders: CodeSize: 120077160 -> 118877304 (-1.00%); split: -1.01%, +0.01% Instrs: 23192657 -> 22979553 (-0.92%); split: -0.94%, +0.02% VMEM: 165151115 -> 151861460 (-8.05%); split: +0.14%, -8.19% SMEM: 18133265 -> 16709635 (-7.85%); split: +0.28%, -8.13% VClause: 385011 -> 384447 (-0.15%); split: -0.16%, +0.02% SClause: 954884 -> 838266 (-12.21%); split: -12.34%, +0.12% 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/2720>
aco: implement b2i8/b2i16 Fixes lots of tests under dEQP-VK.spirv_assembly.type.* 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/5993>
aco: set tcs_in_out_eq=false if float controls of VS and TCS stages differ Otherwise, we might have both VS and TCS code in the same block but float controls are set per-block. We also rely on VS code not dominating TCS code for the optimizer to work correctly. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5773>
aco: improve vectorization of 8/16-bit loads/stores 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/5207>
radv/aco,aco: allow SMEM SSBO loads on GFX6/7 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/5207>
aco: allow SMEM for some sub-dword accesses 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/5207>
aco: only use SMEM if we can prove it's safe Totals from 26 (0.02% of 127638) affected shaders: SGPRs: 1680 -> 1664 (-0.95%) VGPRs: 1492 -> 1504 (+0.80%) CodeSize: 233140 -> 233016 (-0.05%); split: -0.09%, +0.04% Instrs: 47121 -> 47114 (-0.01%); split: -0.08%, +0.06% VMEM: 4930 -> 4655 (-5.58%); split: +0.12%, -5.70% SMEM: 2030 -> 2001 (-1.43%); split: +3.79%, -5.22% VClause: 891 -> 947 (+6.29%) SClause: 876 -> 816 (-6.85%) Copies: 4734 -> 4716 (-0.38%); split: -0.40%, +0.02% Branches: 2048 -> 2047 (-0.05%) PreSGPRs: 1400 -> 1396 (-0.29%) PreVGPRs: 1440 -> 1443 (+0.21%) 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/5207>
radv/aco: implement logic64 instead of lowering to make use of the scalar ALU Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5527>