Commit graph

217664 commits

Author SHA1 Message Date
David Rosca
ce25865e8f radeonsi/vcn: Clean up decode flags
Always OR the flags and replace numeric value with a define.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39450>
2026-01-26 15:00:06 +00:00
Benjamin Cheng
c10ebb0fda radv/video: Use a more reliable way of computing tile sizes
Some apps (old FFmpeg, contemporary CTS) send down pMi{Col,Row}Starts in
SB units, not MI units. Instead of dependening on those values which
could be unreliable, derive the tile sizes in SB using other parameters.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39492>
2026-01-26 14:41:20 +00:00
Wenfeng Gao
98f5fa618b mediafoundation: Support externally provided motion hints
Added support for externally provided motion hints by reading the
MFSampleExtension_MoveRegions sample attribute.

The motion hint data is converted into pipe_enc_move_info and passed
down to the driver for use during encoding.

Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39515>
2026-01-26 14:26:21 +00:00
Patrick Lerda
afcead9158 r600: fix rv770 clamp to max_texel_buffer_elements
This change fixes the clamp to max_texel_buffer_elements
issue related to rv770 and older gpus.

Here are the tests fixed on rv770:
spec/arb_texture_buffer_object/texture-buffer-size-clamp/r8ui_texture_buffer_size_via_sampler: fail pass
spec/arb_texture_buffer_object/texture-buffer-size-clamp/rg8ui_texture_buffer_size_via_sampler: fail pass
spec/arb_texture_buffer_object/texture-buffer-size-clamp/rgba8ui_texture_buffer_size_via_sampler: fail pass

Fixes: 1a441ad5cb ("r600: clamp to max_texel_buffer_elements")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39385>
2026-01-26 14:10:55 +00:00
Patrick Lerda
2ed761021f r600: make vertex r10g10b10a2_sscaled conformant on palm and beyond
This is a gl4.3 issue very similar to e8fa3b4950.

The mode r10g10b10a2_sscaled processed as vertex on palm at the
hardware level doesn't follow the current standard. Indeed, the .w
component (2-bits) is not calculated as expected. The table below
describes the situation.

This change fixes this issue by adding two gpu instructions at
the vertex fetch shader stage. An equivalent C representation and
a gpu asm dump of the generated sequence are available below.

.w(2-bits)	expected	palm		cypress
0		 0		0		 0
1		 1		1		 1
2		-2		2		-2
3		-1		3		-1

w_out = w_in - (w_in > 1. ? 4. : 0.);

0002 00000024 A0040000  ALU 2 @72
 0072 801F2C0A 600004C0     1 w:     SETGT*4                __.w,  R10.w, 1.0
 0074 839FCC0A 61400010     2 w:     ADD                    R10.w,  R10.w, -PV.w

Note: cypress returns the expected value, and does not need
this correction.

This change was tested on palm, barts and cayman. Here are the tests fixed:
khr-gl4[3-6]/vertex_attrib_binding/basic-input-case6: fail pass
khr-gles31/core/vertex_attrib_binding/basic-input-case6: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38849>
2026-01-26 13:40:22 +00:00
Patrick Lerda
da1108dcc4 r600: fix rv770 dot4 operations
Using a PV register which is not PV.x, after a dot4 operation,
does not work on rv770. Anyway, this does work on evergreen
but this is not documented.

This change updates this behavior for all the r600 gpus
which fixes the issue on rv770. It adds max4 which has the
same requirement in the case of max4 being implemented.

Here are some of the affected tests on rv770:
piglit/bin/fp-abs-01 -auto -fbo
glcts --deqp-case=KHR-GL31.buffer_objects.triangles
piglit/bin/shader_runner generated_tests/spec/glsl-1.10/execution/built-in-functions/fs-distance-vec2-vec2.shader_test -auto -fbo

Fixes: 942e6af40b ("r600/sfn: use PS and PV inline registers when possible")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39101>
2026-01-26 13:09:48 +00:00
Patrick Lerda
98c5ada8d1 r600: disable l8_srgb on r700 and older gpus
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The gamma is not processed by the hardware when processing a one
component format texture (FMT_8). This change triggers a fall back to
the r8g8b8a8_srgb format which is properly supported by the hardware
of these older gpus.

Here are the tests fixed on rv770:
spec/arb_framebuffer_srgb/fbo-fast-clear: fail pass
spec/ext_texture_srgb/fbo-fast-clear: fail pass
spec/!opengl 1.1/teximage-colors gl_sluminance8/gl_sluminance8 texture with gl_.*: fail pass

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39159>
2026-01-26 12:52:10 +00:00
Patrick Lerda
d5d844bfc4 r600: fix cayman msaa shading behavior
The functionality was working properly at glMinSampleShading(0.)
and glMinSampleShading(1.). The issue was with the intermediary
values. This change makes this function compatible with the
evergreen setup.

