Commit graph

209172 commits

Author SHA1 Message Date
Georg Lehmann
f6227baf01 ac/nir: do not assume mesh cull flag is 1bit
It will no longer be 1bit after a nir/lower_io bug is fixed.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36966>
(cherry picked from commit 13a9f27432)
2025-09-03 12:08:50 +02:00
Georg Lehmann
5d8633369d aco/optimizer: don't create undef copies from p_create_vector
p_create_vector allows undef operands, p_parallelcopy doesn't.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13765
Fixes: 01d20680e2 ("aco/optimizer: generalize p_create_vector of split vector opt")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36963>
(cherry picked from commit 635ac758c9)
2025-09-03 12:08:50 +02:00
Georg Lehmann
c95d55e918 aco/optimizer: don't apply packed clamp to v_fma_mix
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13758
Fixes: 345bf8a2f2 ("aco/optimizer: remove label_vop3p")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36963>
(cherry picked from commit 8903bb4618)
2025-09-03 12:08:50 +02:00
Julia Zhang
a245b6cd72 pps: init driver in OnSetup
Initialization of driver has been moved to register_data_source() from
OnSetup() by: a739889789 ("pps: Report available counters when
gpu.counters* data source is registered")

With above change, pps will destroy driver when collecting data stops
(pps may keep running) then the driver will become nullptr when user try
to collect data again. This will cause segmentation fault in OnSetup().

So this remove driver = nullptr in OnStop() and init driver in OnSetup()
to make sure driver exists when pps-producer run more than once.

Fixes: a739889789 ("pps: Report available counters when gpu.counters*
data source is registered")

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36548>
(cherry picked from commit 20b809f1f0)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
1cfa5a474b compiler/rust: Fix the DFS loop detection algorithm
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-09-03 12:08:50 +02:00
Faith Ekstrand
7b09f7d156 nak: NAK_MAX_QMD_SIZE_B should be 384
Also add a static assert so we don't miss this again.

Fixes: 00a845a698 ("nak/qmd: QMD versions 4.0 and 5.0 are both 384B")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37015>
(cherry picked from commit 0a14ce7f50)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
df0a1e7eac nak/qmd: QMD versions 4.0 and 5.0 are both 384B
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 00a845a698)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
55914689c5 nvk: Allow for larger QMDs
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 0e268dad00)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
5939ff09ba nak/hw_runner: Allow for variable sized QMDs
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 238534e069)
2025-09-03 12:08:50 +02:00
Faith Ekstrand
ec112a35e2 nak: Add a nak_qmd_size_B() query
Also add a #define NAK_QMD_ALIGN_B for alignments.  The alignment is
always 256B and there's no evidence of that changing.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Backport-to: 25.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36995>
(cherry picked from commit 02ef6a5158)
2025-09-03 12:08:50 +02:00
Eric R. Smith
bb7baeae6c 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-09-03 12:08:50 +02:00
Erik Faye-Lund
b8c30ec7e0 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-09-03 12:08:50 +02:00
Boris Brezillon
66fdba6e09 panvk: Fix disjoint image memory binding
Right now, we store the last VkDeviceMemory object bound to an image in
panvk_image::mem, but this doesn't work for disjoint images where the mem
object can differ on each plane.

Move panvk_image::mem to panvk_image_plane::mem and prefix the offset
field with mem_, so it's clear the offset refers to the mem object.

Note this should only fix host copy on disjoint images, since the GPU
address was already properly set at bind time.

