Commit Graph

209437 Commits

Author SHA1 Message Date
Mike Blumenkrantz dedfb5ef78 zink: trigger multi-context buffer invalidate on internal buffer invalidate
this is the same as zink_context_replace_buffer_storage()

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36473>
2025-07-30 20:20:15 +00:00
Mike Blumenkrantz f1ba8f44d9 zink: fix tc buffer replacement rebind condition
this check is to detect multi-context rebinds, not to determine whether
all rebinds on the same context were successful

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36473>
2025-07-30 20:20:15 +00:00
Mike Blumenkrantz b4280887ed zink: check for multi-context image/buffer rebinds during dispatch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36473>
2025-07-30 20:20:14 +00:00
Mike Blumenkrantz 1c5e5aa4eb zink: also add access stage sync when rebinding buffers
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36473>
2025-07-30 20:20:14 +00:00
Jason Macnak 72d07c16a3 gfxstream: Add gfxstream TLS connection manager reset
... which is still needed to keep the end2end tests happy
when one thread creates and destroys instances multiple times
(which happens in the MultiThreadedShutdown test).

Test: GfxstreamEnd2EndTests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36471>
2025-07-30 19:41:14 +00:00
Thomas H.P. Andersen b08a23550f zink: do not overwrite existing error for miptail on uncommit
a7f86e38ca added the call to
sparse_backing_free. It reuses the ok variable and overwrites the
existing value

Fixes: a7f86e38ca
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36467>
2025-07-30 19:19:05 +00:00
Caio Oliveira f2a49081de brw: Use ralloc helpers for string handling in brw_eu_validate
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36339>
2025-07-30 17:59:26 +00:00
Eric R. Smith 904a4ab364 panvk: use minimum attachment size for frame buffer size
We were using the maximum of all attachment sizes as the bounding box
for the frame buffer. But in fact we want the minimum, as we do not
want to draw outside of any attachment boundaries.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36360>
2025-07-30 17:00:13 +00:00
Job Noorman 326baef472 ir3/a750: don't allocate const space for primitive_param/map
These are lowered to UBOs on a750.

Totals from 6243 (3.79% of 164705) affected shaders:
CodeSize: 7820588 -> 7819720 (-0.01%); split: -0.01%, +0.00%
Preamble Instrs: 799947 -> 799511 (-0.05%); split: -0.06%, +0.00%
Constlen: 400268 -> 375072 (-6.29%)

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36460>
2025-07-30 16:05:15 +00:00
Job Noorman f95a62897c tu: add constlen shader stat
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36460>
2025-07-30 16:05:15 +00:00
Caio Oliveira dde6fa5728 spirv: Implement SPV_KHR_untyped_pointers
The untyped pointer types only have a storage class associated, and the
operations using them would carry the necessary "data type" information.

Untyped pointers themselves are identified by "vtn_type::pointed" being
NULL.  For the NIR lowering the operations will have explicit casts
before them when applicable and the nir_derefs representing untyped
pointers will use the "void" glsl_type.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36427>
2025-07-30 15:35:33 +00:00
Caio Oliveira 8eaf1dced0 spirv: Load block descriptors as soon as we hit them
With changes suggested by Faith.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36427>
2025-07-30 15:35:33 +00:00
Faith Ekstrand d1be63c355 spirv: Assert that vtn_pointer_to_deref() doesn't return NULL
There are a few things that could cause us to return NULL here and we
should just fail to parse the SPIR-V if that ever happens instead of
crashing when someone tries to access it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36427>
2025-07-30 15:35:32 +00:00
Faith Ekstrand 8a993cf900 spirv: Simplify pointer_to/from_ssa a bit
This adds a vtn_pointer_ssa_is_desc_index() helper and makes both
to/from_ssa work in terms of it, ensuring we never screw up the
condition and turn a deref into a block index or vice versa.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36427>
2025-07-30 15:35:31 +00:00
Faith Ekstrand df8ee49bc6 spirv: Drop block_index/offset pointers
These haven't existed in a while but the vtn_pointer fields stayed
around.  Drop offset since no one uses it and rename block_index to
desc_idx with a better comment.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36427>
2025-07-30 15:35:31 +00:00
Faith Ekstrand 46d02bd244 spirv: Assert !ptr_as_array for blocks and acceleration structures
As of ea9deafff4 ("spirv: Add more restrictions around Blocks"), this
case can't happen.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36427>
2025-07-30 15:35:30 +00:00
Corentin Noël a11f2f80b6 virgl: Stop using deprecated util_framebuffer_init
Introduce a new virgl_framebuffer_state to be able to store surface handles
directly.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35681>
2025-07-30 10:17:21 +00:00
Juan A. Suarez Romero 6596cf08e4 v3d: implement robust buffer access
This is the last piece to expose KHR_robustness. The main bulk of the
job is done already in the broadcom compiler through lowerings, so we
only need to set the proper key in order to enable the robustness.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35965>
2025-07-30 11:28:19 +02:00
Juan A. Suarez Romero 7c5ef9de02 v3d: handle QUNIFORM_GET_UBO_SIZE
This uniform will be used when creating context with robust buffer
access.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35965>
2025-07-30 11:26:20 +02:00
Juan A. Suarez Romero 2d47bec557 v3d: implement get device reset status
This implements supports for GPU reset notifications, which is part of
the KHR_robustness extension.

