Commit graph

205437 commits

Author SHA1 Message Date
Marek Olšák
81bdf1ace6 nir: remove unnecessary (nir_shader *) typecasts
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34489>
2025-05-13 15:38:37 +00:00
Nanley Chery
4502254cd2 anv: Drop the slow clear heuristic
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This no longer provides a performance improvement.

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33776>
2025-05-13 15:13:05 +00:00
Nanley Chery
67d60f4325 intel/blorp: Simplify get_fast_clear_rect() for gfx12.5
Refactor the scale factors to highlight the 16-tile width requirement on
Tile4. The fast-clear simulator code associated with HSD 1407682962
also contains a 16-tile requirement for Tile4 surfaces (for the pitch).

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33776>
2025-05-13 15:13:05 +00:00
Nanley Chery
312952048b intel/blorp: Redescribe gfx12.5 surfaces for CCS fast clears
According to HSD 1407682962 and the associated simulator code,
fast-clear performance can be affected by: image alignment, tiling,
dimensionality, and row pitch. Redescribe surfaces in order avoid
fast-clearing at a slower rate.

Also, benchmarking the main patch in the performance CI (hw=A750)
shows that some traces are helped significantly:
* TotalWarWarhammer3 +5.58% (n=2)
* Factorio +3.75% (n=1)
* TerminatorResistance +3.3% (n=2)
* Borderlands3 +3.23% (n=2)

We could additionally increase the alignment requirements of surfaces in
order to deterministically increase fast-clear performance. That's left
out of this patch in order to avoid any functional pitfalls that can
arise with increased memory consumption. As a result, performance will
continue to be affected by how ISL/drivers/apps configure main surface
memory alignments (directly or indirectly).

Thanks to Lionel Landwerlin for pointing me to the relevant simulator
code.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11168
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11418
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33776>
2025-05-13 15:13:05 +00:00
Nanley Chery
169e22f962 intel/blorp: Drop clear color assignment prior to Xe2
This hasn't been used since the responsibility of clear color updates
moved to the drivers.

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33776>
2025-05-13 15:13:05 +00:00
Nanley Chery
e353244553 intel/blorp: Disable repclear for gfx12 fast-clear
Docs indicate that this shouldn't be used.

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33776>
2025-05-13 15:13:05 +00:00
Nanley Chery
8dad01903a intel: Add and use isl_surf_image_has_unique_tiles()
Returns whether or not a subresource range maps to a tile-aligned memory
range which doesn't overlap other subresources.

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33776>
2025-05-13 15:13:04 +00:00
Nanley Chery
fcdae4d4c0 intel: Add and use isl_surf_from_mem()
Unify code which creates surfaces from buffers. The behavior is slightly
changed to use array layers to enable arrayed buffer clears (as needed).

Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33776>
2025-05-13 15:13:04 +00:00
Wei Zhao
9a21ac2730 winsys/amdgpu: Remove assert about user fence in amdgpu_fence_wait
The assertion `assert(afence->seq_no <= *user_fence_cpu)` in
`amdgpu_fence_wait` can trigger a Mesa exit during GPU mode2 resets in
virtualized guest environments.

A GPU reset can cause the hardware to discard commands, including the
one that updates the user fence BO (`*user_fence_cpu`). This leaves
`*user_fence_cpu` with an older value, while `afence->seq_no` (from
command submission) is newer, leading to
`afence->seq_no > *user_fence_cpu` and triggering the assert.