Note: this was one of the few functionalities which were working
properly on evergreen but not on cayman.

Here are the tests fixed:
spec/arb_sample_shading/samplemask 4 all/0.500000 partition: fail pass
spec/arb_sample_shading/samplemask 4/0.500000 partition: fail pass
spec/arb_sample_shading/samplemask 6 all/0.250000 partition: fail pass
spec/arb_sample_shading/samplemask 6 all/0.500000 partition: fail pass
spec/arb_sample_shading/samplemask 6/0.250000 partition: fail pass
spec/arb_sample_shading/samplemask 6/0.500000 partition: fail pass
spec/arb_sample_shading/samplemask 8 all/0.250000 partition: fail pass
spec/arb_sample_shading/samplemask 8 all/0.500000 partition: fail pass
spec/arb_sample_shading/samplemask 8/0.250000 partition: fail pass
spec/arb_sample_shading/samplemask 8/0.500000 partition: fail pass
deqp-gles31/functional/shaders/sample_variables/sample_mask_in/bit_count_per_two_samples/multisample_rbo_4: fail pass
deqp-gles31/functional/shaders/sample_variables/sample_mask_in/bit_count_per_two_samples/multisample_rbo_8: fail pass
deqp-gles31/functional/shaders/sample_variables/sample_mask_in/bit_count_per_two_samples/multisample_texture_4: fail pass
deqp-gles31/functional/shaders/sample_variables/sample_mask_in/bit_count_per_two_samples/multisample_texture_8: fail pass

Fixes: f7796a966d ("radeonsi: add basic code for overrasterization")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38615>
2026-01-26 12:37:54 +00:00
Daniel Schürmann
6313e9f549 nir/opt_loop: Relax restrictions on opt_loop_peel_initial_break() for more loops
In addition to loops where the break condition can be constant-folded,
we also allow to peel the initial break from loops which have at least
one phi with a constant loop-carried source, effectively removing that
phi from the loop.

