Commit graph

190082 commits

Author SHA1 Message Date
Sasha Finkelstein
2f4f9f0b98 hk: Implement VK_EXT_map_memory_placed
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13008
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34789>
2025-05-06 18:41:08 +00:00
Alyssa Rosenzweig
0acb34b065 hk: use nir_lower_default_point_size
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34762>
2025-05-06 17:07:00 +00:00
Alyssa Rosenzweig
a49403f4ac agx/nir_lower_tess: use nir_lower_default_point_size
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34762>
2025-05-06 17:07:00 +00:00
Alyssa Rosenzweig
d53a3a081b agx/nir_lower_gs: use nir_lower_default_point_size
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34762>
2025-05-06 17:07:00 +00:00
Alyssa Rosenzweig
5788770d91 nir: add nir_lower_default_point_size pass
this is useful across drivers for maint5 semantics on mobile hw.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34762>
2025-05-06 17:07:00 +00:00
Mel Henning
9ce14a5787 nak: Remove #![allow(unstable_name_collisions)]
Removing this doesn't trigger any warnings, so I assume it's been fixed
in the meantime.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34591>
2025-05-06 16:48:34 +00:00
Mel Henning
7edb086685 nak: Call nir_opt_phi_to_bool
This opt seems to be somewhat sensitive to pass order - it really wants
to run somewhere between nir_opt_loop and nir_opt_remove_phis. (radv,
the only other backend that calls this pass, also matches that
ordering).

shader-db stats:

Totals:
CodeSize: 29166032 -> 29034608 (-0.45%); split: -0.46%, +0.01%
Number of GPRs: 156968 -> 156969 (+0.00%)
SLM Size: 147360 -> 147316 (-0.03%)
Static cycle count: 9126931 -> 9158663 (+0.35%); split: -0.07%, +0.42%
Spills to memory: 173573 -> 170288 (-1.89%)
Fills from memory: 173573 -> 170288 (-1.89%)
Spills to reg: 17838 -> 17111 (-4.08%); split: -4.09%, +0.01%
Fills from reg: 13089 -> 13090 (+0.01%)

Totals from 45 (0.69% of 6568) affected shaders:
CodeSize: 8993312 -> 8861888 (-1.46%); split: -1.49%, +0.03%
Number of GPRs: 4978 -> 4979 (+0.02%)
SLM Size: 93596 -> 93552 (-0.05%)
Static cycle count: 4703524 -> 4735256 (+0.67%); split: -0.14%, +0.81%
Spills to memory: 107785 -> 104500 (-3.05%)
Fills from memory: 107785 -> 104500 (-3.05%)
Spills to reg: 5667 -> 4940 (-12.83%); split: -12.86%, +0.04%
Fills from reg: 4131 -> 4132 (+0.02%)

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34591>
2025-05-06 16:48:34 +00:00
Zan Dobersek
c0dfdc907b tu: allow bigger block sizes when copying between buffers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When copying between buffers, find the biggest possible block size usable
for all copy regions. A common block size is used since using different
block sizes can require additional flushing between different blocks.

Besides the single-byte and 4-byte block sizes, also allow for 16-byte
block size and the appropriate corresponding format. Using bigger block
size when possible helps potentially reduce the number of required
CP_BLIT operations. Tested on the Crucible benchmarks, especially for
larger copy regions this can improve throughput up to 3x.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34587>
2025-05-06 16:29:48 +00:00
Juan A. Suarez Romero
ae51c59663 broadcom/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34837>
2025-05-06 15:02:56 +00:00
Lionel Landwerlin
c434050a00 brw: add pre ray trace intrinsic moves
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Some intrinsics are implemented by reading memory location that could
be rewritten by a further tracing calls. So we need to move those
reads prior to tracing operations in the shaders.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8979
Tested-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34214>
2025-05-06 13:34:53 +00:00
Lionel Landwerlin
37608c075f anv: promote VK_EXT_robustness2 to VK_KHR_robustness2
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34821>
2025-05-06 13:16:13 +00:00
Danylo Piliaiev
f03be478a9 tu/lrz: Add tu_ignore_frag_depth_direction driconf
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Will be useful if app doesn't specify depth direction correctly.
E.g. the capture of "Sons of The Forest" I have has a shader
where `gl_FragDepth` has `layout(depth_less)`, but the output for different
fragments is actually sometimes less, sometimes more than the original depth
by a tiny margin.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34423>
2025-05-06 11:21:17 +00:00
Danylo Piliaiev
847ad80e03 tu/lrz: Consider FS depth layout when gl_FragDepth is written
Specifying depth write direction in shader may help us. E.g.
If depth test is GREATER and FS specifies FRAG_DEPTH_LAYOUT_LESS
it means that LRZ won't kill any fragment that shouldn't be killed,
in other words, FS can only reduce the depth value which could
make fragment to NOT pass with GREATER depth test. We just have to
enable late Z test.

