Commit graph

205080 commits

Author SHA1 Message Date
Faith Ekstrand
d583833971 compiler/rust: Fix the DFS loop detection algorithm
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The previous algorithm just looked at the dominator's loop header.
However, if you have multiple consecutive loops like:

    function_impl {
        loop {
            // Stuff
        }
        loop {
            // Other stuff
        }
    }

then it will look like the second loop is contained in the first loop
because the first loop's header dominates the second loop.  This isn't
actually what we want.  Instead, we want a node N to be considered part
of a loop with header H if H dominates N and H is reachable from N.

Fixes: 741f7067f1 ("nak: Add loop detection to the CFG")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36524>
(cherry picked from commit a1d5e8bfdb)
2025-08-27 11:02:25 +02:00
Eric R. Smith
953a791b53 panvk: revised occlusion query pointer fix
It turns out that the `occlusion_query.syncobj` is used to set
state that later code relies on, and setting it to NULL causes
some Vulkan CTS tests to fail. Instead, we should explicitly check
for the mode being `MALI_OCCLUSION_MODE_DISABLED` to avoid using
an invalid `ptr` field.

Fixes: 24c692c981 ("panvk: fix a NULL pointer dereference in occlusion queries")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36794>
(cherry picked from commit 9b4eb81162)
2025-08-27 08:59:53 +02:00
Erik Faye-Lund
570ecdc9ac pan/lib: clamp format size to 4
When using formats with less than 32-bits per pixel, we pad the
tile-buffer to a multiple of 32-bits so we can store additional bits
used by dithering.

Account for this when computing the max MSAA setting.

Fixes: 329568b5eb ("panfrost: add color-attachment and msaa helpers")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35755>
(cherry picked from commit 6a83193771)
2025-08-27 08:59:53 +02:00
Eric R. Smith
302b94f315 mesa: fix off by one in MSRTT handling
The actual number of samples chosen is allowed to equal the number
requested, but currently we just check for sample counts greater
than the request.

Fixes: 894b37e060 ("mesa: fix sample count handling for MSRTT")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36878>
(cherry picked from commit 095d1b6bcc)
2025-08-27 08:59:53 +02:00
Samuel Pitoiset
167c15f4a5 radv: fix hashing graphics pipeline when no stages are compiled
It's possible with GPL.

This fixes a NULL pointer dereference with updated pipeline binaries
tests in VKCTS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36999>
(cherry picked from commit 944e26eae7)
2025-08-27 08:59:53 +02:00
Mark Collins
17621e7943 freedreno/drm: Only initialize memory data source when Perfetto is active
FdMemoryDataSource was being registered as a Perfetto data source
unconditionally which led to anything calling fd_device_new(...)
attempting to do this even when they might not have Perfetto
initialized which is done as a part of util_perfetto_init, without
which trying to register the event causes a SEGFAULT.

Fixes: c7045e3e63 ("perfetto: unify init")

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36993>
(cherry picked from commit 098521559d)
2025-08-27 08:59:53 +02:00
Connor Abbott
1ce7aca953 tu: Fix CmdBindTransformFeedbackBuffersEXT size handling
According to the spec and as implemented by other drivers, this should
use the size of the buffer instead of the size of the VkDeviceMemory
it's bound to when VK_WHOLE_SIZE is specified or pSizes is NULL. The
current behavior doesn't make sense at all for sparse buffers which are
not bound to a single VkDeviceMemory. Just use the common helper that
already does the right thing, copied from anv.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
(cherry picked from commit 460ed35916)
2025-08-27 08:59:53 +02:00
Sagar Ghuge
06f02d2cd1 anv: Add missing L3 flushes
We are reading out some of the parameters from IR data structure those
have been written previously, on some platforms L3 is not coherent, so
explicitly add those flushes.