Totals from 172 (0.22% of 79377) affected shaders: (Navi31)
Instrs: 372798 -> 369181 (-0.97%); split: -1.07%, +0.10%
CodeSize: 1907312 -> 1891948 (-0.81%); split: -0.89%, +0.09%
VGPRs: 8436 -> 8460 (+0.28%)
Latency: 3646016 -> 3396657 (-6.84%)
InvThroughput: 434848 -> 389079 (-10.53%)
Copies: 28436 -> 27118 (-4.63%); split: -4.79%, +0.15%
Branches: 26504 -> 25344 (-4.38%); split: -4.44%, +0.06%
PreSGPRs: 8585 -> 8603 (+0.21%)
VALU: 148291 -> 148355 (+0.04%); split: -0.01%, +0.06%
SALU: 95625 -> 92649 (-3.11%); split: -3.22%, +0.11%

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33666>
2026-01-26 12:02:49 +00:00
Daniel Schürmann
71d68d9166 asahi/clc: call nir_opt_remove_phis after nir_opt_loop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33666>
2026-01-26 12:02:49 +00:00
Daniel Schürmann
028da14e2a panfrost/clc: call nir_opt_remove_phis after nir_opt_loop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33666>
2026-01-26 12:02:49 +00:00
Georg Lehmann
809fb0fba3 ac/nir/lower_ps_late: emit scalar f2f16_rtz for when one half of a packed export is undef
Foz-DB Navi48:
Totals from 7200 (8.74% of 82405) affected shaders:
Instrs: 9056391 -> 9048177 (-0.09%); split: -0.09%, +0.00%
CodeSize: 48681288 -> 48640684 (-0.08%); split: -0.09%, +0.00%
VGPRs: 413088 -> 413784 (+0.17%)
Latency: 76340711 -> 76320080 (-0.03%); split: -0.03%, +0.00%
InvThroughput: 12692959 -> 12684618 (-0.07%); split: -0.07%, +0.00%
VClause: 148823 -> 148821 (-0.00%)
Copies: 601739 -> 601874 (+0.02%); split: -0.01%, +0.03%
VALU: 5213356 -> 5207253 (-0.12%); split: -0.12%, +0.00%
SALU: 1160815 -> 1160817 (+0.00%); split: -0.00%, +0.00%
VOPD: 79520 -> 79444 (-0.10%); split: +0.09%, -0.18%

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:23 +00:00
Georg Lehmann
8c895c5c61 ac/nir/lower_ps_late: CSE partial packed exports
Foz-DB Navi48:
Totals from 425 (0.52% of 82405) affected shaders:
Instrs: 1110029 -> 1109658 (-0.03%); split: -0.03%, +0.00%
CodeSize: 6135272 -> 6133848 (-0.02%); split: -0.02%, +0.00%
VGPRs: 29856 -> 29844 (-0.04%)
Latency: 10258411 -> 10258043 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 1898177 -> 1897661 (-0.03%)
Copies: 88221 -> 88173 (-0.05%)
VALU: 575276 -> 574894 (-0.07%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:22 +00:00
Georg Lehmann
e74323577f aco/optimizer: optimize pack(undef, f2f16_rtz(a)) for salu
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:22 +00:00
Georg Lehmann
6cbd16daae aco/optimizer: optimize pack(undef, f2f16_rtz(a)) for gfx8+
Do this late because the v_cvt_pkrtz_f16_f32 can be applied to
its operand.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:22 +00:00
Georg Lehmann
57ca974d1d aco/optimizer: optimize pack(undef, f2f16_rtz(a)) for gfx6/7
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:21 +00:00
Georg Lehmann
ba73792de0 aco/optimizer: fix parsing salu p_insert as shift
Fixes: 88f7e3fff3 ("aco/optimizer: parse pseudo alu instructions")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:21 +00:00
Georg Lehmann
830d6de9ff aco/isel: optimize pack_32_2x16_split(undef, const)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:20 +00:00
Georg Lehmann
b2d9615000 nir/opt_algebraic: optimize bcsel to hi 16bits with undef lo
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:20 +00:00
Georg Lehmann
d06b627d23 nir/opt_algebraic: optimize f2f16_rtz of bcsel with constants
Foz-DB Navi48:
Totals from 145 (0.18% of 82405) affected shaders:
Instrs: 1706001 -> 1705669 (-0.02%); split: -0.03%, +0.01%
CodeSize: 9621036 -> 9620784 (-0.00%); split: -0.02%, +0.02%
SpillSGPRs: 711 -> 726 (+2.11%); split: -0.56%, +2.67%
Latency: 20066360 -> 20066193 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 4326789 -> 4326763 (-0.00%); split: -0.00%, +0.00%
Copies: 192041 -> 191995 (-0.02%); split: -0.03%, +0.01%
Branches: 75673 -> 75675 (+0.00%); split: -0.00%, +0.01%
VALU: 765163 -> 764835 (-0.04%); split: -0.05%, +0.00%
SALU: 351758 -> 351715 (-0.01%); split: -0.01%, +0.00%
VOPD: 65236 -> 65282 (+0.07%); split: +0.17%, -0.10%

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:20 +00:00
Georg Lehmann
ee5492e6dd nir/opt_algebraic: remove f2f16 roundtrip conversions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:20 +00:00
Georg Lehmann
592b6579da nir/opt_algebraic: optimize f2f16_rtz(min/max)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:18 +00:00
Georg Lehmann
2b92c0f06e nir/opt_algebraic: optimize f2f16_rtz(b2f(a))
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39412>
2026-01-26 10:54:18 +00:00
Danylo Piliaiev
096e0aae74 tu: Avoid disabling LRZ when possible for suspend/resume+depth-only draws
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We don't actually care if previous suspended RP had depth-only draws
with color writes skipped, we only care if previous RP disabled LRZ
writes due to this; the mere fact of first draws being depth-only
doesn't affect LRZ of next draws in any way.

However, for next RPs in suspend-resume chain we have to assume that
previous RP may have had color writes.

For secondary cmdbufs with ordinary renderpasses it is easy to be
less pessimistic, and that's what we do in order to not regress
DXVK performance.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39293>
2026-01-26 09:48:44 +00:00
Rhys Perry
928ecfc6c0 radv: fix RADV_DEBUG=shaderstats with RT pipelines
radv_dump_shader_stats() printed stats for every shader with a certain
stage, and we called this function each time an RT shader is compiled.

This means we could repeat the stats for a shader.

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/39484>
2026-01-26 09:26:14 +00:00
Rhys Perry
e59a0df302 aco/insert_fp_mode: remove incorrect assertion
This can happen if a loop has no continues, and the later code should work
fine in this situation.

This fixes war_thunder/0013a69e097b2471 on navi21.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 6b9d28ab9b ("aco/insert_fp_mode: insert fp mode in reverse")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39481>
2026-01-26 08:57:33 +00:00
Samuel Pitoiset
c91ed27582 radv: use the SQTT enable bit for PKT3_DISPATCH_TASKMESH_INDIRECT_MULTI_ACE
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39425>
2026-01-26 08:10:53 +00:00
Samuel Pitoiset
e272c8062d radv: use the SQTT enable bit for PKT3_DISPATCH_MESH_INDIRECT_MULTI
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39425>
2026-01-26 08:10:53 +00:00
Samuel Pitoiset
c7da19e2bf radv: use the SQTT enable bit for PKT3_DRAW_{INDEX}_INDIRECT_MULTI
This reports more info in RGP.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39425>
2026-01-26 08:10:52 +00:00
Samuel Pitoiset
e5982496f6 radv: move emitting SQTT markers closer to the draw/dispatch packets
Some packets already include a SQTT enable bit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39425>
2026-01-26 08:10:52 +00:00
Wei Zhao
a8272bf0f1 vulkan/wsi/wayland: use roundtrip instead of flush on swapchain free
Use wl_display_roundtrip() instead of wl_display_flush() when freeing
a swapchain to ensure the compositor has processed buffer release
events before continuing.

wl_display_flush() only sends pending requests without waiting for
the compositor to process them. When rapidly creating and destroying
large swapchain buffers, buffer references may not be released quickly
enough (e.g., during CTS testing), causing memory to accumulate.

Using wl_display_roundtrip() ensures synchronization with the
compositor, allowing buffers to be released promptly.

Signed-off-by: Wei Zhao <Wei.Zhao@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39475>
2026-01-26 06:27:37 +00:00
Emma Anholt
feb3e8f46e nir/opt_algebraic_tests: Initialize an obvious dummy value for all defs.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We were initializing to a nir_const_value of undefined (in practice on x86
builds, a pointer value), with .b set to 0.  Those values would get dumped
in the annotated shader disassembly at the end of a test where all inputs
where unexpectedly skipped, producing very surprising output.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:42 +00:00
Emma Anholt
6b6cf7b89f nir/opt_algebraic_tests: Fix annotating uint values.
In debugging the CI flakes, it was disconcerting to see:

1     %1 = fisnormal %0 (0.000000) // 0x55e7c4147c00

instead of:

1     %1 = fisnormal %0 (0.000000) // 0x0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:42 +00:00
Emma Anholt
77cfb20d0a nir/opt_algebraic_tests: Fix leak of the variable conds ht.
We'd end the test with 500MB leaked.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:42 +00:00
Emma Anholt
cdec063d37 nir/opt_algebraic: Fix a bit of imad24_ir3's optimization.
The mul is 24-bit sign-extended, so in simplifying we should retain that.
If nothing else, this keeps us on the happy path of mul24s.

I didn't fix the other broken pattern, since it's not really part of this
MR.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:41 +00:00
Emma Anholt
e5a9eae2b5 nir/opt_algebraic_tests: Fix fuzzing levels for multi-component inputs.
We were enumerating enough for a single component, but not all the
combinations.  This helps show that our fdots fail pretty consistently.
And triggers more skipping from the fany_equal16s thanks to varied inputs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:41 +00:00
Emma Anholt
7fd0287a89 nir/opt_algebraic_tests: Test !nir_fp_preserve_signed_zero behavior.
Iterate over a set of sign-flips for 0.0s to see if we can find a set that
makes the search and replace sides match.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:41 +00:00
Emma Anholt
d9eb9a3eef nir/opt_algebraic_tests: Make sure we test the same inputs on BE as LE.
With the inexact signed zero support, we ended up with diverging inputs
producing diverging "all skipped" results for the matrix mul tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
68f5bc4f12 nir/opt_algebraic_tests: Rename and use the enum result type more.
As I introduced another layer of iteration for signed zero testing, the
former logic got unwieldy.  In fact, it was already unwieldy enough that I
forgot to clear all_skipped when the assert failed, allowing a failing
test to be marked UNSUPPORTED instead of XFAIL.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
7f1a64e7f5 nir/opt_algebraic_tests: Move more of the base class code to be methods.
Less passing the *test around separately.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
845e2b3954 nir/opt_algebraic_tests: Remove unnecessary input_count.
Originally this was for sizing the array, but now we're doing std::vector.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
a90163a15a nir/opt_algebraic_tests: Add support for expression swizzles.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
c30c383d4d nir/opt_algebraic_tests: Allow testing of fdot*_replicated opcodes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
173295adf4 nir/opt_algebraic_tests: Allow testing udiv_aligned_4.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
231a477402 nir/opcodes: Define udiv_aligned_4 to return poison for not-aligned-4.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
94237c3ea3 nir/opt_algebraic_tests: Allow testing mul/mad_relaxed opcodes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:40 +00:00
Emma Anholt
f82621bfdc nir/opcodes: Define the mul/mad_relaxed opcodes to return poison for OOB.
For the "defined results for >24b", you want the non-relaxed opcodes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:39 +00:00
Emma Anholt
fd7754fba1 nir/opt_algebraic_tests: Allow testing imad24_ir3.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:39 +00:00
Emma Anholt
ce7ad2639a nir: Fix C UB in imad24_ir3 evaluation.
Same fix as imul24, technically you can't shift into the top bit of the
int32, but the util helper does it right.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
2026-01-26 05:39:39 +00:00
Alyssa Rosenzweig
5409d872f7 brw: remove a redundant DCE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39513>
2026-01-25 17:17:06 -08:00