Commit graph

11540 commits

Author SHA1 Message Date
Georg Lehmann
93d05cdfd8 nir/opt_algebraic: move fsat last for fsqrt(fsat(a))
This should be exact, even for all special values:

fsqrt(NaN) -> NaN
fsqrt(-0.0) -> 0.0
fsqrt(-Inf) -> NaN
fsqrt(negative finite) -> NaN

So all of these get saturated to +0.0

All numbers >= 1.0 will have a square root >= 1.0,
which will be saturate to 1.0

Moving the fsat guarantees that it can use an output modifier
for hardware that has those, and shouldn't harm other hardware either.

Foz-DB Navi21:
Totals from 255 (0.31% of 82151) affected shaders:
Instrs: 664906 -> 664194 (-0.11%)
CodeSize: 3623500 -> 3619188 (-0.12%)
Latency: 11336397 -> 11335688 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 2716430 -> 2715726 (-0.03%); split: -0.03%, +0.00%
VALU: 442603 -> 441891 (-0.16%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39202>
2026-01-09 07:34:46 +00:00
Ian Romanick
aba079b3af nir/algebraic: Detect missing f on F-strings
Missing f in other cases seems to be caught either elsewhere in the
script or by the C compiler.

Fixes: c49d6e0480 ("nir/algebraic: Elide range clamping of f2u sources")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39031>
2026-01-08 13:20:48 -08:00
Ian Romanick
d4a87e85b3 nir/algebraic: Add missing f on F-strings
Without this, nir_algebraic.py was treating "f2i{int_sz}_sat" as the
literal opcode name when it should have been "f2i8_sat" or similar.

Fixes: c49d6e0480 ("nir/algebraic: Elide range clamping of f2u sources")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39031>
2026-01-08 13:19:35 -08:00
Juan A. Suarez Romero
a6330ed4d0 nir: add ACCESS to load_uniforms
v3d/v3dv drivers require this information.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38759>
2026-01-08 12:59:44 +00:00
Georg Lehmann
a706769a0b nir: move exact bit to nir_fp_math_control
Unifies nir per instruction float control.

In the future this can be split into contract/reassoc/transform
like SPIR-V.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (except SPIR-V)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39103>
2026-01-07 09:40:57 +00:00
Georg Lehmann
ce27703768 spirv: don't set float control for integer dot
As the name says, integer dot products do not operate on floats.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39103>
2026-01-07 09:40:57 +00:00
Georg Lehmann
eb4737a1dd nir: add nir_alu_instr_is_exact helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39103>
2026-01-07 09:40:57 +00:00
Georg Lehmann
b70294b91f nir: document signed zero, inf, nan preserve flags
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39103>
2026-01-07 09:40:56 +00:00
Georg Lehmann
9d027fc870 nir/opt_varyings: actually clone alu math control to different shader
Cc: mesa-stable

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39103>
2026-01-07 09:40:56 +00:00
Marek Olšák
1912a00a91 ALL: use SHA1_DIGEST_LENGTH etc. instead of hardcoding the numbers
only build_id is switched to use literal 20 instead of SHA1_DIGEST_LENGTH
because we will increase SHA1_DIGEST_LENGTH to BLAKE3_KEY_LEN

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39110>
2026-01-07 08:32:33 +00:00
Emma Anholt
1e8a1e9285 nir/algebraic: Apply autopep8.
I needed to reformat the nir_algebraic unit test generation, but we
weren't in pep8 to begin with.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:49 +00:00
Konstantin Seurer
e2ac22a068 nir: Allow using nir_eval_const_opcode in C++ code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:49 +00:00
Konstantin Seurer
295b67f7bf nir: Allow shaders in tests to be annotated
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:49 +00:00
Konstantin Seurer
2ed16ed1a6 nir/print: Print annotations as comments
Also prints them in the same line as the instruction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:49 +00:00
Georg Lehmann
17615b412b nir: prevent undefined behavior in idiv/imod/irem constant folding
Prevents SIGFPE when doing constant evaluation in the upcoming
nir_opt_algebraic_pattern_tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:49 +00:00
Emma Anholt
feffd0e445 nir: Avoid UB of (int)0xff << 24 evaluating usadd_4x8_vc4.
Caught by UBSan on introduction of nir_opt_algebraic_pattern_test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:49 +00:00
Konstantin Seurer
a8224e3e00 nir/opt_algebraic: Do not emit patterns for 64bit booleans
Avoids assertion failures trying to constant-evaluate the pattern with the
new nir_opt_algebraic_pattern_tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:48 +00:00
Konstantin Seurer
211c7db8e3 nir/opt_algebraic: Remove a pattern for 8bit floats
Avoids assertion failures trying to constant-evaluate the pattern with the
new nir_opt_algebraic_pattern_tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:48 +00:00
Emma Anholt
afece95101 nir/opt_algebraic: Fix return type of fdot(vec(a, 0.0, ...), b).
The replace pattern was generating a vector when it should have been
scalar.  Fixes validation failures with the new algebraic unit tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39184>
2026-01-06 21:27:47 +00:00
Georg Lehmann
9c6d294111 nir/opcodes: use util_max_num/util_min_num for fmin/fmax constant folding.
Hopefully, this is easier to read.

The SPIR-V behavior has also since been clarified to require associativity.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39137>
2026-01-06 10:55:03 +00:00
Georg Lehmann
026d4cd200 nir/opcodes: fix fsat signed zero correctness
fsat(-0.0) must return +0.0.

Cc: mesa-stable

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39137>
2026-01-06 10:55:03 +00:00
Marek Olšák
86b74563a0 nir/clip_cull_distance_utils: add more assertions validating the type & sizes
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39146>
2026-01-05 21:24:10 +00:00
Marek Olšák
bba2536bb0 nir/clip_cull_distance_utils: fix assertion failures with GL_EXT_mesh_shader
Those outputs are never compact in GLSL mesh shaders. The assertions might
not be needed.

Cc: mesa-stable

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39146>
2026-01-05 21:24:10 +00:00
Alyssa Rosenzweig
347a0ac212 panfrost,nir: drop my lonely Authors tags
We all know who wrote a bunch of Panfrost code. No need to repeat this a million
places, the copyright line is plenty.

in cases where there's a joint me & Italo/Eric/.. tag, i've left it alone to
respect others' potential wishes.

$ find . -type f -exec perl -i -p0e 's/ \*\s+\* Author[^\n]+\s+\*\s+Alyssa[^\n]+\n \*\// \*\//' \{} \;

v2: delete more tags (Boris).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39136>
2026-01-05 17:47:52 +00:00
Georg Lehmann
c8ce0df2d2 nir/opt_algebraic: replace is_negative_zero with constant -0.0
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Now that nir_search respects the sign of zero, we don't need
a manual helper for this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39123>
2026-01-03 12:42:23 +00:00
Georg Lehmann
0d255011ae nir/search: respect sign of zero when comparing floats
Floating point comparison treats -0.0 and 0.0 as equal,
but do this in nir_search makes patterns signed zero incorrect.

Foz-DB Navi21:
Totals from 1460 (1.16% of 125360) affected shaders:
MaxWaves: 33704 -> 33710 (+0.02%)
Instrs: 2559362 -> 2558823 (-0.02%); split: -0.02%, +0.00%
CodeSize: 14502684 -> 14496352 (-0.04%); split: -0.05%, +0.00%
VGPRs: 71800 -> 71776 (-0.03%)
Latency: 19274782 -> 19274267 (-0.00%); split: -0.01%, +0.00%
InvThroughput: 3307870 -> 3299091 (-0.27%); split: -0.27%, +0.00%
SClause: 158698 -> 158703 (+0.00%); split: -0.00%, +0.00%
Copies: 240291 -> 241003 (+0.30%); split: -0.03%, +0.32%
PreSGPRs: 73203 -> 73206 (+0.00%); split: -0.00%, +0.01%
PreVGPRs: 62515 -> 62508 (-0.01%)
VALU: 1564970 -> 1564331 (-0.04%); split: -0.04%, +0.00%
SALU: 378546 -> 378654 (+0.03%); split: -0.00%, +0.03%

This difference is suprisingly positive, the only patterns affected
did previously signed zero incorrect bcsel -> b2f.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39123>
2026-01-03 12:42:23 +00:00
Georg Lehmann
7d2a946730 nir/opt_algebraic: canonicalize scmp with -0.0
We already do this for non fused comparisons.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39123>
2026-01-03 12:42:23 +00:00
Georg Lehmann
2824c12252 nir/opt_algebraic: explicitly add some -0.0 variants of patterns
Foz-DB Navi21:
Totals from 5 (0.00% of 125360) affected shaders:
CodeSize: 28812 -> 28744 (-0.24%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39123>
2026-01-03 12:42:23 +00:00
Timur Kristóf
2ecb7a9e18 nir: Add pass to lower workgroup size
Lowers a shader to use a smaller workgroup to do the same work,
while it will still appear as a bigger workgroup to applications.

To achieve this, the pass augments the CF of the shader
so that each real subgroup will execute two or more logical
subgroups. A logical subgroup represents what the application
can observe as a subgroup.

The size of a logical subgroup is the same as a real subgroup.
Only one logical subgroup may be executed per real subgroup
at the same time. This ensures that all subgroup operations
keep working and the subgroup invocation ID stays the same.

- When the CF contains barriers, we can't just repeat
  the code and we need to augment each CF node individually
  so that they are aware of logical subgroups.

- In case parts of the CF don't contain any barriers, we can simply
  repeat and predicate that CF for each logical subgroup.
  It is technically not necessary to implement this strategy, but
  in practice it helps reduce the amount of branches in the shader
  and therefore improves compile times.

The pass is mainly intended for working around HW limitations,
for example when the HW has an upper limit on the workgroup size
or doesn't support workgroups at all, but the API requires a
certain minimum.

Notes:
- Only applicable to shader stages that use workgroups
- Hits an assertion when called on smaller workgroups
- Always flattens workgroup size to 1D
- Creates local variables
- Does not change subgroup size
- Variable workgroup size not supported yet, maybe later

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Anna Maniscalco <anna.maniscalco2000@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37985>
2026-01-02 13:33:54 -06:00
Pavel Ondračka
0b39b5ea63 nir/opt_algebraic: improve dot product narrowing
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The issue is that the current narrowing patterns are not working in a lot
of cases, for example
(('fdot3', ('vec3', a, 0.0, 0.0), b), ('fmul', a, b)),
is missing patterns like this:

32x3   %1 = load_const (0x3f800000, 0x00000000, 0x00000000) = (1.000000, 0.000000, 0.000000)
32x4   %7 = vec4 %6, %2 (0x0), %2 (0x0), %2 (0x0)
32    %19 = fdot3 %1 (1.000000, 0.000000, 0.000000), %7.xyz

or after some later transforms:

32x2   %0 = load_const (0x3f800000, 0x00000000) = (1.000000, 0.000000)
32x2   %6 = vec2 %5, %1 (0x0)
32    %18 = fdot3 %0 (1.000000, 0.000000).xyy, %6.xyy

This patch is heavily based on old branch from Ian Romanick from 2019.

r300 RV530 shader-db:
total instructions in shared programs: 128900 -> 128882 (-0.01%)
instructions in affected programs: 621 -> 603 (-2.90%)
helped: 10
HURT: 1
total cycles in shared programs: 191837 -> 191828 (<.01%)
cycles in affected programs: 799 -> 790 (-1.13%)
helped: 7
HURT: 1

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39068>
2026-01-02 16:07:10 +01:00
Timur Kristóf
2b62738b9b nir: Add new nir_remove_outputs pass
Introduce a new NIR pass called nir_remove_outputs which works on
lowered I/O intrinsics and can remove any output varying or sysval.
This is meant to replace custom solutions in drivers,
such as radv_remove_varyings and similar.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33928>
2026-01-01 21:25:42 -06:00
Timur Kristóf
1981b9836b nir/opt_vectorize_io: Fix allow_holes option
Only allow holes between the first and last used component.
Do not load unused components before the first used component.

This fixes test failures with a bunch of VK CTS tests
with allow_holes enabled on RADV:
dEQP-VK.tessellation.tess_io.max_in_out.with_f16.*

Fixes: 6286c1c66f
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33979>
2026-01-01 17:38:01 -06:00
Marek Olšák
99a42bdd4b nir,radeonsi: simplify load_color0 & load_color1 intrinsics and shader_info
We don't need the shader_info fields anymore. sample and centroid fields
are unused. The interp field is already available from
si_shader_info::color_interpolate.

The loads don't need to be sysvals. Add also the _amd suffix.

Don't handle it in st_nir_lower_drawpixels either because the intrinsics
are created much later in compilation now.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38802>
2026-01-01 18:30:28 +00:00
Georg Lehmann
369a3b22b4 nir/opt_uniform_subgroup: optimize uniform ddx/ddy
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We can't just use 0.0 as the replacement because of NaN/Inf.
But turning the intrinsic into a simple fsub should still be better
or at least equal.

Foz-DB Navi48:
Totals from 128 (0.10% of 125402) affected shaders:
MaxWaves: 3684 -> 3708 (+0.65%)
Instrs: 111150 -> 111055 (-0.09%); split: -0.20%, +0.11%
CodeSize: 587176 -> 590800 (+0.62%); split: -0.01%, +0.63%
VGPRs: 6540 -> 6480 (-0.92%)
Latency: 382775 -> 383332 (+0.15%); split: -0.15%, +0.29%
InvThroughput: 80909 -> 80530 (-0.47%); split: -0.51%, +0.04%
VClause: 1433 -> 1430 (-0.21%)
SClause: 1834 -> 1841 (+0.38%); split: -0.11%, +0.49%
Copies: 6130 -> 6096 (-0.55%); split: -1.29%, +0.73%
PreSGPRs: 7352 -> 7356 (+0.05%)
PreVGPRs: 4797 -> 4721 (-1.58%)
VALU: 71892 -> 71435 (-0.64%); split: -0.64%, +0.01%
SALU: 12665 -> 13056 (+3.09%); split: -0.06%, +3.14%

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39112>
2026-01-01 08:43:55 +00:00
Sviatoslav Peleshko
f3eb98ec57 nir/normalize_cubemap_coords: Handle the projector before the normalization
Applying the projector after the normalization breaks the coordinates, so
apply it early. Usually it's not even necessary for the cubemaps anyway,
but ARB_fragment_program and TGSI allow it.

Fixes: 52e71809 ("nir: Add a cubemap normalizing pass")
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39087>
2025-12-30 16:25:09 +00:00
Georg Lehmann
5e8cc19a3b nir: remove per shader float fast math flags
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
These were redundant with the per alu fast math flags.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39026>
2025-12-29 10:57:06 +00:00
Georg Lehmann
9da2d21804 vtn: implement default fp_math_ctrl without using execution mode
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39026>
2025-12-29 10:57:06 +00:00
Georg Lehmann
6e67267045 nir/opt_varyings: use per instruction nan flag for promoting to flat
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39026>
2025-12-29 10:57:06 +00:00
Georg Lehmann
4f5a29ec32 nir/opt_varyings: use per instruction inf/nan flag for moving past interp
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39026>
2025-12-29 10:57:06 +00:00
Georg Lehmann
f3290219ab nir: use a seperate enum for per alu floating point math control
We don't need one bit per bitsize per instruction if only one actually
matters in the end.

First step towards moving NIR in the direction of full float_controls2
only.

Also rename this from fp_fast_math, because that name implied that 0 is
the no fast math mode, while the opposite was the case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39026>
2025-12-29 10:57:05 +00:00
Eric Engestrom
74aa12e5ab compiler/rust: drop "borrow of a value the compiler would automatically borrow"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
91e60e210a compiler/rust: allow CFG & BitSetStreamTrait to have a len() without also having an is_empty()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
e825eac272 compiler/rust: remove unnecessary lifetimes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
cb57b77239 compiler/rust: rewrite match into a simpler if let
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
1def70585b compiler/rust: replace !first.is_none() with first.is_some()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
f571428274 nak: remove "reference which is immediately dereferenced by the compiler"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
47ebdbab81 meson: add rust_global_args for flags for all the rust compilations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Georg Lehmann
71f0c0d6a6 nir/opt_uniform_subgroup: optimize add/xor reduce of bcsel(div, con, con)
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Foz-DB Navi48:
Totals from 12 (0.01% of 97623) affected shaders:
Instrs: 9207 -> 8973 (-2.54%)
CodeSize: 54192 -> 52832 (-2.51%)
VGPRs: 768 -> 480 (-37.50%)
Latency: 39516 -> 38507 (-2.55%)
InvThroughput: 10155 -> 9859 (-2.91%)
PreSGPRs: 329 -> 332 (+0.91%)
PreVGPRs: 268 -> 263 (-1.87%)
VALU: 4393 -> 4257 (-3.10%)
SALU: 1037 -> 1019 (-1.74%)
VOPD: 602 -> 599 (-0.50%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38974>
2025-12-19 20:23:23 +00:00
Georg Lehmann
0e5e1cb9b0 nir/opt_uniform_subgroup: optimize min/max/and/or reduce of bcsel(div, con, con)
Foz-DB Navi48:
Totals from 1 (0.00% of 97397) affected shaders:
Instrs: 1848 -> 1834 (-0.76%)
CodeSize: 9996 -> 9908 (-0.88%)
VGPRs: 96 -> 72 (-25.00%)
Latency: 17371 -> 17358 (-0.07%)
Copies: 190 -> 191 (+0.53%)
PreVGPRs: 43 -> 41 (-4.65%)
VALU: 657 -> 648 (-1.37%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38974>
2025-12-19 20:23:23 +00:00
Georg Lehmann
4d8cc7d82e nir/divergence: add nir_def_is_divergent_at_use_block helper
For cases where the block we are interested in is not the immediate block
of the nir_src.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38974>
2025-12-19 20:23:23 +00:00