Commit graph

209434 commits

Author SHA1 Message Date
Danylo Piliaiev
aa1dd15b2c tu: Use cmd->rp_trace u_trace for draw calls
Fixes: 707c97f634 ("tu: Add tracepoints around draws, with shader sha1s.")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38240>
(cherry picked from commit c04e375588)
2025-11-12 10:09:22 +01:00
Lionel Landwerlin
70fd7c41b5 vulkan/runtime: simplify robustness state hashing
We're doing the same in vk_pipeline_precomp_shader_create().

Also fixes valgrind warning due to uninitialized fields

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647>
(cherry picked from commit fc6d17a290)
2025-11-12 10:09:22 +01:00
Daniel Schürmann
7860ec361f radv/null_device: set more options which affect compilation
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525>
(cherry picked from commit 23ef756496)
2025-11-12 10:09:21 +01:00
David Rosca
ea7122e249 radv/video: Add NULL checks for picture parameters
Fixes vk_layer_validation_tests PositiveVideoDecode.* and
PositiveVideoDecode*.InlineSessionParams

Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38158>
(cherry picked from commit bd151bf8b2)
2025-11-12 10:09:21 +01:00
David Rosca
1dee784011 radv/video: Correctly handle no feedback query for encode
Fixes vk_layer_validation_tests PositiveVideoEncodeAV1.*

Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38158>
(cherry picked from commit 23a3587aa6)
2025-11-12 10:09:21 +01:00
David Rosca
9c1348741c vulkan/video: Avoid NULL pointers in session parameters
Always copy parameters that are not guarded by a flag, zero init
the structs if not provided by application.

Fixes vk_layer_validation_tests PositiveVideoEncode*.GetEncodedSessionParams

Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38158>
(cherry picked from commit 6a1c6ab95b)
2025-11-12 10:09:21 +01:00
Benjamin Cheng
c11c07847d vulkan/video: NULL check codec-specific chain
It seems applications are allowed to do no-op updates by not passing any
codec-specific extension structures.

Cc: mesa-stable
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38158>
(cherry picked from commit 4d22427079)
2025-11-12 10:09:21 +01:00
Timothy Arceri
712cbacf51 mesa: skip redundant uniform update optimisation if unsafe
If multiple contexts are updating uniform values we can't assume
a uniform update can skip flushing.

Fixes: b32e20e630 ("mesa: skip redundant uniform updates for glUniformHandle")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14129

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38101>
(cherry picked from commit 34db720660)
2025-11-12 10:09:21 +01:00
Lionel Landwerlin
fa480da7fd anv: avoid invalid timestamp generation due to skipped commands
We skip the stall emission for STATE_BASE_ADDRESS since this one can
be skipped on Gfx12.5+ and instead add a new sba tracepoint that has
valid timestamps.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0147908a89 ("anv: predicate emission of STATE_BASE_ADDRESS")
Reviewed-by: Casey Bowman <casey.g.bowman@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38256>
(cherry picked from commit cff047280a)
2025-11-12 10:09:21 +01:00
Yiwei Zhang
8a3d79512b glcpp/meson: fix libglcpp generated header dependency
Explicitly declare glcpp-parse.h as a file dependency to ensure
glcpp_parse custom target completes before compiling glcpp-lex.c.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38254>
(cherry picked from commit 53482178ef)
2025-11-12 10:09:21 +01:00
Georg Lehmann
a4c98e97ab aco/gfx10_3: work around NSA hazard
4+ dword NSA can hang if exec becomes non-zero again directly before
the instruction.

