Commit graph

219989 commits

Author SHA1 Message Date
Faith Ekstrand
dfc05286b9 panvk: Use a new, more compact varying layout
Co-authored-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
6b08260731 pan: Add a helper for generating more compact varying layouts
Thewe new layouts actually take advantage of mediump to save on I/O
bandwidth, instead of focusing just on data types in the shader.  Using
them requires that the driver use the varying layout for emitting any
needed varying descriptors.

Co-authored-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
0f0a3225a5 panvk: Pass the varying layout from the VS to the FS compile
Co-authored-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
0c8307d249 pan/bi: Handle varying layout mismatches in emit_load_vary()
If we're going to use the varying layout from the VS for the FS then we
need to be able to handle minor mismatches.  Mostly, this just means we
need to drop the assert that the set of locations matches 1:1.  We'll
use the byte offsets from the varying layout when we have one but keep
using the resource handles the driver put in driver_location for
LD_VAR[_IMM].

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Lorenzo Rossi
06d3c739c7 panvk/jm: Emit varying descriptors based on the VS varying layout
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
33cd22cd8c panvk/csf: Emit varying descriptors based on the VS varying layout
Co-authored-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Lorenzo Rossi
264ef3a6fa pan/compiler: Add formats to varyings info
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
c995376a22 panvk: Build the VS varying layout early
We also store it in the shader variant so that we can get at it from the
API side or from other shader stage compiles.

Co-authored-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Lorenzo Rossi
47c55105c8 panvk: Constant fold location in panvk_lower_nir_io
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
aad690fd9a panvk: Compile shaders in pipeline stage order
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
6f11a4028f panvk: Scrape noperspective varyings out of the FS first
We want to flip the order in which we compile shaders and go in pipeline
stage order.  In order to do that and continue to bake in noperspective
varyings, we need to scrape them out of the FS as a separate step.
Fortunately, that's now easy and safe to do.

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:14 +00:00
Faith Ekstrand
78da1e4249 pan/nir: Improve collect_noperspective_varyings_fs()
We can easily handle indirect loads by looking at sem.num_slots.
Because noperspective is declared on the entire variable and not
individual slots of an array, we can smash noperspective on for the
whole range if we see an indirect.  We also add collect from variables,
which is probably redundant when run late because variables are left
around after lowering I/O but it lets us run the pass before I/O is
lowered.

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
f2f792996d Revert "nir: Add a type parameter to nir_lower_point_size()"
This reverts commit 6ee4ea5ea3.

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
88cce35415 pan/bi: Stop lowering point size to float16 early
This is now handled by the varying layout on Valhall+

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
85d6ff06fd pan/bi: Use the pan_varying_layout for Vallhall+ direct varing load/store
For the descriptor paths, we just assert that the locations match what
we expect and move on.  For the direct paths, we use the offsets in the
layout.  The compiler also now takes an optional layout which the driver
can provide itself if desired.

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
cec53b9fbd pan/bi: Allow 8-bit varying direct stores
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
c5fdc6faa8 pan: Add a pass to resize I/O load/stores as needed by the varying layout
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
ceacec4cc9 nir: Allow 8-bit vertex output stores
These can never come from the API but there's a few cases where panvk
wants them.

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
a094c15270 pan/bi: Stop pretending to support f16 gl_Position
It's always a full vec4 in the varying buffer.

Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
1efba676b1 pan/compiler: Add a pan_varying_layout struct
Right now, the varying layout is entirely a series of assumptions made
various places in the driver and compiler.  This adds an explicit
structure for tracking the layout which we will eventually plumb through
everywhere.

Co-authored-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Lorenzo Rossi
84dcdf87bf pan/compiler: Remove mediump from collect_varyings
In preparation for future commits, we're builing better alternatives

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Faith Ekstrand
425458c598 pan/compiler: Handle store_per_view_output in collect_varyings()
No idea how this wasn't blowing anything up before.

Fixes: 448b5e0225 ("panvk: implement multiview support")
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
2026-03-12 22:59:13 +00:00
Hoe Hao Cheng
e3adf10b73 zink/codegen: do not enable extensions that are fully core-promoted
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40381>
2026-03-12 22:37:47 +00:00
Mike Blumenkrantz
1760cd5528 llvmpipe: support EXT_mesh_shader
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37408>
2026-03-12 22:02:57 +00:00
Mike Blumenkrantz
ad04df6168 lavapipe/llvmpipe: make mesh draw params consistent
neither pipe_grid_info::block nor pipe_grid_info::grid_base are used
by the GL frontend, and using them in lavapipe prevents the GL side from
working

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37408>
2026-03-12 22:02:57 +00:00
Mike Blumenkrantz
3dbb7e896d mesa/st: fix unlower_io_to_vars to work with mesh shaders
cc: mesa-stable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15034
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15040

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37408>
2026-03-12 22:02:57 +00:00
Mike Blumenkrantz
e604a8f617 nir: fix nir_is_io_compact for mesh shaders
cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37408>
2026-03-12 22:02:57 +00:00
Mike Blumenkrantz
b33838268f llvmpipe: enable GLSL 4.60
not sure why this was missing

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37408>
2026-03-12 22:02:57 +00:00
Mike Blumenkrantz
00e6a94278 aux/trace: handle set_sample_locations
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37408>
2026-03-12 22:02:56 +00:00
Kenneth Graunke
9f77991751 brw: Simplify mark_last_urb_write_with_eot()
Just tag the last instruction, drop useless dead code elimination.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40328>
2026-03-12 21:40:37 +00:00
Kenneth Graunke
4bfa7a602c brw: Don't emit HALT_TARGET for VS/TCS/TES/GS
This isn't needed and will allow simplifications in the next patch.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40328>
2026-03-12 21:40:37 +00:00
Kenneth Graunke
2b6c6f8130 brw: Lower TCS single patch invocation ID calculations in NIR
This is a bit less code and also drops one more TCS-specific thing
from the "run" function.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40328>
2026-03-12 21:40:37 +00:00
Kenneth Graunke
66fbfe7bf3 brw: Fix single patch thread dispatch masks in NIR
Arguably a little more code but it brings us a bit closer to not
needing separate per-stage "run" functions.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40328>
2026-03-12 21:40:37 +00:00
Kenneth Graunke
4a9aa3ecc4 brw: Combine brw_assign_*_urb_setup() into one function
They all do exactly the same thing, except that GS multiplies by an
extra factor, and TCS has urb_read_length == 0 so it skips one line.