It requires support from kernel in order to expose it.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35965>
2025-07-30 11:26:20 +02:00
Juan A. Suarez Romero 99c5915b56 broadcom/simulator: add support for GPU reset counters
As this is a simulator, it will always report no reset.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35965>
2025-07-30 11:26:20 +02:00
Juan A. Suarez Romero 40a937407a broadcom: check for GPU reset counters support
This checks if kernel supports GPU reset counters, which are actually
two counters: one for resets caused by current context, and another one
for resets caused in general.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35965>
2025-07-30 11:26:20 +02:00
Juan A. Suarez Romero d94114c1d2 drm-uapi: update v3d_drm.h for reset counters
Taken from commits 5774b3cf and 769c153c of drm-misc-next kernel tree.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35965>
2025-07-30 11:26:20 +02:00
Juan A. Suarez Romero 2188994c81 broadcom: remove obvious comment
It is obvious that we check the return value to see if kernel supports
the feature, so no need to add a comment.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35965>
2025-07-30 11:26:19 +02:00
David Rosca f4436d606e radeonsi: Add missing DEBUG_NAMED_VALUE_END to radeonsi_shader_debug_options
AddressSanitizer: global-buffer-overflow ../src/util/u_debug.c:331 in debug_parse_flags_option

Fixes: 5c92fe45a1 ("radeonsi: support more than 64 options for AMD_DEBUG")
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36434>
2025-07-30 08:33:10 +00:00
Lionel Landwerlin 60932e8fae brw: always ensure coarse pixel is disabled on Gfx9
No HW support there.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36457>
2025-07-30 07:57:19 +00:00
Lionel Landwerlin aa6810b706 brw: consider LOAD_PAYLOAD fully defined
It's mostly used for SEND messages and fully defines the register data
(that's its purpose after all).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36457>
2025-07-30 07:57:19 +00:00
Lionel Landwerlin 9371e8d370 brw: fixup coarse_z computation
The delivered values in the coarse pixel size are 0 when coarse pixel
dispatch is disabled and that is screwing up our half pixel offset
adjustment.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36457>
2025-07-30 07:57:19 +00:00
Lionel Landwerlin 9dac7dda87 brw: fixup source depth enabling with coarse pixel shading
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36457>
2025-07-30 07:57:18 +00:00
Lionel Landwerlin 68c50d129e brw: fix NIR metadata invalidation with closest-hit shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36457>
2025-07-30 07:57:18 +00:00
Lionel Landwerlin 9430a1ed00 anv: remove unused helper arguments
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36457>
2025-07-30 07:57:18 +00:00
Lionel Landwerlin fcd06aa8c3 anv: reuse runtime descriptor set layout base object
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36457>
2025-07-30 07:57:18 +00:00
Georg Lehmann e43ef6533b nir/opt_algebraic: remove 8bit roundtrip when vectorizing i2i16(unpack_4x8(a).zw)
Explicit 16bit instructions are nicer to vectorize.

Helps FSR4 on GFX11 marginally.

Foz-DB Navi31:
Totals from 10 out of 14 FSR4 shaders:
Instrs: 59781 -> 58518 (-2.11%)
CodeSize: 413428 -> 404156 (-2.24%)
Latency: 193770 -> 190768 (-1.55%)
InvThroughput: 226274 -> 221628 (-2.05%)
VClause: 796 -> 793 (-0.38%); split: -1.01%, +0.63%
Copies: 3342 -> 3008 (-9.99%); split: -11.01%, +1.02%
PreSGPRs: 312 -> 305 (-2.24%)
VALU: 51448 -> 50213 (-2.40%)
SALU: 1074 -> 1048 (-2.42%)
VOPD: 1783 -> 1718 (-3.65%); split: +0.95%, -4.60%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36117>
2025-07-30 07:25:51 +00:00
Georg Lehmann 4683187f49 radv/nir/lower_cmat: load gfx11 8bit ACC using the B layout to get aligned loads
This allows us to use aligned loads that can be vectorized, without any
downside as 8bit scalar loads always write 16bits of a register.

Foz-DB Navi31:
Totals from 10 out of 14 FSR4 shader:
MaxWaves: 71 -> 68 (-4.23%)
Instrs: 60146 -> 59781 (-0.61%); split: -0.67%, +0.06%
CodeSize: 412448 -> 413428 (+0.24%); split: -0.11%, +0.35%
VGPRs: 2112 -> 2160 (+2.27%)
SpillVGPRs: 89 -> 68 (-23.60%)
Scratch: 11776 -> 8704 (-26.09%)
Latency: 196628 -> 193770 (-1.45%); split: -2.62%, +1.17%
InvThroughput: 224944 -> 226274 (+0.59%); split: -0.02%, +0.61%
VClause: 862 -> 796 (-7.66%)
Copies: 3166 -> 3342 (+5.56%); split: -6.22%, +11.78%
Branches: 37 -> 38 (+2.70%)
PreSGPRs: 311 -> 312 (+0.32%)
PreVGPRs: 2153 -> 2214 (+2.83%); split: -1.35%, +4.18%
VALU: 51073 -> 51448 (+0.73%); split: -0.03%, +0.77%
SALU: 1072 -> 1074 (+0.19%)
VMEM: 3275 -> 2765 (-15.57%)
VOPD: 1739 -> 1783 (+2.53%); split: +7.99%, -5.46%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36117>
2025-07-30 07:25:51 +00:00
Georg Lehmann 92cf02ee23 nir/search: support swizzles on expressions in replacement patterns
Before this wasn't a compile time error, but it also didn't do anything.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36117>
2025-07-30 07:25:51 +00:00
Mel Henning 4be68b119e loader: Don't load nouveau GL on nvidia kmd
The vulkan driver already has a check for this. This prevents the GL
driver from loading too.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13484
Fixes: e99446fc ("egl: Add EGL_EXT_device_query_name and EGL_EXT_device_persistent_id")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36449>
2025-07-29 23:52:32 +00:00
Timothy Arceri 6a217a06d9 util: remove recursion from bitset helpers
Recursion can cause a stack overflow when the range is very large.

Fixes: cb558b2b88 ("glsl: add mark_array_elements_referenced() fast path")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13617

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36430>
2025-07-29 23:07:12 +00:00
Sagar Ghuge 3a9157a10b anv: Use thread group preemption granularity
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36337>
2025-07-29 22:47:56 +00:00
Sagar Ghuge 9ae09d521c intel/genxml: Update CS_CHICKEN1 register field
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36337>
2025-07-29 22:47:56 +00:00
Roland Scheidegger 47c9c1869c llvmpipe: Fix attribute interpolation setup when rendering lines with msaa
If multisampling is enabled, we effectively always use pixel offset 0 for the
purposes of setup, overriding half pixel center.
However, line setup (and by the looks of it rectangle as well), while honoring
this for the purposes of setting up the rasterization planes, it forgot to
do this adjustment when setting up attribute interpolation, hence attribute
interpolation for lines ended up wrong.
Rather than fixing this up in line setup, just override pixel_offset in setup
context when using msaa, since this is what we actually do, which simplifies
the logic (do the same for the key for the setup jit function as well).

Reviewed-by: Brian Paul <brian.paul@broadcom.com>
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36435>
2025-07-29 21:52:01 +00:00
Marek Olšák d61edf079b nir: add nir_move_only_convergent/divergent
This will be needed by nir_opt_move_reorder_loads, which will use
the move flags.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:53 -04:00
Marek Olšák 35bbc8405b nir: add more nir_move_options
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:51 -04:00
Marek Olšák 44d78c4451 nir: handle load_input_vertex in nir_can_move_instr
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:49 -04:00
Marek Olšák 8d3e76c250 nir: split nir_move_load_frag_coord from nir_move_load_input
It's a pure system value on AMD, not an input.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:48 -04:00
Marek Olšák 5083769fcb nir: renumber nir_move_options
for future commits

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:46 -04:00
Marek Olšák 8d584586f5 nir: handle can_reorder robustly in nir_can_move_instr
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:44 -04:00
Marek Olšák c229c93540 nir: change how can_mov_out_of_loop is set for intrinsics in nir_can_move_instr
Set to false first, then set to true when needed.

More intrinsics will set false.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:42 -04:00
Marek Olšák ad1cfcc841 nir: mark inverse_ballot & is_subgroup_invocation_lt_amd as CAN_REORDER
nir_can_move_instr already ignores that this flag isn't set.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36357>
2025-07-29 16:20:39 -04:00
Marek Olšák 2eea9b968d nir/group_loads: rename to nir_opt_group_loads
It's meant to be an optimization pass.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36100>
2025-07-29 19:28:59 +00:00
Marek Olšák 3bceb7b622 nir/group_loads: don't use pass_flags to store the indirection level
no change in behavior

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36100>
2025-07-29 19:28:59 +00:00