Commit graph

70215 commits

Author SHA1 Message Date
Mike Blumenkrantz
de65a5ebac zink: fix fb attachment usage setting
usage should always be set after barriers to improve reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:10 +00:00
Mike Blumenkrantz
919ad8c08d zink: always emit fb attachment sync
the sync functions should be smart enough by now to figure this out

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:10 +00:00
Mike Blumenkrantz
485b520cf2 zink: fix qbo sync
this shouldn't be using bespoke handling to avoid sync

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13434

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:10 +00:00
Mike Blumenkrantz
d6e89787ed zink: always create gfx shader objects with 5 descriptor layouts
these are separate shader objects

fixes VUID-vkCmdDraw*-None-08879

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:10 +00:00
Mike Blumenkrantz
39f45f2a04 zink: double-check descriptor layout creation before adding to cache
this can race against the background compile thread, so ensure that
no collisions happen

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:10 +00:00
Mike Blumenkrantz
033aa3560e zink: tighten up same-batch sync
for a resource usage sequence like:
* TRANSFER_WRITE
* SHADER_READ
* TRANSFER_READ

the previous code would only synchronize SHADER_READ, which meant the
following TRANSFER_READ was subject to RaW hazards

instead, accumulate read accesses and emit new read sync when necessary

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:10 +00:00
Mike Blumenkrantz
efac6228b9 zink: unify setting general access flags in sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:10 +00:00
Mike Blumenkrantz
342313b145 zink: remove duplicate setting of last_write in image sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36057>
2025-07-11 11:20:09 +00:00
Qiang Yu
5c92fe45a1 radeonsi: support more than 64 options for AMD_DEBUG
As we are going to add more debug options for mesh shader,
but now AMD_DEBUG options are full (=64).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35931>
2025-07-11 02:25:51 +00:00
Qiang Yu
09e6bc90ee radeonsi: fix gfx11 ngg shader emit
Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35931>
2025-07-11 02:25:51 +00:00
Qiang Yu
d0f76c4cd4 radeonsi: use mask for uses_bindless_samplers/images
For simpler code and mesh shader support which need to
distinguish vertex and mesh pipeline.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35931>
2025-07-11 02:25:50 +00:00
Qiang Yu
b337e60a6f radeonsi: check render feedback only for fragment shader
We set need_check_render_feedback for fragment shader only:
  69ad0fc61e ("radeonsi: only set need_check_render_feedback if binding textures for PS")

This helps adding mesh shader to not involve other geometry
stages so we can do it in either vertex or mesh pipeline.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35931>
2025-07-11 02:25:50 +00:00
Qiang Yu
2f5ff9788a Revert "gallium: add drawid_offset to draw_mesh_tasks interface"
This reverts commit 27cd4b061c.

It's always 0.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35931>
2025-07-11 02:25:50 +00:00
Qiang Yu
0a4569fc92 gallium: remove ir arg from pipe_screen.get_compiler_options
It's always PIPE_SHADER_IR_NIR.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35931>
2025-07-11 02:25:50 +00:00
Sagar Ghuge
9b5149cb74 iris: Set TG size based on number of threads
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35904>
2025-07-10 22:08:36 +00:00
José Roberto de Souza
06997a42a3 iris: Program DispatchWalkOrder and ThreadGroupBatchSize with optimized values for regular computer walkers
It was only added to indirect compute walkers while HSD don't say
anything about this optimization be specific to indirect compute
walkers.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36058>
2025-07-10 20:54:30 +00:00
Alyssa Rosenzweig
b5f56fb47b asahi: use nir_rewrite_image_intrinsic
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35949>
2025-07-10 14:55:18 -04:00
Alyssa Rosenzweig
ee26938faf nir,agx: switch to bindless_image_agx intrinsic
this is more explicit than vec2's and hence has fewer footguns. in particular
it's easier to handle with preambles in a sane way.

modelled on what ir3 does.

there's probably room for more clean up but for now this unblocks what I want to
do.

stats don't seem concerning.