No need for four copies.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40328>
2026-03-12 21:40:37 +00:00
Kenneth Graunke
7d463a45f7 brw: Simplify GS load_invocation_id handling
Just return the register instead of having multiple functions stash the
register in an array of registers.  Way too much hoopla here.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40328>
2026-03-12 21:40:37 +00:00
Kenneth Graunke
9933882182 brw: Purge source_depth_to_render_target
This was used for Gfx4-5.  Since then, we're just passing around a
boolean that nobody wants.  Even if someone did, a better plan is to
just check nir->info directly.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40328>
2026-03-12 21:40:37 +00:00
Benjamin Cheng
e76a5e69ff radv/video_enc: Use variable slice mode when possible
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40329>
2026-03-12 20:22:30 +00:00
David Rosca
44fb85bd36 radeonsi/vcn: Use variable slice mode when possible
When the slice configuration from frontend is possible with variable
slice mode, prefer to use it. This lets us respect the config more
closely.

Co-authored-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40329>
2026-03-12 20:22:30 +00:00
David Rosca
d9ba641e28 ac: Add variable slice mode interface
Co-authored-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40329>
2026-03-12 20:22:30 +00:00
Benjamin Cheng
efcc8b6d89 ac: Fix naming of hevc encode params IB
Make it consistent with the other codec specific IBs.

Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40329>
2026-03-12 20:22:30 +00:00
Benjamin Cheng
661823a470 frontends/va: Assert that slices come in order
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40329>
2026-03-12 20:22:30 +00:00
Yiwei Zhang
1a302155ee venus: force prime blit on Nvidia GPU
Normally Venus on Nvidia GPUs takes the prime blit path. The exception
is when KWin or any wlroots based compositors are used:
1. KWin and wlroots based compositors always add LINEAR to dmabuf
   feedback tranches assuming LINEAR can be handled by GPU drivers.
2. Venus + Virgl only sees the compositor injected LINEAR mod since
   Virgl doesn't support explicit modifiers on the driver side.
3. Nvidia GPUs doesn't support LINEAR color attachment, and it's too
   late to reject LINEAR mod when the native image path has already
   been taken instead of the prime image path.

Gamescope requires VK_EXT_physical_device_drm and its runtime doesn't
use standard WSI extensions, so venus can spoof without impacting it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40339>
2026-03-12 20:03:19 +00:00
Yiwei Zhang
291ff330a4 virgl: set DRM_RDWR for exported dma-bufs (non-blob)
This allows the exported fds to be mapped for writing. This is needed
for nested venus in the VM env, where virgl gbm is used to allocate
external memory for backing venus host visible support. Venus can't use
its own export alloc since they are all blob mem, while we can use the
Virgl guest storage when available.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40358>
2026-03-12 19:48:47 +00:00
Daivik Bhatia
9556812f0e v3dv: Enable VK_KHR_robustness2
This enables the robustImageAccess2 feature for VK_KHR_robustness2

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39430>
2026-03-12 19:14:24 +00:00
Daivik Bhatia
66c5c8fe19 broadcom/compiler: lower txf LOD for robustImageAccess2 on V3D 4.2
On V3D 4.2, txf instructions with an out of bounds LOD do not
return robust values (zero) as required by robustImageAccess2.

This commit introduces a NIR lowering pass that explicitly checks
if the LOD is within bounds. If the LOD is out of bounds,
the texture coordinate is replaced with an out of bounds value
to force the hardware to return the robust value.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39430>
2026-03-12 19:14:24 +00:00
Daivik Bhatia
bd3e836046 v3dv: Implement robust_image_access_2 flag
This flag is used to implement robustImageAccess2.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39430>
2026-03-12 19:14:24 +00:00
Daivik Bhatia
33092de196 nir: Handle format swizzles for OOB image loads
When masking out of bounds image loads, we previously returned a vector
of all zeros. However, for robustImageAccess2, depending on the format,
some components such as the alpha channel in an RGB format
should evaluate to 1.

This corrects the replacement value based on the format swizzle.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39430>
2026-03-12 19:14:24 +00:00
irql-notlessorequal
bdf13a7185 hasvk: Stop advertising blockTexelViewCompatibleMultipleLayers
This isn't supported until Gfx9.

Fixes: 0988c68eeb ("hasvk: Advertise VK_KHR_maintenance6")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15042
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40335>
2026-03-12 18:59:44 +00:00
irql-notlessorequal
2e876d66c4 Revert "hasvk: Remove no longer valid assert"
This reverts commit da9e9329ec.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40335>
2026-03-12 18:59:44 +00:00
Samuel Pitoiset
1ed37ae5e6 radv/meta: remove redundant cache flushes when copying VRS rates to HTILE
No need to invalidate the VCACHE again (applications are supposed to
emit a barrier) and INV_SCACHE/INV_L2 are not necessary either.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40342>
2026-03-12 18:38:21 +00:00