Foz-DB Navi21:
Totals from 608 (0.74% of 82161) affected shaders:
Instrs: 945138 -> 946431 (+0.14%)
CodeSize: 5171580 -> 5176864 (+0.10%)
Latency: 13356895 -> 13357113 (+0.00%)
InvThroughput: 3043234 -> 3043236 (+0.00%); split: -0.00%, +0.00%

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9852
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13981
Cc: mesa-stable

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38215>
(cherry picked from commit b2172467d1)
2025-11-12 10:09:21 +01:00
David Rosca
d5b344054c radv/video: Fix AV1 bidir compound encode with order_hint disabled
Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37911>
(cherry picked from commit bcb6e6b6e6)
2025-11-12 10:09:21 +01:00
David Rosca
a4bf4cf8de radv/video: Don't require encode FW version >= interface version
Otherwise this breaks backwards compatibility when bumping interface
version for new features.

Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37911>
(cherry picked from commit 96db490318)
2025-11-12 10:09:21 +01:00
David Rosca
9c23a3a745 radeonsi/vcn: Fix AV1 bidir compound encode with order_hint disabled
Cc: mesa-stable
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37911>
(cherry picked from commit 1a8a8db8c5)
2025-11-12 10:09:21 +01:00
Yiwei Zhang
6ce43552cd llvmpipe: misc fixes for sparse binding
This change:
1. Move size validation within sparse binding, but not escape to
   non-sparse code path.
2. Error out if sparse is requested on unsupported platforms.

Fixes: d747c4a874 ("lavapipe: Implement sparse buffers and images")
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38074>
(cherry picked from commit e0acc5c2b4)
2025-11-12 10:09:20 +01:00
Yiwei Zhang
36f0885c44 llvmpipe: add a missing alloc error handling in fd import
Fixes: d74ea2c117 ("llvmpipe: Implement dmabuf handling")
Suggested-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38074>
(cherry picked from commit 66414c6b70)
2025-11-12 10:09:20 +01:00
Yiwei Zhang
fd085d2e3e llvmpipe: fix udmabuf mmap error check
Upon failing to mmap, MAP_FAILED (void *)-1 is returned instead of NULL.

Fixes: d74ea2c117 ("llvmpipe: Implement dmabuf handling")
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38074>
(cherry picked from commit 3e07f57d4a)
2025-11-12 10:09:20 +01:00
Yiwei Zhang
ab5f1669d2 llvmpipe: zero is also a valid fd
Fixes: a062544d3d ("llvmpipe: Use an anonymous file for memory allocations")
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38074>
(cherry picked from commit 3a655c212b)
2025-11-12 10:09:20 +01:00
Samuel Pitoiset
90892e886f radv,aco: wait for all VMEM loads when the prolog loads large 64-bit attributes
Not the most optimal solution but 64-bit vertex attributes are rarely
used. Could still revisit if we find a real use case that matters.

This fixes recent VKCTS coverage:

dEQP-VK.pipeline.fast_linked_library.vertex_input.component_mismatch.r64g64b64.*_to_dvec2
dEQP-VK.pipeline.shader_object_.*.vertex_input.component_mismatch.r64g64b64.*_to_dvec2

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14243
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38237>
(cherry picked from commit a0d607bfdb)
2025-11-12 10:09:20 +01:00
Samuel Pitoiset
9cc48665b1 aco: fix reserving VGPRs for 64-bit attributes in VS prologs
Otherwise the fetch index would be overwritten if the attribute format
is 64-bit and more than 2 components are loaded.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14242
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38237>
(cherry picked from commit ba5bf81aa2)
2025-11-12 10:09:20 +01:00
Yiwei Zhang
92974d930b panvk: fix sample shading of internal blend shader for MSAA
Align with gallium side. When fixed-function blending is not available,
the internal blend shader is used. This is handled by a single ST_TILE
in the blend shader with the current sample ID, which requires sample
shading enablement.

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38129>
(cherry picked from commit 763d2418b8)
2025-11-12 10:09:20 +01:00
Lionel Landwerlin
9218b7a9a2 u_trace: reserve chunk space before emitting copies
Some implementations can emit tracepoints when copying u_trace
buffers. It's important to reserve the slots we want to copy into
before emitting the copies so that both processes don't clash with one
another.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38199>
(cherry picked from commit df5f92d114)
2025-11-12 10:09:20 +01:00
Danylo Piliaiev
2162362f8b vulkan: Always fill DS state for EXT_dynamic_rendering_unused_attachments
If renderpass has D/S attachment, but pipeline has D/S as UNDEFINED,
D/S should be properly disabled for the pipeline. The easiest way is to
ensure that D/S state is valid when pipeline's D/S format is UNDEFINED.
So we always create VkPipelineDepthStencilStateCreateInfo.

