Commit graph

73300 commits

Author SHA1 Message Date
Patrick Lerda
84c3489e38 r600: implement msaa 2d view from array
This functionality was not working.

To fix this issue, the texture mode needs to be set to
V_030000_SQ_TEX_DIM_2D_MSAA. When this mode is processed
the gpu only takes the layer 0. This change implements
this functionality by copying the layer to a new resource.

This change was tested on palm, barts and cayman. Here is the
test fixed:
khr-gl4[2-6]/texture_view/view_sampling: fail pass

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40567>
2026-04-20 13:53:37 +00:00
Patrick Lerda
7bbb251936 r600: make r600_copy_region_with_blit global
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40567>
2026-04-20 13:53:36 +00:00
Patrick Lerda
9815901f86 r600: implement tes and tcs instanced gl_PrimitiveID support
This change extends r600_lds_constant_buffer to
implement a fully conformant gl_PrimitiveID at
the tes and tcs stages.

This change was tested on cayman and barts. Here are the tests fixed:
spec/arb_tessellation_shader/execution/tcs-primitiveid-instanced: fail pass
spec/arb_tessellation_shader/execution/tes-no-tcs-primitiveid-instanced: fail pass
spec/arb_tessellation_shader/execution/tes-primitiveid-instanced: fail pass
khr-gl4[4-6]/tessellation_shader/tessellation_shader_tessellation/gl_invocationid_patchverticesin_primitiveid: fail pass
khr-gles31/core/tessellation_shader/tessellation_shader_tessellation/gl_invocationid_patchverticesin_primitiveid: fail pass
khr-glesext/tessellation_shader/tessellation_shader_tessellation/gl_invocationid_patchverticesin_primitiveid: fail pass

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40297>
2026-04-20 13:21:55 +00:00
Patrick Lerda
48902771ad r600: fix atomic buffer offset
The atomic offset implementation was incomplete.

This change was tested on cayman, it fixes all the
variants of this test:
khr-gl4[2-6]/shader_atomic_counters/advanced-usage-multi-stage: fail pass
khr-gles31/core/shader_atomic_counters/advanced-usage-multi-stage: fail pass

Fixes: 06993e4ee3 ("r600: add support for hw atomic counters. (v3)")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40170>
2026-04-20 13:05:55 +00:00
Patrick Lerda
675056ab95 r600: remove r600_get_hw_atomic_count
This is not used anymore and the atomic_base
could interfere with some operations.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40170>
2026-04-20 13:05:54 +00:00
Patrick Lerda
72dcc82618 r600: enable EXT_texture_shadow_lod
The support needed only a minor adjustment.

Note: As far as rv770 is concerned: khr-gl33 (4/12),
the support needs some work and is disabled.