Fixes: 1cd61ee948 ("panvk: implement VK_EXT_host_image_copy for linear color images")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36926>
(cherry picked from commit d0126f5ced)
2025-09-03 12:08:50 +02:00
Eric R. Smith
8c04110b17 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-09-03 12:08:49 +02:00
Lionel Landwerlin
8395d77ccb brw: remove uniform from opt_offsets
Those are for push constants, no point in doing that because :
   - there is no HW constant offsets in push constants (payload
     delivery), it's just register offset calculation
   - if we have an dynamic value it's already using MOV_INDIRECT

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e103afe7be ("brw: run the nir_opt_offsets pass and set the maximum offset size")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36958>
(cherry picked from commit 27c69acb6a)
2025-09-03 12:08:49 +02:00
Samuel Pitoiset
387a1c2c08 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-09-03 12:08:49 +02:00
Mark Collins
1da029bcdf 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-09-03 12:08:49 +02:00
Connor Abbott
517e94499f 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-09-03 12:08:49 +02:00
Sagar Ghuge
cfadaadcc6 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-09-03 12:08:49 +02:00
Sagar Ghuge
4f1f8afe13 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-09-03 12:08:49 +02:00
Sagar Ghuge
b7b7f74e4f 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-09-03 12:08:49 +02:00
David Rosca
5ce967c717 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-09-03 12:08:49 +02:00
David Rosca
3b26509439 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-09-03 12:08:49 +02:00
David Rosca
734d42d72f 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-09-03 12:08:49 +02:00
David Rosca
26fe847539 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-09-03 12:08:49 +02:00
Georg Lehmann
9e77cb7493 aco: fix ra validation for flat/global/scratch/ds load sbyte_d16
Fixes: 18a53230eb ("aco: don't check dst_bitsize in apply_load_extract")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36964>
(cherry picked from commit 791a57805c)
2025-09-03 12:08:49 +02:00
Samuel Pitoiset
7d73389a95 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-09-03 12:08:49 +02:00
Qiang Yu
8f2c41c8ef 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-09-03 12:08:49 +02:00
Josh Simmons
4b433fd310 util: Fix BITSET_EXTRACT out-of-bounds read
In some situations the implementation of `BITSET_EXTRACT` would read
beyond the size of the bitset due to an unconditional + 1 in the address
calculation.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Fixes: 0cc9443e9b ("util: Add BITSET_EXTRACT")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34605>
(cherry picked from commit 922c3c53ce)
2025-09-03 12:08:49 +02:00
Pierre-Eric Pelloux-Prayer
4f7345f226 nir/opt_varyings: fix build with PRINT_RELOCATE_SLOT
Fixes: e3d122ed7b ("nir/opt_varyings: completely exclude mediump from type changes")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36411>
(cherry picked from commit e92638b6bf)
2025-09-03 12:08:49 +02:00
Pierre-Eric Pelloux-Prayer
654efa44e3 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-09-03 12:08:49 +02:00
Mike Blumenkrantz
e12c95c4bf zink: when sparse unbinding, always wait on main timeline semaphore
this ensures synchronization between gfx/compute work and the sparse queue

fixes KHR-GL46.sparse_buffer_tests.BufferStorageTest_cases_*. on turnip

cc: mesa-stable

Closes: #13747
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
(cherry picked from commit 39ffc3f629)
2025-09-03 12:08:48 +02:00
Mike Blumenkrantz
6bf190f73f zink: pass ctx to sparse bind functions
no functional changes

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
(cherry picked from commit 2cf626d17d)
2025-09-03 12:08:48 +02:00
Mike Blumenkrantz
af83e46d28 zink: break out unflushed batch waiting into separate function/mechanism
this is useful on its own