CC: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37550>
(cherry picked from commit 2798ef7bfd)
2025-11-12 10:09:20 +01:00
Ryan Houdek
b2178afb93 freedreno/fdl: Fix typo in tiled_to_linear_2cpp
The non-aarch64 path was copying in the wrong direction.

Fixes: 7a5a33e0e3 ("freedreno/fdl: Add tiling/untiling implementation for a6xx/a7xx")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38226>
(cherry picked from commit 455eb2c751)
2025-11-12 10:09:20 +01:00
Mel Henning
4ca61f20f3 nak/opt_lop: Don't handle modifiers in dedup_srcs
The handling in dedup_srcs was incorrect because it would apply the
modifier from srcs[i] to the LUT without removing the modifier from the
instruction. We can fix and simplify this code by removing all modifiers
before the dedup_srcs() call, which we were doing immediately after the
call anyway.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13966
Fixes: 66c9c40f68 ("nak: Handle modifiers in dedup_srcs() in opt_lop()")
Reviewed-by: Seán de Búrca <sdeburca@fastmail.net>
Reviewed-by: Lorenzo Rossi <git@rossilorenzo.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38220>
(cherry picked from commit 041216e605)
2025-11-12 10:09:20 +01:00
Konstantin Seurer
c4c051b85e llvmpipe: Always recompute 1/w
The value depends on the tgsi_interpolate_loc which is not constant for
the loop. llvm should be able to cse in cases where they are the same.

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
(cherry picked from commit aa28fcb610)
2025-11-12 10:09:19 +01:00
Konstantin Seurer
f94dcb58dc gallivm/nir/soa: Use the sign of src1 for imod
This is the behavior specified by the nir opcode, the spirv spec and
required by maintenance8.

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
(cherry picked from commit 4d30da6599)
2025-11-12 10:09:19 +01:00
Konstantin Seurer
8984129846 lavapipe: Bump MAX_DESCRIPTOR_UNIFORM_BLOCK_SIZE
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
(cherry picked from commit 25e678a37d)
2025-11-12 10:09:19 +01:00
Konstantin Seurer
a042737651 lavapipe: Zero image null descriptors
The size queries for images do not use function pointers so we need to
be careful that width, height and depth are 0.

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
(cherry picked from commit d6dd96e1c7)
2025-11-12 10:09:19 +01:00
Konstantin Seurer
6d3ef7f6ce lavapipe: Bump maxPrimitiveCount
The vulkan spec requires at least 2^29-1.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14212
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38197>
(cherry picked from commit ff145d2ddc)
2025-11-12 10:09:19 +01:00
Janne Grunau
094bc4eefc hk: Report the correct plane count in VkDrmFormatModifierProperties2?EXT
Fixes import of planar formats like NV12 in gtk4. Allows
`gst-launch-1.0 v4l2src ! gtk4paintablesink` to use vulkan instead of
falling back to OpenGL.

Closes: #14217
Cc: mesa-stable
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38200>
(cherry picked from commit 83b97379dc)
2025-11-12 10:09:19 +01:00
Marek Olšák
aa7575dc50 Revert ABI breakage "amd: Add user queue HQD count to hw_ip info"
This reverts commit 56d758d321.

It broke ABI between Mesa and libdrm, causing crashes due to stack smashing.

See: https://gitlab.freedesktop.org/mesa/libdrm/-/issues/121#note_3172362