This change was tested on palm, barts and cayman: piglit (3/3)
khr-gl46 (15/16). The failing test: sampler2darrayshadow_vertex
is referenced as "Bug 21620051" (VK-GL-CTS) and seems to have
a problem.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39915>
2026-04-20 12:49:53 +00:00
Patrick Lerda
1c00172eec r600: update r600 nir for sample_lz and sample_c_lz
This change enables the generation of the opcodes.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39915>
2026-04-20 12:49:53 +00:00
Patrick Lerda
19a22b9382 r600: add sample_lz and sample_c_lz opcodes compatibility
This change generates a better code and maintains the
compatibility with the array sampler types.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39915>
2026-04-20 12:49:52 +00:00
Patrick Lerda
7513f48edf r600: fix alpha-to-coverage and alpha-to-one used together
This change is inspired by b56f47611a ("radeonsi: fix
alpha-to-coverage + alpha-to-one used together for
gfx6-10.3") and implements the same algorithm.

This change was tested on rv770, palm and cayman. Here are the tests fixed:
spec/arb_framebuffer_object/execution/msaa-alpha-to-coverage_alpha-to-one: fail pass
spec/arb_framebuffer_object/execution/msaa-alpha-to-coverage_alpha-to-one_write-z: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39779>
2026-04-20 12:35:03 +00:00
Patrick Lerda
c54f134f60 r600: cypress resinfo buffer size workaround
Reading the buffer size (GET_BUFFER_RESINFO) does not work
on cypress. This issue is the main difference on a test
basis between cypress and other gpus like palm and cayman.
This change adds a dedicated function which extends the
previous workaround algorithm for cubearray to this end.

This change assumes that all the gpus between cedar and
hemlock have the same issue.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39650>
2026-04-20 12:12:25 +00:00
Patrick Lerda
34336c7f16 r600: rename sh_txs_cube_array_comp to sh_resinfo_via_uniform
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39650>
2026-04-20 12:12:25 +00:00
Patrick Lerda
89dd088871 r600: refactor eg_setup_buffer_constants
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39650>
2026-04-20 12:12:24 +00:00
Patrick Lerda
d17654c1b5 r600: refactor r600_shader_buffer_info_sel
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39650>
2026-04-20 12:12:23 +00:00
David Rosca
7a8721e95c d3d12: Use HEVC RefPicSet order from frontend
It is correctly sorted in frontend since 779edc0759 ("frontends/va: Correctly derive HEVC StCurrBefore, StCurrAfter and LtCurr")

This fixes RefPicSetLtCurr order which was incorrectly sorted here.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41021>
2026-04-20 08:24:22 +00:00
Janne Grunau
98a97cb413 nir/gather_info: clear interpolation qualifiers only in fragment stage
Asahi wants the the interpolation qualifiers from the shader info in the
vertex shader. Clear them only in the fragment stage so they can
propagate back.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15288
Backport-to: 26.0
Fixes: a72704d0fb ("nir/gather_info: clear interpolation qualifiers before gathering")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41040>
2026-04-19 10:10:15 +00:00
Ganesh Belgur Ramachandra
dc2016892e radeonsi: add gfx11.7
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40866>
2026-04-18 18:55:26 +00:00
Ganesh Belgur Ramachandra
5ea995893b amd: add initial common code for gfx11.7
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40866>
2026-04-18 18:54:23 +00:00
Karol Herbst
fcfdd4cfea iris: advertise support for subgroup rotate
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The compiler side already supports it, so we just need to enable it.

Needed for cl_khr_subgroup_rotate.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41013>
2026-04-18 00:23:33 +02:00
Karol Herbst
2cc5d8ce48 radeonsi: advertise support for subgroup rotate
Everything needed it already supported on the compiler side, so advertise
the feature.

This is needed for cl_khr_subgroup_rotate.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41015>
2026-04-17 21:47:34 +00:00
Erik Faye-Lund
779981a3f1 panfrost: use perf-trilinear when doing anisotropic sampling
This should be faster, and matches what the DDK does.

Reviewed-by: Marc Alcala Prieto <marc.alcalaprieto@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40869>
2026-04-17 12:52:17 +00:00
Thong Thai
5bf30149ec radeonsi: move si_get video functions to si_video
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40493>
2026-04-17 09:40:13 +00:00
Thong Thai
4cbb20c59c frontends/va: decode only stubs
Stub VA functions to allow for code for different encode/decode codecs
to be excluded from the build, along with for allowing to build without
shader code.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40493>
2026-04-17 09:40:13 +00:00
Thong Thai
f9df50eb31 util: move u_stub to src/util, add u_stub_gfx_compute.h
Move u_stub.h from amd/common, to util, so that it can be used in more
places.

Also, rename u_stub's PROC to MESAPROC, as it conflicts with the PROC
keyword and create a new TAILZ which returns 0.

Add u_stub_gfx_compute.h so that the following:

...can be a single-line:

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40493>
2026-04-17 09:40:13 +00:00
Aleksi Sapon
712a4e5691 llvmpipe: fix overflow in rasterizer
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39498>
2026-04-16 19:36:28 +00:00
Aleksi Sapon
0326051618 llvmpipe: remove unused SSE rasterization code
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39498>
2026-04-16 19:36:28 +00:00
Michel Dänzer
5cc3264b53 winsys/amdgpu: Use render node only as fallback
If ac_drm_device_initialize returns -EACCES for the fd passed in.

A render node file description can't have DRM master status, which means
AMDGPU_CTX_PRIORITY_HIGH can't work without CAP_SYS_NICE (which
generally only the root user has).

Fixes: 8f30e90fc1 ("winsys/amdgpu: Prefer render node FD for ac_drm_device_initialize")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40974>
2026-04-16 08:26:35 +00:00
Juan A. Suarez Romero
69708ff3f5 v3d: mark mapped BO as initialized for valgrind
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When we unsychronized map a BO, we tell Valgrind that the content is not
initialized yet.