no functional changes

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
(cherry picked from commit c9746103f5)
2025-09-03 12:08:48 +02:00
Connor Abbott
a93b1275cc vulkan/queue: Fix VkTimelineSemaphoreSubmitInfo sanitization
We're supposed to completely ignore VkTimelineSemaphoreSubmitInfo if
there aren't any timeline semaphores, including the array lengths, which
is made clear by the various VUs already cited by the code. The
vkQueueSubmit() path correctly handled this when asserting but still
dereferenced pWaitSemaphoreValues unconditionally, which could lead to
dereferencing an invalid pointer if waitSemaphoreValueCount is less than
waitSemaphoreCount. The vkQueueSparseBind() path didn't even assert
correctly. Bring vkQueueSparseBind() in line with vkQueueSubmit()
and make both only dereference the wait/signal array once we've
determined it must be present. While we're here, also fix the assert in
vkQueueSubmit() to disallow a waitSemaphoreValueCount of 0 if there are
timeline semaphores present, which conversely is not allowed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36989>
(cherry picked from commit bef37336fb)
2025-09-03 12:08:48 +02:00
Karol Herbst
4fdc7e990d 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-09-03 12:08:48 +02:00
Mary Guillemard
049afa43d3 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-09-03 12:08:48 +02:00
Pohsiang (John) Hsu
e8db3a7559 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-09-03 12:08:48 +02:00
Yiwei Zhang
45f79c7ee5 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-09-03 12:08:48 +02:00
Jesse Natalie
f8765dccbd nir: Add missing #include for c99_alloca.h
Fixes: 3dd9a978 ("nir: add new pass nir_lower_io_indirect_loads")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36940>
(cherry picked from commit 5b3756f231)
2025-09-03 12:08:48 +02:00
Yiwei Zhang
8f23dba130 panvk: ensure wsi memory is bound at offset 0
No apps or tests have hit the spec corner case yet, but in theory they
could pass invalid offset and expect the impl to ignore it for wsi alias
binding. This change ensures the offset is zero, which aligns with
common wsi side binding as well as obeying the dedicated allocation
requirement.

Fixes: 187956bd51 ("panvk: adopt wsi_common_get_memory")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36603>
(cherry picked from commit 2f54020f29)
2025-09-03 12:08:48 +02:00
Daniel Schürmann
7c4b200707 aco/ra: don't clear lateKill operands in get_reg_create_vector()
Fixes: 08f088479a ('aco/ra: set late-kill for operands of temporary p_create_vector')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36871>
(cherry picked from commit 219c53e6fc)
2025-09-03 12:08:48 +02:00
Robert Mader
ba43727af6 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-09-03 12:08:48 +02:00
David Rosca
6750c5f70b radv/video: Disable H264 encode 8x8 transform when CABAC is disabled
VCN5 only supports it with CABAC enabled.

Fixes: 960f63596f ("radv/video: Add VCN5 encode support")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36881>
(cherry picked from commit 8ac9a9afee)
2025-09-03 12:08:48 +02:00
David Rosca
e048d6204c 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-09-03 12:08:48 +02:00
Jarrett Johnson
836891ad44 nir: tag cls variable as maybe unused
Windows release builds strips asserts resulting in variable
seen as unused (/we4189)

Co-authored-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36915>
2025-09-03 12:08:48 +02:00
Jianxun Zhang
9b8fdca8bc anv: Fix PAT entry in importing (xe2)
If a compressed bo is imported, we should set the corresponding
compressed PAT.

Fixes video corruption in gamescope:
gamescope --force-composition -- vkcube

Close: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13442

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36275>
(cherry picked from commit 8d98bf289d)
2025-09-03 12:08:48 +02:00
Jianxun Zhang
cbd43cd9f8 anv: No compression on host memory allocation (xe2)
The Xe kernel driver doesn't allow vm_bind on compressed bo
if it has user pointer. And we probably shouldn't enable CCS
compression on memory in any case.

This change is necessary to prevent failures once we adjust the
priority of compression PAT entries in a following commit:

Vulkan CTS:
dEQP-VK.api.buffer_marker.compute.external_host_mem.top_of_pipe.
memory_dep.buffer_copy

dEQP-VK.memory.external_memory_host.simple_allocation.
minImportedHostPointerAlignment_x3

anv_kmd_backend.c:308: xe_vm_bind_op: Assertion
`errno_ != EINVAL' failed.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36275>
(cherry picked from commit c766586957)
2025-09-03 12:08:48 +02:00
Job Noorman
b6e59297f7 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-09-03 12:08:48 +02:00
Caio Oliveira
ac602c97c9 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-09-03 12:08:48 +02:00