Totals from 692 (1.29% of 53701) affected shaders:
MaxWaves: 441920 -> 442112 (+0.04%)
Instrs: 1588748 -> 1589304 (+0.03%); split: -0.05%, +0.08%
CodeSize: 11487976 -> 11491620 (+0.03%); split: -0.04%, +0.07%
ALU: 1234867 -> 1235407 (+0.04%); split: -0.06%, +0.10%
FSCIB: 1234707 -> 1235249 (+0.04%); split: -0.06%, +0.10%
IC: 380514 -> 380518 (+0.00%)
GPRs: 117292 -> 117332 (+0.03%); split: -0.08%, +0.11%
Preamble instrs: 314064 -> 313948 (-0.04%); split: -0.05%, +0.01%

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35949>
2025-07-10 14:55:17 -04:00
Eric Engestrom
a1d7545885 crocus/ci: disable jobs on anholt farm
That farm is not coming back any time soon, so let's just disable the
jobs to avoid having to keep them working while refactoring; they'll
have to be mostly re-written if/when they're brought back anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36024>
2025-07-10 18:15:36 +00:00
Marek Olšák
95f1f334ca zink/ci: add post-merge failures from a previous MR
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36018>
2025-07-10 16:37:45 +00:00
Marek Olšák
3684b93723 radeonsi: use nir_opt_move_to_top for input loads
This must be done before the GLSL compiler stops using
nir_lower_io_vars_to_temporaries for inputs to work around an LLVM bug.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36018>
2025-07-10 16:37:44 +00:00
Faith Ekstrand
69919fd21b zink: Add a resource_get_dma_buf() helper
We had the same code in two paces and one of them had a bug (see
previous commit) so let's make it one place.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36048>
2025-07-10 15:40:20 +00:00
Faith Ekstrand
de4224a57c zink: Clean up file descriptor closing in export_dmabuf_semaphore()
First, we handle the case where GetMemoryFdKHR fails.  This is unlikely
and, if it's a Mesa driver it probably won't stomp the FD but we should
be extra careful.  Then, we can close the dma-buf file immediately after
we call drmIoctl() on it, ensuring we don't leak the dma-buf file
descriptor if drmIoctl() fails.  If ImportSemaphoreFdKHR() fails, then
we need to clean up the sync file.

Fixes: d4f8ad27f2 ("zink: handle implicit sync for dmabufs")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36048>
2025-07-10 15:40:20 +00:00
Marek Olšák
08b522d21e glsl: check against varying limits using NIR shader_info after nir_opt_varyings
nir_opt_varyings reduces the number of varyings. Check against limits after
that, so that old and limited GPUs don't fail linking when nir_opt_varyings
is able to reduce varyings to or below the limit.