But we forgot to mark it as defined when the map finishes, which leads to
several conditional jump or move depends on uninitialised value(s)
warnings when using Valgrind.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40964>
2026-04-16 07:55:39 +00:00
Connor Abbott
280c64d720 ir3: Don't reset immediate count to 0 after lowering
We need to know the immediate count even after lowering, to compute the
overall const size. Previously we were using the capacity field, but
that's unreliable and won't be available once we switch to a real
dynamic array container instead of (poorly) reinventing one.

Fixes: 86f3c0c4c2 ("ir3: simplify constlen calculation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40961>
2026-04-16 05:40:14 +00:00
Christian Gmeiner
5d8b900369 mesa/st: Extend st_context_invalidate_state with meta-op flags
Add ST_INVALIDATE_* flags for all states that meta-operations
(bitmap, clear, drawpixels, etc.) modify behind the state tracker's
back. This enables meta-ops to use st_context_invalidate_state()
instead of CSO save/restore for state re-derivation.

The atoms already know how to re-derive Gallium state from GL context,
so marking states dirty via st_context_invalidate_state() is
sufficient - st_validate_state() will call the atoms before the next
draw.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40592>
2026-04-15 21:08:44 +00:00
Marek Olšák
c4bd6bd590 radeonsi: just get si_shader_info::num_inputs from NIR
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:12 +00:00
Marek Olšák
f249c297b2 radeonsi: set num_vs_inputs from nir->num_inputs and use it more
Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:12 +00:00
Marek Olšák
46c77ed745 radeonsi: don't call nir_recompute_io_bases for FS
the bases are unused now

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:12 +00:00
Marek Olšák
a1f4d3e49b radeonsi: remove si_shader_info::input_semantic[]
it's unused now

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:12 +00:00
Marek Olšák
3d356a99a7 radeonsi: compute si_shader_info::inputs_read without input_semantic[]
Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:12 +00:00
Marek Olšák
49888328a6 radeonsi: compute si_shader_info::color_attr_index without input_semantic[]
Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:11 +00:00
Marek Olšák
a96c854234 ac,radv,radeonsi: don't use nir_intrinsic_base for FS inputs
This all is needed to switch to the new helper.

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:11 +00:00
Marek Olšák
dfe5fbc1d7 radeonsi: update shader info in si_nir_lower_color_flatshade_twoside
needed to get rid of IO bases

Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:11 +00:00
Marek Olšák
195eea461c ac/llvm: correctly load 16-bit TCS inputs from VGPRs and simplify
The conversions to integer and bitcasts are unnecessary because everything
is already integer.

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:10 +00:00
Marek Olšák
a48ffce4bd ac,radeonsi: stop using nir_intrinsic_base for TCS inputs passed via VGPRs
This also removes one use of input_semantic[].

Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:10 +00:00
Marek Olšák
c8ce9d4b48 radeonsi: remove si_shader_info::num_outputs
Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:09 +00:00
Marek Olšák
a4396f2da6 radeonsi: remove si_shader_info::output_semantic[]
It does nothing now.

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:09 +00:00
Marek Olšák
d4538b90a7 radeonsi: stop using output_semantic[] for LS outputs passed via VGPRs
this is also required to make mediump work

Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:09 +00:00
Marek Olšák
ef229b8c3e radeonsi: stop using si_shader_info::output_semantic for passthrough TCS
This will allow removing output_semantic.

Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:08 +00:00
Marek Olšák
debedefbeb radeonsi: stop setting si_shader_info::output_semantic for FS
FS doesn't use it anymore.

Acked-by: Pierre-Eric
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:08 +00:00
Marek Olšák
b60acfc5fb radeonsi: don't recompute IO bases for FS outputs
They are unused now.

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:07 +00:00
Marek Olšák
ef44d8e9c8 ac,radeonsi: don't use nir_intrinsic_base for FS outputs
It was only used by the PS epilog in radeonsi.

Acked-by: Pierre-Eric
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40556>
2026-04-15 18:12:07 +00:00
Lorenzo Rossi
43ba475d4c panfrost,panvk: Move lower_texture_early inside preproc
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40844>
2026-04-15 10:32:19 +00:00
Lorenzo Rossi
e24228e327 panfrost,panvk: Move lower_texture_late inside postproc
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40844>
2026-04-15 10:32:19 +00:00
Lorenzo Rossi
d096a8e962 panfrost: Move lower_res_indices before postproc
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40844>
2026-04-15 10:32:18 +00:00
Lorenzo Rossi
eafc822dbd panfrost,panvk: Move postprocess near shader_compile
Ideally there should be only sysval lowering in the middle.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40844>
2026-04-15 10:32:18 +00:00