Fixes: 56d758d321
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38203>
(cherry picked from commit 5d92c92ce5)
2025-11-12 10:09:19 +01:00
Alyssa Rosenzweig
2150cc183c asahi,ail: fix multi-plane imports
We need to handle plane offsets everywhere. I noticed this broken before but
didn't realize it was a GL driver issue. Fix is easy, wrote this on my sofa
while waking up in the morning.

Fixes gst-launch-1.0 v4l2src ! glimagesink

Note that cheese & snapshot both still hang for some reason due to
libgstpipewire, but the Mesa side should be fine now.

Closes: #14217
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38160>
(cherry picked from commit aa9f937116)
2025-11-12 10:09:19 +01:00
Ian Romanick
b15dacca51 elk: Apply vgrf127 workaround in more cases
No shader-db changes on Broadwell. Older platforms were not tested.

Fixes: e7b7d572b3 ("intel/fs/ra: Re-arrange interference setup")
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38122>
(cherry picked from commit 2e8b89ec60)
2025-11-12 10:09:19 +01:00
Ian Romanick
8eb9913065 brw: Apply Gfx9 vgrf127 workaround in more cases
No shader-db changes on any Intel platform.

fossil-db:

Skylake
Intel(R) HD Graphics 530 (SKL GT2)
Totals:
Cycle count: 57669758527 -> 57669757913 (-0.00%); split: -0.00%, +0.00%

Totals from 10 (0.00% of 1736875) affected shaders:
Cycle count: 274949 -> 274335 (-0.22%); split: -0.36%, +0.14%

This change is likely due to subtle differences of different registers
being allocated.

In addition, fossils/google-meet-clvk/BgBlur.1f58fdf742c27594.1.foz and
fossils/google-meet-clvk/Relight.1f58fdf742c27594.1.foz stopped failing
EU validation on Gfx9 platforms.

Closes: #14171
Fixes: e7b7d572b3 ("intel/fs/ra: Re-arrange interference setup")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38122>
(cherry picked from commit 3e6af6c5bb)
2025-11-12 10:09:19 +01:00
Samuel Pitoiset
045701fe9c radv: add a workaround for illegal depth/stencil descriptors with No Man's Sky
Using descriptors with both depth and stencil aspects is illegal in
Vulkan and this hangs the GPU.

Use NULL descriptors to mitigate the issue. Note that AMDVLK also
ignores them.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13325
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38180>
(cherry picked from commit cb4e0c4140)
2025-11-12 10:09:18 +01:00
Gert Wollny
662ba562f0 r600/sfn: AR loads are not dependend on the future and other code blocks
If the AR is loaded from a register changing that register in a loop was
resulting in a scheduling failure because the AR load was made dependend
on a later instruction. Fix the dependencies by only using dependencies on
older instruuctions in the same block.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14114
Fixes: d21054b4bc ("r600/sfn: Add pass to split addess and index register loads")

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38056>
(cherry picked from commit 43d9765e35)
2025-11-12 10:09:18 +01:00
Paul Gofman
a4431d4343 driconf: add a workaround for Investigation Stories : gunsound
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38152>
(cherry picked from commit 63aec75981)
2025-11-12 10:09:18 +01:00
Eric Engestrom
1b7538c3d5 asahi/virtio: fix memleak
Fixes: c64a2bbff5 ("asahi: port to stable uAPI")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38149>
(cherry picked from commit fdef10916e)
2025-11-12 10:09:18 +01:00
Dmitry Osipenko
77c3d23942 virtio/vdrm: Fix varying offsets of struct vdrm_device members
Struct virgl_renderer_capset_drm has a varying size depending on whether
AMDGPU driver is enabled or not. This breaks offset of struct vdrm_device
members for non-AMD drivers when Mesa is built with multiple native context
drivers including the AMD driver. Place varying capsets in the end struct
vdrm_device to mitigate the issue.