Removing this assert prevents Mesa from exiting in this reset scenario.
No adverse side effects observed during testing. The assert appears
overly strict for hardware reset events where command completion is not
guaranteed.

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/34924>
2025-05-13 14:51:01 +00:00
Eric Engestrom
c2b6600ae8 docs/release-calendar: add 25.2 branchpoint & rc dates
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/34950>
2025-05-13 15:12:57 +02:00
Danylo Piliaiev
bcf901f5fb tu,freedreno: Use HW option to auto add base instance to instance id
We don't need the lowering of instance id to "base instance + offset"
since hw has VFD_ADD_OFFSET_INSTANCE flag.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34902>
2025-05-13 11:35:39 +00:00
Danylo Piliaiev
4bc060ea11 nir: Add option to not lower gl_InstanceIndex
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <anholt@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34902>
2025-05-13 11:35:39 +00:00
Georg Lehmann
0a30611c10 nir/opt_algebraic: some bitfield_select optimizations
Foz-DB Navi21:
Totals from 47 (0.06% of 79789) affected shaders:
Instrs: 69536 -> 69363 (-0.25%)
CodeSize: 370624 -> 369388 (-0.33%)
Latency: 383505 -> 383298 (-0.05%)
InvThroughput: 72924 -> 72727 (-0.27%)
PreSGPRs: 2618 -> 2610 (-0.31%)
VALU: 43261 -> 43091 (-0.39%)
SALU: 13065 -> 13063 (-0.02%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34739>
2025-05-13 10:59:09 +00:00
Georg Lehmann
201f6c1a00 gallium: remove left over clover files
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34930>
2025-05-13 10:29:46 +00:00
David Rosca
f5677a9050 radeonsi/video: Use ac_uvd_alloc_stream_handle
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:48 +00:00
David Rosca
5fee04bcae radv/video: Use ac_uvd_alloc_stream_handle
ac_uvd_alloc_stream_handle tries to avoid collisions in the case
when PID is not unique (eg. in sandboxes like Flatpak).

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12607
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:48 +00:00
David Rosca
69455e8208 ac/uvd: Add ac_uvd_alloc_stream_handle
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:47 +00:00
David Rosca
46d5926d83 radeonsi/vcn: Stop using stream handle for decode
It's only needed for old UVD without session context. Also remove
the NULL check for session context buffer as we always have the buffer.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:47 +00:00
David Rosca
09d8235938 radeonsi/vcn: Remove unused stream_handle for encode
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:47 +00:00
David Rosca
fb53eec720 radeonsi/uvd_enc: Remove unused stream_handle
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:47 +00:00
Natalie Vock
4339cf0aff driconf: Add workarounds for DOOM: The Dark Ages
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Like other idTech games, it needs radv_zero_vram and
radv_disable_dedicated_sparse_queue. It also needs
radv_force_64k_sparse_alignment.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34944>
2025-05-13 07:58:03 +00:00
Natalie Vock
e32a90b57c radv,driconf: Add radv_force_64k_sparse_alignment config
Needed by DOOM: The Dark Ages.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34944>
2025-05-13 07:58:03 +00:00
Tapani Pälli
720dae85f2 mesa: add missing stencil formats to _mesa_is_stencil_format
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13070
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34931>
2025-05-13 07:29:04 +00:00
Samuel Pitoiset
4b73d7e817 radv: fix SDMA copies for linear 96-bits formats
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The hardware requires a power of two bpe. To do that, the driver
needs to adjust the pitch/offset/extent based on a texel scale factor
which only applies to 96-bits formats.

This fixes new VKCTS coverage.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34927>
2025-05-13 06:15:55 +00:00
Marek Olšák
a1ee6d6730 nir: fix gathering color interp modes in nir_lower_color_inputs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 709ebd82 ("amd: expose nir_io_mix_convergent_flat_with_interpolated")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12800

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34942>
2025-05-13 00:05:37 -04:00
Mike Blumenkrantz
ef63e3e4d2 zink: fix broken comparison for dummy pipe surface sizing
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this should create a new surface if the existing one is too small,
not if it is too big

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34933>
2025-05-12 19:34:08 +00:00
Danylo Piliaiev
824194aa0b tu: Don't disable EARLY_Z if SampleMask is written without d/s write
With EARLY_Z depth is written before FS is executed, so if FS writes
gl_SampleMask - the d/s written before FS would be incorrect since
sample mask can kill samples. However, if there is no d/s write
it's ok to kill fragment before FS.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34900>
2025-05-12 19:04:54 +00:00
Konstantin Seurer
5926b63f66 nir: Print struct type declarations
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26267>
2025-05-12 18:28:50 +00:00
Konstantin Seurer
5981b5bb7e nir/print: Use get_name for types
This avoids an awkward "  " if the struct name is missing.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26267>
2025-05-12 18:28:50 +00:00
Konstantin Seurer
d21311504b nir/print: Add a get_name helper
get_name works for any identifier, not just variables.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26267>
2025-05-12 18:28:50 +00:00
Job Noorman
96e2cf64ae freedreno/ci: update expectations
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
53de95cb0d ir3/postsched: use legalize state for delay/sync calc
Switch to using the newly available ir3_legalize_state API in
ir3_postsched. This has a few advantages:
- Prevents duplication of delay/sync logic. ir3_postsched is currently
  missing a lot of the complexities implemented in ir3_legalize. Reusing
  the logic makes sure ir3_postsched is kept up to date with these
  complexities.
- Allows ir3_postsched to have a global view (i.e., across blocks) on
  delay and sync state. Currently, all information is cleared at the
  start of blocks which makes us underestimate required delays.
- Allows ir3_postsched to have a more accurate view on required sync
  flags. We currently calculate requirement once based on whether an
  instruction's sources come from a ss/sy-producer. This does not take
  into account whether sources have already been synced. Now we can do
  this.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
ca014c7c24 ir3/legalize: make ir3_legalize_state and helpers public
Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
631a105148 ir3/legalize: apply ss/sy to state in sync_update
This will keep the state consistent without having to worry about
calling apply_ss/sy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
a0c2fdd152 ir3/legalize: add syncs based on previous instr to sync_update
sync_update currently only deals with the current instruction but there
are a few cases where syncs depend on the previous instruction (e.g.,
barriers). Add those to sync_update/ir3_required_sync_flags to have all
the sync logic centralized.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
7a44d832d3 ir3/legalize: add ir3_update_legalize_state helper
This is a convenience helper that updates 1) the sync state, 2) the
delay state, and 3) the block's current cycle value.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
0e9b7c6ff3 ir3/legalize: remove unused parameter from delay_update
Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
0c05839fcd ir3/legalize: extract ir3_merge_pred_legalize_states helper
We will want to use this functionality in ir3_postsched.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
d4503b01b7 ir3/legalize: add ir3_init_legalize_state helper
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
ee430745fe ir3/legalize: extract sync_update helper
We will want to use this functionality in ir3_postsched.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
b91828d553 ir3/legalize: extract ir3_required_sync_flags helper
We will want to use this functionality in ir3_postsched.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
540cee6c3b ir3/legalize: remove ctx argument from delay_calc/update
In preparation for making these functions usable outside of
ir3_legalize.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:05 +00:00
Job Noorman
f7002802c3 ir3/legalize: normalize nop state at block start
Now that we have the block's final cycle value available in its state,
we don't have to subtract it at the end of a block anymore, but we can
do it at the beginning when merging it into its successor state. This
will save us one iteration over all its ready slots.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:04 +00:00
Job Noorman
03ee7c7c0f ir3/legalize: add cycle to ir3_legalize_state
Having the cycle as part of the state will become convenient for two
reasons:
- It will allow us to merge the state of predecessors without having to
  normalize states at the end of blocks (i.e., we now have to subtract
  the block's final cycle value from its ready slots at the end of the
  block; having its final cycle value available in its state will allow
  us to do this when merging predecessor states at the start of the
  block).