The previous code only checked FS inputs, which is glaringly obvious
from the removed var_counts_against_varying_limit function.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Timothy Arceri <tarceri@itqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36023>
2025-07-10 08:31:36 +00:00
Vitaliy Triang3l Kuzmin
21136d931d r600: Fix rectangle coordinate limits on R6xx/R7xx
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
R6xx/R7xx use D3D10 15.8 fixed-point coordinates rather than 16.8.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35953>
2025-07-10 04:45:53 +00:00
Yiwei Zhang
ace49d9e52 lavapipe: adopt wsi_common_get_memory
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35875>
2025-07-09 23:45:04 +00:00
Yiwei Zhang
6f7dff3abf lavapipe: adopt wsi_common_create_swapchain_image
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35875>
2025-07-09 23:45:04 +00:00
Emma Anholt
fefa6aa899 dri2: Finish removing the now-unused dep_xcb_dri2.
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/19942>
2025-07-09 14:31:05 -07:00
Mel Henning
0f6a8283ca zink: Assert ici.tiling != DRM_FORMAT_MODIFIER_EXT
if we're not populating VkExternalMemoryImageCreateInfo

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36008>
2025-07-09 20:35:40 +00:00
Mike Blumenkrantz
69afd8678a zink: fix UIL feedback loop usage
I got this confused with the DRLR type of feedback loop

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36029>
2025-07-09 18:42:48 +00:00
Mike Blumenkrantz
1b0c377923 zink: slightly tighten the implicit feedback loop detection logic
parts of this are strict about using per-context flags but then using
res->fb_binds is potentially multi-context

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36029>
2025-07-09 18:42:48 +00:00
Mike Blumenkrantz
8090e24567 zink: assert that batches never use a timeline value of 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36029>
2025-07-09 18:42:47 +00:00
Mike Blumenkrantz
767ecc27cb zink: enable img copy boxes for blit/copy ops
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this might enable reduced sync for successive copies

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36010>
2025-07-09 18:25:13 +00:00
Mike Blumenkrantz
b022cdc8a1 zink: only copy resource during add_bind if it is valid
this otherwise is a big no-op

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36010>
2025-07-09 18:25:13 +00:00
Daniel Stone
e59305c29f dri: Remove remnants of TexBuffer extension
This is no longer needed as a DRI extension.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:59 +00:00
Daniel Stone
a9298ca55c dri: Remove DRI2 loader extension
Now that all our backends are either swrast or using client image-based
allocation, we don't need the DRI2 loader interface anymore. Remove it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:59 +00:00
Daniel Stone
5be2e7f5c0 dri: Remove getBuffersWithFormat
This was only used for X11's DRI2, which we no longer have.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:58 +00:00
Daniel Stone
a8629e5622 dri: Remove dri2_from_names
This is now unused with the removal of X11 DRI2, and the wl_drm
pre-dmabuf path.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:58 +00:00
Daniel Stone
718ef151f2 egl/wayland: Remove support for non-dmabuf wl_drm
wl_drm is the legacy protocol which is used to support
EGL_WL_bind_wayland_display to exchange buffers between client and
server. It's supported dmabuf for a very long time, and as a private
protocol for Mesa's use, there is no need to carry around support for
old codepaths, as all relevant drivers support dmabuf.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:58 +00:00
Daniel Stone
08c6ba223b x11: Remove DRI2 support
DRI2 was hidden behind a legacy-x11 build option back in the 24.2
release. It's now been a year, so let's get on with removing it so we
can simplify our winsys interactions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:58 +00:00
Mike Blumenkrantz
b0624f4034 cso: use unbind_trailing for sampler view unbinds on context unbinds
this is a bit less noisy for drivers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36025>
2025-07-09 17:18:43 +00:00
David Rosca
a801df753c radeonsi/video: Fix assert in radeon_bs_code_ns
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It is valid for w to be 1, in that case nothing should be encoded
in the bitstream.
value must be lower than max, add that as an assert instead.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35648>
2025-07-09 16:30:38 +00:00
David Rosca
ad56f0122c radeonsi/video: Fix copy paste errors in HEVC header encoder
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35648>
2025-07-09 16:30:38 +00:00
David Rosca
4b472efb51 radeonsi/video: Fix RefRpsIdx calculation in st_ref_pic_set
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35648>
2025-07-09 16:30:38 +00:00
David Rosca
dc02b4358a frontends/va: Fix RefRpsIdx calculation in st_ref_pic_set
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35648>
2025-07-09 16:30:37 +00:00
Mike Blumenkrantz
a36536fb10 zink: zero the unordered access for images upon executing an ordered barrier
avoid keeping stale flags around

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36009>
2025-07-09 16:03:14 +00:00
Mike Blumenkrantz
be28daeef9 zink: use a rebind counter to manage descriptor rebinds
matching the pointers here breaks if pointers get reused, but a monotonically
increasing value will provide reliable comparison

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36009>
2025-07-09 16:03:14 +00:00
Gert Wollny
a94312511f r600: remove the use of separate nir options for fs
with lower_all_io_to_temps removed the shader options are now the
same for all shader types.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36013>
2025-07-09 13:51:24 +00:00
Gert Wollny
a43bfffe1e r600: Correct nir_indirect_supported_mask
The option lower_all_io_to_temps was only set to true for FS,
consequently the correct mask includes all shaders but the FS.

Fixes: a86f32a1ae
    etnaviv,r600,v3d,virgl: report correct nir_options::support_indirect_*

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36013>
2025-07-09 13:51:24 +00:00
Vitaliy Triang3l Kuzmin
1529f38086 r600/sfn: Fix scratch layout calculation for composite types
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35952>
2025-07-09 13:33:17 +00:00