There is the same concept in D3D11 and it is seen e.g. in "Stray" game.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34423>
2025-05-06 11:21:17 +00:00
Karmjit Mahil
d05b92d720 tu: Add "check_cmd_buffer_status" debug option
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Add a debug option which checks the status of a command buffer, if
it has completed execution on the GPU, before it's reset or
destroyed.

This works by getting the GPU to write to a specific memory address
on vkBeginCommandBuffer and vkEndCommandBuffer, so the CPU can check
that the GPU has written the TU_CMD_BUFFER_STATUS_IDLE to the slot
before actually resetting or freeing the command buffer.

This can to help in debugging sync issues within the driver.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34383>
2025-05-06 08:47:18 +00:00
Hyunjun Ko
86d21fd2cf anv: Set tc/beta offset according to the flag from PPS.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Consider the flag from PPS when setting tc/beta offset.

This fixes some artifacts when decoding a hevc video,
hevc_scaling_list4.mkv from Lynne.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34782>
2025-05-06 04:24:22 +00:00
Hyunjun Ko
7998106355 vulkan/video: Fix wrong parsing for H265 decoding
Not found real issues yet related to this though,
this is apparently wrong.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34782>
2025-05-06 04:24:22 +00:00
Faith Ekstrand
20543981b5 nak: Print the % for SSA predicates
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
I don't remember why we special-cased predicates.  There isn't a
particularly good reason.  This lets us drop the weird fmt_plain()
and just use fmt() for everything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Faith Ekstrand
56bdf9043b nak: Move SSAValue and friends to a new ssa_value.rs file
This is getting complicated and depends on some inter-linked details for
safety such as values being in-range. It's safer if the rest of the IR
is forced to use public interfaces.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
9d1c38ddf1 nak: Check that swizzles are none
wherever we check that src_mod is none.