- We can update the cycle value as part of delay/sync state update
  routines. This way, the user doesn't have to worry about which
  instructions should actually update the cycle as this logic is nicely
  encapsulated.

This is part of the preparation for making the delay/sync legalization
logic available outside of ir3_legalize.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:04 +00:00
Job Noorman
12fadd27d3 ir3: add mergedregs to ir3_compiler
Storing it only in ir3_shader is sometimes inconvenient because it's not
available everywhere.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:04 +00:00
Job Noorman
0977863a8e ir3: calculate sstall/systall across blocks
Resetting the ss/sy delays at the start of blocks would underestimate
the actual delays at runtime. Make the estimate more accurate by keeping
track of outstanding delays at the end of blocks and setting the initial
delays of blocks to the maximum of their predecessor blocks.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34108>
2025-05-12 17:58:04 +00:00
Faith Ekstrand
13f9135e85 compiler/rust: Better document CFG
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/34919>
2025-05-12 17:31:33 +00:00
Faith Ekstrand
98deabfa90 nak: Fix some rusdoc warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34919>
2025-05-12 17:31:33 +00:00
Faith Ekstrand
3459004104 nak: Improve documentation for RegRef
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34919>
2025-05-12 17:31:33 +00:00
Faith Ekstrand
22056d5b08 nak: Improve documentation for PerRegFile
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34919>
2025-05-12 17:31:33 +00:00