Cc: mesa-stable
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/36952>
(cherry picked from commit 2cd564c1de)
2025-08-27 08:59:53 +02:00
Sagar Ghuge
f071d0dfa8 anv: Enable CS stall for ACCELERATION_STRUCTURE_COPY stage
Cc: mesa-stable
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/36952>
(cherry picked from commit 4473e21e2f)
2025-08-27 08:59:53 +02:00
Sagar Ghuge
dec03a8a5d anv: Add missing ACCELERATION_STRUCTURE_READ in barrier handling
Cc: mesa-stable
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/36952>
(cherry picked from commit 75d770b4f8)
2025-08-27 08:59:53 +02:00
David Rosca
19764c137d radeonsi/vcn: Fix HEVC encode transform_skip with old FW
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36845>
(cherry picked from commit e1fcc403d4)
2025-08-27 08:59:53 +02:00
David Rosca
3879bffcad radeonsi/vcn: Fix HEVC encode cu_qp_delta with old FW
VCN2 needs interface version bump to enable it.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36845>
(cherry picked from commit 26fc4798c1)
2025-08-27 08:59:53 +02:00
David Rosca
ca370c281f radeonsi/vcn: Fix compatibility with old FW for encode
The interface version can't be higher than the FW version, otherwise
FW will reject all encode jobs.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36845>
(cherry picked from commit e945bb3649)
2025-08-27 08:59:53 +02:00
David Rosca
3caa520b5f radeonsi/vcn: Disable H264/5 constrained intra pred with rate control
There is a FW issue when using constrained intra prediction with rate
control enabled, causing unexpected quality degradation.
Disable it until FW fix is available.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36837>
(cherry picked from commit 51d5c0d537)
2025-08-27 08:59:53 +02:00
Samuel Pitoiset
89ec0f8c4d radv: add missing L2 invalidate cache flush for non-coherent images
Images aren't always coherent with L2 and AMD generations have
different rules, see radv_image_is_l2_coherent() for the full picture.

This fixes a rendering issue on GFX9 because depth/stencil images
aren't coherent, but this also affects color images.

This also fixes a cache coherency issue with an ongoing extension.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12274
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36815>
(cherry picked from commit 99b287bde5)
2025-08-27 08:59:52 +02:00
Qiang Yu
07278f5621 mesa: fix glTexPageCommitmentARB and glTexturePageCommitmentEXT level check
gl_texture_object._MaxLevel is not set at this point. Follow the level
check of texsubimage_error_check() now.

Fixes: 90415c1a3a ("mesa: implement glTexPageCommitmentARB/glTexturePageCommitmentEXT")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13730
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36865>
(cherry picked from commit c1b9396403)
2025-08-27 08:59:52 +02:00
Pierre-Eric Pelloux-Prayer
064b477536 mesa/st: always use base_serialized_nir for draw
f2f640f35 introduces base variants, so we get 2 NIR shaders:
glsl-to-nir -> base_serialized_nir
            -> serialized_nir

Then, depending on who is using the shader the right one would be picked:

* draw uses base_serialized_nir
* hw driver uses serialized_nir

ef0c9231a7 made sure that base wasn't used when the shader is loaded from
the cache because it's missing, so in this case, glsl-to-nir does:

glsl-to-nir -> from-cache -> serialized_nir

The problem is that if draw tries to use this shader it may fail, for
the same reason as the referenced commits were introduced: draw may not
be compatible with some NIR passes used by the driver.

To fix this we need to serialize both NIR shaders, and pick the right
one depending on the user.

Fixes: ef0c9231a7 ("mesa/st: don't use serialized_nir for cached shaders")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36411>
(cherry picked from commit 0e3ec9e82c)
2025-08-27 08:59:52 +02:00
Karol Herbst
7eab15d9c8 aux/trace: move fence_server calls outside the locked area
Multiple contexts can use those causing deadlocks if e.g. fence_get_fd
gets called before fence_server_signal on another thread on the same
pipe_fence_handle.

Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36819>
(cherry picked from commit d9c3bbb08c)
2025-08-27 08:59:52 +02:00
Mary Guillemard
ca5259ec32 nouveau/headers: Fix nv_push rust push_inline_data implementation
Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 66954d997d ("nouveau/headers: Add an nv_push crate in Rust")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36093>
(cherry picked from commit c64d8a0548)
2025-08-27 08:59:52 +02:00
Pohsiang (John) Hsu
76724bd376 gallium/pipebuffer: fix multithread issue on pb_slab_manager_create_buffer
This is an issue found in testing multiple mediafoundation MFT
concurrently.  Thanks to Jesse for the fix.

cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36923>
(cherry picked from commit e76e95e084)
2025-08-27 08:59:52 +02:00
Yiwei Zhang
215521c03b vulkan/android: amend a missing case for IMPLEMENTATION_DEFINED AHB
An AHB with IMPLEMENTATION_DEFINED format is commonly backed by NV12 or
XBGR8888. The former is the usual pick for camera <-> GPU interop, while
the latter is mostly only seen in Android CTS. Ideally, we can rely on
the queried fourcc to resolve everything instead of being on the
fallback path, but keeping this a minimal fix is easy for porting.

Cc: mesa-stable
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36866>
(cherry picked from commit 25a8e124e0)
2025-08-27 08:59:52 +02:00
Robert Mader
29c6a25747 gallium: Set and count all extra samplers
After the commit mentioned below the `extra` variable only holds the
last added extra sampler. For 3-plane formats this results in one extra
sampler being leaked.

Add the bits for each extra sampler instead.

Fixes: abcd02a07d (gallium: Properly handle non-contiguous used sampler view indexes)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Matthias Reichl <hias@horus.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36870>
(cherry picked from commit 25fe82630a)
2025-08-27 08:59:52 +02:00
David Rosca
dc7228101e radeonsi/vcn: Disable H264 encode 8x8 transform when CABAC is disabled
VCN5 only supports it with CABAC enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13029
Fixes: e509139f61 ("radeonsi/vcn: Add support for H264 8x8 transform on VCN5")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36881>
(cherry picked from commit 2e400fc099)
2025-08-27 08:59:52 +02:00
Job Noorman
10bf8e0ba6 ir3: emit descriptor prefetch in block dominated by its sources
Descriptor prefetches may be generated for instructions in control flow.
This means we cannot simply emit prefetches at the end of the preamble
because that may not be dominated by all their sources. This commit uses
the helpers introduced by e7ac1094f6 ("ir3: rematerialize preamble defs
in block dominated by sources") to find the correct block to insert
prefetches.

Fixes NIR validation errors in Dying Light 2.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 4e2a0a5ad0 ("ir3: Add descriptor prefetching optimization on a7xx")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36885>
(cherry picked from commit 24cdb0b636)
2025-08-27 08:59:52 +02:00
Caio Oliveira
75a07b9a7c brw: Fix folding case for MAD instruction with all immediates
Fixes: b605f76b2a ("brw/algebraic: Constant fold multiplicands of MAD")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36867>
(cherry picked from commit 74a4e7dd4b)
2025-08-27 08:59:52 +02:00
Samuel Pitoiset
ccbee20a6c radv: dirty some states from graphics pipeline earlier
This might actually fixes a couple of things because needed dynamic
states are computed before radv_emit_graphics_pipeline(), so dirtying
them too late doesn't make much sense.

This doesn't fix anything known.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36900>
(cherry picked from commit d40e841cc4)
2025-08-27 08:59:51 +02:00
Georg Lehmann
d16922979f nir/uub: fix exclusive scans
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36874>
(cherry picked from commit a2e48d2ede)
2025-08-27 08:59:51 +02:00
Lionel Landwerlin
0fb416d506 brw: fix analysis dirtying with pulled constants
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 5c17299084 ("brw: enable A64 pulling of push constants")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36455>
(cherry picked from commit df37c7ca74)
2025-08-27 08:59:51 +02:00
Job Noorman
0984a7f374 ir3: don't vectorize nir_op_sdot_4x8_iadd[_sat]
They don't support being repeated.

Fixes a compiler crash in Hogwarts Legacy.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 58d18bc7a8 ("ir3: lower vectorized NIR instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36886>
(cherry picked from commit b53682f41b)
2025-08-27 08:59:51 +02:00
Iván Briano
6fb64a1e3b anv: fix capture/replay of sparse images with descriptor buffer
We were not implementing vkGetImageOpaqueCaptureDescriptorDataEXT,
relying on the common implementation that does nothing. That works well
enough for regular images because the fixed address needed for
capture/replay is handled by the memory allocation path, but for sparse
images we initialize the sparse bindings at image creation time.

Here we implement the function to retrieve the addresses of all the
used bindings for the image, then use all of them at creation time.
Also, set the correct alloc_flags for this to work.

Fixes: 43b57ee8a5 ("anv: add capture/replay support for image with descriptor buffers")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35872>
(cherry picked from commit 20f546d6c1)
2025-08-27 08:59:51 +02:00
Faith Ekstrand
4c59ed19db subprojects: Stop calling add_languages() in paste-1-rs/meson.build
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36849>
(cherry picked from commit 291ccffd3d)
2025-08-27 08:59:51 +02:00
Antonio Ospite
1e9ab7f43a compiler/rust: fix errors about hiding elided lifetime
In some setups the rust compiler emits errors like the following:

-----------------------------------------------------------------------
error: hiding a lifetime that's elided elsewhere is confusing
   --> ../subprojects/proc-macro2-1.0.86/src/parse.rs:125:25
    |
125 | fn block_comment(input: Cursor) -> PResult<&str> {
    |                         ^^^^^^     -------------
    |                         |          |       |
    |                         |          |       the same lifetime is elided here
    |                         |          the same lifetime is hidden here
    |                         the lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
help: use `'_` for type paths
    |
125 | fn block_comment(input: Cursor<'_>) -> PResult<'_, &str> {
    |                               ++++             +++
-----------------------------------------------------------------------

Follow the solution suggested by the compiler to silence the errors, for
all the observed occurrences.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36849>
(cherry picked from commit 8f84ae7de7)
2025-08-27 08:59:51 +02:00
Antonio Ospite
36f3c9c422 nak/nouveau: silence errors about never used methods
When building nvk for Android the rust compiler emits the following
errors:

-----------------------------------------------------------------------
error: methods `get_pred_src`, `get_u32_bnot_src`, `get_carry_src`, `set_pred_dst`, and `set_carry_dst` are never used
    --> ../src/nouveau/compiler/nak/ir.rs:1371:12
     |
1370 | impl OpFoldData<'_> {
     | ------------------- methods in this implementation
1371 |     pub fn get_pred_src(&self, op: &impl SrcsAsSlice, src: &Src) -> bool {
     |            ^^^^^^^^^^^^
...
1404 |     pub fn get_u32_bnot_src(&self, op: &impl SrcsAsSlice, src: &Src) -> u32 {
     |            ^^^^^^^^^^^^^^^^
...
1413 |     pub fn get_carry_src(&self, op: &impl SrcsAsSlice, src: &Src) -> bool {
     |            ^^^^^^^^^^^^^
...
1446 |     pub fn set_pred_dst(&mut self, op: &impl DstsAsSlice, dst: &Dst, b: bool) {
     |            ^^^^^^^^^^^^
...
1450 |     pub fn set_carry_dst(&mut self, op: &impl DstsAsSlice, dst: &Dst, b: bool) {
     |            ^^^^^^^^^^^^^
     |
     = note: `-D dead-code` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(dead_code)]`

error: method `eval` is never used
    --> ../src/nouveau/compiler/nak/ir.rs:1523:12
     |
1522 | impl PredSetOp {
     | -------------- method in this implementation
1523 |     pub fn eval(&self, a: bool, b: bool) -> bool {
     |            ^^^^

error: method `to_mask` is never used
    --> ../src/nouveau/compiler/nak/ir.rs:5625:12
     |
5614 | impl SuClampRound {
     | ----------------- method in this implementation
...
5625 |     pub fn to_mask(&self) -> u32 {
     |            ^^^^^^^

error: method `cast` is never used
    --> ../src/nouveau/compiler/nak/ir.rs:6041:8
     |
6006 | impl IMadSpSrcType {
     | ------------------ method in this implementation
...
6041 |     fn cast(&self, v: u32) -> i64 {
     |        ^^^^
-----------------------------------------------------------------------

Add `#[allow(dead_code)]` to silence the errors, as suggested by the
compiler.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36849>
(cherry picked from commit 5c019bdee5)
2025-08-27 08:59:51 +02:00
Nataraj Deshpande
f27ba53aca anv: add feature flags for linearly tiled ASTC images
In case of emulated ASTC on supported platforms, currently returning
0 for linear tiled images causes vpGetPhysicalDeviceProfileSupport
failure during AndroidBaselineProfile test. The patch handles it
similar to linearly-tiled images that are used for transfers.

Fixes android.graphics.cts.VulkanFeaturesTest#testAndroidBaselineProfile2021Support.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36798>
(cherry picked from commit f67edacf8b)
2025-08-27 08:59:51 +02:00
David Rosca
381673ce0d radv/video: Enable AV1 decode workaround for gfx1153
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36725>
(cherry picked from commit 638fa01203)
2025-08-27 08:59:51 +02:00
David Rosca
8307a4f3ea radeonsi/vcn: Enable AV1 decode workaround for gfx1153
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36725>
(cherry picked from commit 4893e09c10)
2025-08-27 08:59:51 +02:00
David Rosca
ed813118f2 ac/vcn_dec: Add av1_intrabc_workaround
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36725>
(cherry picked from commit 231d877cc8)
2025-08-27 08:59:50 +02:00
Yiwei Zhang
5a2ef2df28 venus: hide swapchainMaintenance1 behind wsi guard
..otherwise would give false alarm on Android.

Fixes: acd5497067 ("venus: support wsi maintenance1 extensions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36834>
(cherry picked from commit fd0b41b98d)
2025-08-27 08:59:50 +02:00
Mike Blumenkrantz
57db5caf91 zink: remove UNSYNCHRONIZED map flag during unmap flush for non-subdata calls
this avoids a scenario where a non-subdata UNSYNCHRONIZED unmap triggers through
tc at the same time the frontend calls an UNSYNCHRONIZED subdata call
in the main thread, which desynchronizes the cmdbuf and hits an assert

Fixes: 8ee0d6dd71 ("zink: add a third cmdbuf for unsynchronized (not reordered) ops")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36846>
(cherry picked from commit cf5d41575b)
2025-08-27 08:59:50 +02:00
Job Noorman
85c534e2af ir3/array_to_ssa: fix updating/removing phis
Fix checking instruction flags instead of dst flags, and updating src
instead of def.

Totals:
MaxWaves: 2381954 -> 2381958 (+0.00%)
Instrs: 49073677 -> 49073417 (-0.00%)
CodeSize: 102537524 -> 102536824 (-0.00%)
NOPs: 8396340 -> 8396432 (+0.00%); split: -0.00%, +0.00%
MOVs: 1450777 -> 1450422 (-0.02%)
Full: 1714304 -> 1714287 (-0.00%)
(ss): 1126433 -> 1126463 (+0.00%); split: -0.00%, +0.00%
(ss)-stall: 4013834 -> 4013854 (+0.00%)
(sy)-stall: 16713036 -> 16713082 (+0.00%)
Cat0: 9252109 -> 9252194 (+0.00%); split: -0.00%, +0.00%
Cat1: 2337941 -> 2337592 (-0.01%)
Cat7: 1636810 -> 1636814 (+0.00%); split: -0.00%, +0.00%

Totals from 5 (0.00% of 164705) affected shaders:
MaxWaves: 42 -> 46 (+9.52%)
Instrs: 9052 -> 8792 (-2.87%)
CodeSize: 16806 -> 16106 (-4.17%)
NOPs: 2369 -> 2461 (+3.88%); split: -0.17%, +4.05%
MOVs: 1140 -> 785 (-31.14%)
Full: 133 -> 116 (-12.78%)
(ss): 206 -> 236 (+14.56%); split: -0.97%, +15.53%
(ss)-stall: 901 -> 921 (+2.22%)
(sy)-stall: 6229 -> 6275 (+0.74%)
Cat0: 2695 -> 2780 (+3.15%); split: -0.22%, +3.38%
Cat1: 1333 -> 984 (-26.18%)
Cat7: 419 -> 423 (+0.95%); split: -0.48%, +1.43%

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 3ac743c333 ("ir3: Add pass to lower arrays to SSA")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36714>
(cherry picked from commit ca15116fa1)
2025-08-27 08:59:50 +02:00
Natalie Vock
018cee3186 radv: Only expose indirect raytracing on gfx7+
It relies on unaligned indirect dispatches which are broken on gfx6.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30811>
(cherry picked from commit 4de3a5cce3)
2025-08-27 08:59:50 +02:00
Samuel Pitoiset
e246a3d966 radv: fix color attachment remapping with fast-GPL/ESO
If vkCmdSetRenderingAttachmentLocations() isn't setting all color
attachment locations (ie. MAX_RTS), the remapping might be wrong
because MESA_VK_ATTACHMENT_UNUSED is used to trim the unused locations

Found by inspection while implementing a new extension.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36778>
(cherry picked from commit 45c91edd18)
2025-08-27 08:59:50 +02:00
Patrick Lerda
1f4ae92921 r600: fix evergreen gds atomic_counter_comp_swap
This change fixes the gds implementation of
atomic_counter_comp_swap which requires three arguments.
This update is based on 4e3b43f180 "r600/atomic: fix
ATOMCAS instruction." which was the tgsi implementation.

Note: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36554
is required for this change to work properly on cayman.

This change was tested on palm, cypress and barts. Here is the test fixed:
khr-gl4[5-6]/shader_atomic_counter_ops_tests/shaderatomiccounteropsexchangetestcase: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36254>
(cherry picked from commit 521b848ea8)
2025-08-27 08:59:50 +02:00
Faith Ekstrand
c1ed51bae5 anv: Set the Shader capability when compiling the FP64 shader
Otherwise the SPIR-V parser prints a warning the first time the driver
is loaded after a fresh compile.

Fixes: 91b62e9868 ("anv: Use spirv_capabilities for the float64 shader")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783>
(cherry picked from commit 94931fd4f4)
2025-08-27 08:59:50 +02:00
Gert Wollny
fb2fbf03dd r600/sfn: Fix AR use tracking off-by-one error
The evauation of loading the AR register was off by one, so that
splitting an ALU group could actually happen after AR was loaded
resulting in a failure to lower to assembly.

Fixes: d617052db6 ("r600/sfn: take address loads into account when scheduling")

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36742>
(cherry picked from commit 5d0f212d81)
2025-08-27 08:59:50 +02:00
Gert Wollny
a24427b5cf r600/sfn: When splitting an ALU CF update possible start of next CF
Without this update a very long ALU block may not be splitted as
required and lowering to assembly may fail because the maximum
supported length of a ALU CF is overrun.

Fixes: 6aafa2bb49 ("r600/sfn: Split ALU blocks in scheduler to fit into 128 slots")

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36742>
(cherry picked from commit 63c801e8c2)
2025-08-27 08:59:50 +02:00
Lionel Landwerlin
3ceca2beb7 anv: fix R64* vertex buffer format support
Disabled by mistake :(

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 5c7397c751 ("anv: add mapping for VBO formats in format mapping")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36771>
(cherry picked from commit 381cb2cabd)
2025-08-27 08:59:50 +02:00
Iván Briano
80d6e96990 anv: dirty descriptor state on CmdSetDescriptorBufferOffets
Calling vkCmdBindDescriptorBuffersEXT() does not invalidate previously
set descriptor sets. Move the state dirtying to
vkCmdSetDescriptorBufferOffets.

Fixes: ab7641b8dc ("anv: implement descriptor buffer binding")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36768>
(cherry picked from commit 35190aac91)
2025-08-27 08:59:49 +02:00
Iván Briano
755d4ffd28 anv: check for pending_db_mode when dirtying descriptor mode
If an application switches back and forth between descriptor sets and
descriptor buffers before executing a draw/dispatch, we could end up in
a wrong state due to pending_db_mode not getting updated.

Fixes: ab7641b8dc ("anv: implement descriptor buffer binding")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36768>
(cherry picked from commit 382b8e3aa2)
2025-08-27 08:59:49 +02:00
Samuel Pitoiset
53258ecd31 radv: fix reserving space for emitting push constants with DGC IES
layout->push_constant_mask is only the DGC push constant mask (ie. the
tokens that are specified), but with IES all push constants are emitted
from the DGC shader. So it should be the total range of push constant.

This used to work by luck due to the preprocess buffer alignment.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36753>
(cherry picked from commit 3359386145)
2025-08-27 08:59:49 +02:00