This commit simply does:
s/src_mod.is_none()/is_unmodified()/
across all of nak except the definition of is_unmodified() itself.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Fixes: bad23ddb48 ("nak: Add F16 and F16v2 sources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
6e72f0f81b nak: Add Src::is_unmodified() helper
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Fixes: bad23ddb48 ("nak: Add F16 and F16v2 sources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
d91ba8f36d nak: Mark Large SSARef paths as cold
This hints to the optimizer that these paths are less commonly executed.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
2f44970b68 nak: Support large SSARef
This lets us store up to 16 SSAValues in an SSARef, while keeping the
common case of 4-or-fewer SSAValues allocation-free.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
dee3a0aa58 nak: CBuf and SSARef are no longer Copy
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
68069fb810 nak: SrcRef is no longer Copy
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
a9d2789237 nak: Src is no longer Copy
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Faith Ekstrand
30f6ca6391 nak: Replace Src::new_zero() with a ZERO constant
Constants have different rules with respect to the Copy trait and using
a constant will allow us to initialize arrays even once Copy is gone.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
f21557154b nak/from_nir: Turn srcs into a closure
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
854b2d5882 nak: Dst is no longer Copy
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
0ac3296f28 nak/from_nir: Make fault an Option<SSAValue>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
ddcf0029cd nak: Use references to src/dst more places
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
ffe438c77d nak: Return SSAValue from builder where possible
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
b9e9a811b8 nak: Split scalar/vec in SSABuilder::alloc_ssa
SSABuilder::alloc_ssa() is now only for scalars. We intoduce
SSABuilder::alloc_ssa_vec() which handles the vector case the way
alloc_ssa previously did. This matches the split used in SSAValueAllocator

We're about to drop Copy from SSARef, which makes it a lot more annoying
to deal with. SSAValue will remain Copy though, so we want to start
using it instead of SSARef where possible.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
1ff9848d25 nak: Use NonZeroU32 for SSAValue and remove NONE
Code that might have an invalid SSAValue is encouraged to use
Option<SSAValue> instead of NONE, which is now the same size as a u32
and provides more type safety.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Mel Henning
121b2b889b nak: Add an SSARef::from_iter() helper
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
2025-05-05 23:08:02 +00:00
Yiwei Zhang
4f07092bdb venus: fix to passively enable wsi required extensions
Required extensions to support wsi have been relaxed earlier for sw blit
path. So the renderer extensions enablement is fixed to be passive based
on the renderer side correspondingly.

Test: emulate to drop dma-buf and modifier support from host anv driver,
and confirm wsi via venus works with sw blit fallback and device
creation no longer returns VK_ERROR_FEATURE_NOT_PRESENT.

Fixes: 06f5d1a105 ("venus: expose WSI on renderer without dma-buf support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34827>
2025-05-05 21:43:33 +00:00
Collabora's Gfx CI Team
149bad63ea Uprev Piglit to 1498c397ea35119692b579dd6f523de4651c663f
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
c50d9aa54f...1498c397ea

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34688>
2025-05-05 20:34:12 +00:00
Faith Ekstrand
2f8b27713d nak: Fold Src::fold_imm() into the legalization pass
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/34818>
2025-05-05 17:51:25 +00:00
Faith Ekstrand
c3417c3c82 nak: Use as_u32() directly in Src::is_fneg_zero()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34818>
2025-05-05 17:51:25 +00:00
Faith Ekstrand
274be4291e nak: Handle SrcType::F64 in Src::is_fneg_zero()
We handled it fine if src_ref was SrcRef::Zero but not if src_ref was
SrcRef::Imm32(0x80000000), which is also negative zero.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34818>
2025-05-05 17:51:25 +00:00
Faith Ekstrand
8a4ffe3c7e nak: Fold source modifiers in Src::as_u32()
For now we leave a fold_imm() helper with the old semantics because
there are still two uses of it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34818>
2025-05-05 17:51:25 +00:00
Faith Ekstrand
4648a15476 nak: Take a SrcType in Src::as_u32()
Without a type, we can't really interpret the data.  Currently, it just
returns None in the presence of modifiers so it's okay.  Also, all of
the callers of this helper today do so on the source of an OpPrmt which
doesn't support source modifiers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34818>
2025-05-05 17:51:25 +00:00
Faith Ekstrand
4b5eec6c2a nak/sm20: Use SrcRef::as_u32()
This makes more sense as we don't want any complex logic around source
modifiers or any of that.  We just want to handle Zero and Imm32 in the
same case.  Also, explicitly assert that modifiers are None, which is
more clear anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34818>
2025-05-05 17:51:25 +00:00
Faith Ekstrand
cb156a468e nak: Match on the SrcRef directly in Src::is_nonzero()
Calling as_u32() isn't really doing us any good here since we want to
fail for SrcRef::Zero anyway.  Also assert that src_mod == None since we
don't handle FNeg in this path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34818>
2025-05-05 17:51:25 +00:00
José Roberto de Souza
a82b569649 anv: Reduce memory pool usage in MTL and ARL
Those platforms requires aux map with 1MB alignment, for slab that
means that any buffer needs to have size of multiple of 1MB what
causes a lot of memory to be wasted causing it to run out of memory
when running multiple GPU applications.

Fixes: ea18572ff2 ("anv: Add support for ANV_BO_ALLOC_AUX_CCS in anv_slab_bo")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34817>
2025-05-05 16:42:14 +00:00
Karol Herbst
7c78c76181 iris/xe: take the grids variable_shared_mem into account
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This fixes OpenCL local memory kernel arguments.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34548>
2025-05-05 16:04:17 +00:00
Karol Herbst
fee9230bb5 iris/xe: fix compute shader start address
It needs to apply the offset so it selects the correct SIMD shader.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34548>
2025-05-05 16:04:17 +00:00
Karol Herbst
57ccfd0502 iris: parse global bindings for every gen
This fixes OpenCL support on gen 12.5+

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34548>
2025-05-05 16:04:17 +00:00
Mary Guillemard
8447f7aaae pan/genxml: Fix inverted logic on nr_regs
v10 have 96 and v12+ have 128, not the opposite.

Fixes: 811525b543 ("pan/genxml: Build libpanfrost_decode for v12")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34815>
2025-05-05 15:31:38 +00:00
Samuel Pitoiset
1aa5fd5da2 radv: promote VK_EXT_robustness2 to VK_KHR_robustness2
This is a 1:1 promotion.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34810>
2025-05-05 15:02:19 +00:00
Samuel Pitoiset
4e09a5c992 vulkan: Update XML and headers to 1.4.314
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34810>
2025-05-05 15:02:19 +00:00