Fixes: 5736280730 ("virtio/vdrm: add ENABLE_DRM_AMDGPU for c_args")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38096>
(cherry picked from commit bd8377bb04)
2025-11-12 10:09:18 +01:00
Mike Blumenkrantz
a27eba1b8a zink: don't destroy old push layout when enabling fbfetch descriptor
this may be in use by programs, and adding tracking/refcounting just to
delete a descriptor layout isn't worth the effort

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38141>
(cherry picked from commit 272cf1db8e)
2025-11-12 10:09:18 +01:00
Eric Engestrom
c27f7af356 .pick_status.json: Mark ff57c31696 as denominated 2025-11-12 10:09:18 +01:00
Eric Engestrom
bb964247da .pick_status.json: Mark b2badb2b24 as denominated 2025-11-12 10:09:18 +01:00
Eric Engestrom
102825f3bf .pick_status.json: Update to 2705d8bd8b 2025-11-12 10:09:18 +01:00
Eric Engestrom
46f77b3207 docs: add sha sum for 25.2.6
Some checks failed
macOS-CI / macOS-CI (dri) (push) Has been cancelled
macOS-CI / macOS-CI (xlib) (push) Has been cancelled
2025-10-29 18:57:04 +01:00
Eric Engestrom
3f12436d80 VERSION: bump for 25.2.6 2025-10-29 18:08:35 +01:00
Eric Engestrom
6ecfc443b7 docs: add release notes for 25.2.6 2025-10-29 18:08:35 +01:00
Mike Blumenkrantz
cbeb80c190 zink: collapse gfx pipeline fetching and binding conditionals
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this avoids taking the wrong conditional if a pipeline fetch fails

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38134>
(cherry picked from commit 0b24fd174a)
2025-10-29 17:42:24 +01:00
Alyssa Rosenzweig
7a20c05ecc anv: use D3D-compatible texturing for Proton
Intel & AMD Direct3D drivers modify their rounding behaviour for texturing to
match Direct3D expectations. Such behaviour is not conformant in Vulkan, and
Intel hardware lacks a reasonable way to get NVIDIA's behaviour (which uniquely
works for Vulkan & Direct3D). The second best choice is to use
Direct3D-compatible behaviour for Proton (via driconf) and our current
Vulkan-conformant behaviour everywhere else. Given the APIs diverge and there is
no Vulkan extension to control the behaviour explicitly, driconf'ing on the
engineName is the reasonable solution.

anv already has a anv_force_filter_addr_rounding driconf option to force
Direct3D behaviour for certain Direct3D titles. Here we simply apply it to all
D3D10+ titles, aligning us with the Windows driver.

Note that D3D9 does not have this behaviour. We therefore use standard Vulkan
behaviour for D3D9 to avoid breaking D3D9 titles, even though the engineName is
the same as D3D10+.

This is the same solution radv uses, they call it radv_disable_trunc_coord. We
could unify the driconf entries later.

See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38098#note_3166306
for a more detailed analysis, as well as the linked references:

   https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27337
   https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911
   https://github.com/HansKristian-Work/vkd3d-proton/pull/1884

This fixes misrendering in piles of Direct3D games run on anv via Proton,
including Assassin's Creed Valhalla.

Cc: mesa-stable
Closes: #13886
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Co-authored-by: Calder Young <cgiacun@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38114>
(cherry picked from commit 7a71952762)
2025-10-29 17:42:23 +01:00
Job Noorman
86ea347167 spirv: don't set in_bounds for structs
The arr::in_bounds field was set unconditionally for every deref created
for a chain. For struct derefs, which don't have this field, this would
write to an unused memory location, which is probably why this never
caused issues.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: f19cbe98e3 ("nir,spirv: Preserve inbounds access information")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38110>
(cherry picked from commit 0ac55b786a)
2025-10-29 17:42:23 +01:00