Commit graph

211269 commits

Author SHA1 Message Date
Marek Olšák
219fcd4b32 nir/opt_call: handle load_global(_amd) with SPECULATE as rematerializable
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37101>
2025-08-30 14:55:13 -04:00
Seán de Búrca
70794de792 rusticl/kernel: delay calculation of CSO info until kernel creation
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37036>
2025-08-30 09:59:54 -07:00
Eric Engestrom
ba292ac34a zink+radv/ci: add traces job on gfx1201
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/37010>
2025-08-30 14:53:55 +00:00
Eric Engestrom
e0417ea468 zink+radv/ci: add traces job on vangogh
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37010>
2025-08-30 14:53:55 +00:00
Karol Herbst
0478d83eae rusticl/kernel: rework KernelExecBuilder::get_resources_and_globals to reduce allocations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:53 +00:00
Karol Herbst
0b80bf3ee0 rusticl/kernel: allocate the full input buffer at creation time
This should save us random reallocations of the input buffer lowering
kernel launch overhead by a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:53 +00:00
Karol Herbst
cfbe6020dc rusticl/kernel: add KernelExecBuilder::input
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:53 +00:00
Karol Herbst
183cbb0862 rusticl/kernel: move workgroup id offset handling into KernelExecBuilder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:52 +00:00
Karol Herbst
3edb4daba2 rusticl/kernel: add KernelExecBuilder::get_resources_and_globals
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:52 +00:00
Karol Herbst
89f35e99a4 rusticl/kernel: add KernelExecBuilder::add_zero_padding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:52 +00:00
Karol Herbst
0dc2a8fc01 rusticl/kernel: add KernelExecBuilder::add_values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:51 +00:00
Karol Herbst
f83cfe7b21 rusticl/kernel: move add_sysval into KernelExecBuilder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:51 +00:00
Karol Herbst
955c83992b rusticl/kernel: move add_global into KernelExecBuilder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:50 +00:00
Karol Herbst
a2ffc1db55 rusticl/kernel: move add_pointer into KernelExecBuilder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:50 +00:00
Karol Herbst
fc6f646262 rusticl/kernel: reduce CPU overhead of set_global_binding
This gets rid of the slice conversion we had to do previously.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:49 +00:00
Karol Herbst
357299052a rusticl/mesa: add borrow/to_owned semantics to our pipe_resource wrapper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:49 +00:00
Karol Herbst
10b3dcdadf rusticl/mesa: rename PipeResource to PipeResourceOwned
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36917>
2025-08-30 14:36:49 +00:00
Renato Pereyra
443446aa82 anv: Enable anv_emulate_read_without_format for Android 15+
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
shaderStorageImageReadWithoutFormat is required by Android 15+

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37073>
2025-08-29 22:36:12 +00:00
Tim Van Patten
c585341552 intel/ds: Skip expensive timestamp query until necessary
The Xe ioctl DRM_XE_DEVICE_QUERY_ENGINE_CYCLES provides accurate
timestamps correlated between the CPU and GPU. However, it is slow and
impacts performance while collecting Perfetto traces.

Instead, use Perfetto's GetBootTimeNs() to track when to emit the
BUILTIN_CLOCK_BOOTTIME clock sync event so it only occurs every 1
second. This reduces the impact of recording gpu.renderstages from
-8% to -4%.

More concretely, FPS measurements when tracing Unity BoatAttack demo on
an Intel ADL device:

* gpu.renderstages disabled:            48.044293667
* gpu.renderstages enabled:             38.119778333 (-20.66%)
* gpu.renderstages enabeled + this fix: 42.641818333 (-11.24%)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37095>
2025-08-29 21:34:43 +00:00
Mike Blumenkrantz
352ca665cb zink: set can_bind_const_buffer_as_vertex
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37093>
2025-08-29 21:07:40 +00:00
Mike Blumenkrantz
6c1294ae1c zink: unset validate_all_dirty_states
whatever bug used to exist here with DOOM2016 has since been fixed

ref #8252

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37093>
2025-08-29 21:07:40 +00:00
Sagar Ghuge
90daa80d1d anv: Apply pipe flushes for outstanding PC bits
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Apply any outstanding accumulated PC bits before we proceed on building
Acceleration Structure.

2 reasons for this :
   - some of the data accessed by the build might need to be flushed
     as a result of a previous barrier
   - the scratch buffer might get reused between builds

Cc: mesa-stable
Closes: #13711
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Caleb Callaway <caleb.callaway@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36951>
2025-08-29 20:19:45 +00:00
Rob Clark
e9cd8ebb16 freedreno/a6xx: Require write support for images
is_format_supported() doesn't really differentiate between read and
write.  So require both.

Fixes a bunch of cl cts tests resulting from garbage (uninitialized)
storage_descriptor.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37089>
2025-08-29 19:57:35 +00:00
Mohamed Ahmed
af5a7b0ddf nil: Add missing compressible PTE kinds
We were missing compressible PTE kinds for generic on TU102 and GB202.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37094>
2025-08-29 15:27:50 -04:00
Faith Ekstrand
1b6d6f8e03 nil: Delete some useless image alignment code
This was copied+pasted from the old GL driver but we never use any of
those PTE kinds since they're only for compressed depth pre-Turing.
We've also never provied that this is actually good for anything.  Just
delete it for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37094>
2025-08-29 15:27:50 -04:00
Mary Guillemard
b7a0f0215f hk: Return 0 for opaque memory capture replay
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
If implementation does not actually replay the VA, it must return 0
to not violate:

"If the memory object was allocated with a non-zero value of
opaqueCaptureAddress, the return value must be the same address."

Fixes RenderDoc capture replay, which asserts on the this spec rule
being followed.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 5bc8284816 ("hk: add Vulkan driver for Apple GPUs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37090>
2025-08-29 17:11:00 +00:00
Eric Engestrom
159fcfdb2f ci: document what scope the ci_run_n_monitor token needs
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/37083>
2025-08-29 16:18:30 +00:00
Benjamin Otte
4598028fde device_select: Allow shortcut names for device types
Add a bunch of shortcut names to select physical devices by their device
type.
In particular this aims to make switching between igpu and dgpu easy as
well as testing with lavapipe.

v2:
- rebase and reformat
- use strncasecmp and VkPhysicalDeviceType
- only print debug message when enabled

Signed-off-by: Benjamin Otte <otte@redhat.com>
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> (v2)
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36717>
2025-08-29 15:51:06 +00:00
Rhys Perry
dea14578b8 device-select: refactor device_select_get_default
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36717>
2025-08-29 15:51:06 +00:00
Rhys Perry
7302e839ea device-select: use debug_get_bool_option for FORCE_DEFAULT_DEVICE
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36717>
2025-08-29 15:51:05 +00:00
Rhys Perry
1ff868adcf device-select: do all getenv during instance creation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36717>
2025-08-29 15:51:05 +00:00
Rhys Perry
e15e7738ac device-select: simplify adding/removing instances
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36717>
2025-08-29 15:51:04 +00:00
Rhys Perry
c1bd371f15 device-select: move get_default_device to it's own file
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36717>
2025-08-29 15:51:04 +00:00
Rhys Perry
a392a57778 device-select: clang-format
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36717>
2025-08-29 15:51:03 +00:00
Connor Abbott
d77b066d52 tu: Don't decrement implicit_sync_bo_count with VM_BIND
There are no implicit sync BOs with VM_BIND and this is unused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37070>
2025-08-29 15:14:40 +00:00
Danylo Piliaiev
0e3654a167 tu: Fix the lack of IB size sanitization in several cases in tu_cs
A BO can be larger than the requested size due to page-size alignment.
Sanitize the IB size derived from the BO at all call sites that create
IBs for CS, so we never exceed the HW limit.

Was found when replaying the following capture:
 Sid Meiers Civilization VI_289070 _dx11_World Map_ultra_720p.rdc

Fixes: aa392e1ec2 ("tu: Align BO size to page size")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37082>
2025-08-29 14:49:48 +00:00
Alyssa Rosenzweig
b1146e4fd1 mailmap: add Alyssa's Intel e-mail address
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: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37071>
2025-08-29 14:11:10 +00:00
Alyssa Rosenzweig
ff3bebc07f people: update Alyssa's email
Authoritative source:
https://www.phoronix.com/news/Alyssa-Rosenzweig-Joins-Intel

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37071>
2025-08-29 14:11:09 +00:00
Aleksi Sapon
5d06b2ac64 draw: don't set the clipped window coordinate to NaN in debug
Setting the old window coordinate to NaN is more likely to hide the
problem in debug builds because the NaN vertices are dropped later in
the pipeline, either through explicit NaN checks or implicit line
length checks.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36653>
2025-08-29 13:35:12 +00:00
Aleksi Sapon
1eef08771f draw: fix missing line viewport transformation
Fixes: 00627b4f ("aux/draw: add guardband clipping for lines")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36653>
2025-08-29 13:35:12 +00:00
Gert Wollny
44c07c93d0 r600/sfn: try all possible configurations when splitting multi-slot instructions
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With that we can better schedule these instructions into groups.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36921>
2025-08-29 12:03:55 +00:00
Gert Wollny
1cd125f982 r600/sfn: Pin registers to channel only after scheduling
Registers that don't need to be pinned to a channel right from the start
can be pinned when the instrcutions writing to them are scheduled.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36921>
2025-08-29 12:03:55 +00:00
Gert Wollny
7de75bafc6 r600/sfn/tests: Update source pinning when loading from string
Results of TEX and FETCH are pinned to group automatically when
creating instructions from string. With the new scheduling code
the channel pinning might be added and this needs to be handled
when reading the expectation shaders.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36921>
2025-08-29 12:03:54 +00:00
Ashley Smith
d9b388af27 mesa: Fix support for GL_EXT_shader_clock
Missing 32-bit entry point in GLSL

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 2ce20170 ("mesa: Add support for GL_EXT_shader_clock")
Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36041>
2025-08-29 11:09:04 +00:00
Danylo Piliaiev
97b4b1879d freedreno/a750: Fix typo in recent magic regs change
Caused GPU hangs.

Fixes: a84069cff4 ("freedreno/registers: De-open-code some offsets")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37079>
2025-08-29 10:44:10 +00:00
Danylo Piliaiev
371df8bdce tu: Use approx square tiles when FDM is enabled
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When using FDM, we need approximately square tiles to maintain
proper density distribution across the framebuffer.
Way to wide or tall tiles would distort the density mapping, causing
areas intended for low density to receive higher density and vice
versa.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37032>
2025-08-29 09:58:08 +00:00
Lionel Landwerlin
23a4aef14a Revert "brw: move texture offset packing to NIR"
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This reverts commit 4346210ae6.

Fixes: 4346210ae6 ("brw: move texture offset packing to NIR")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37050>
2025-08-29 06:29:14 +00:00
Lionel Landwerlin
1f279e6a08 Revert "anv: enable non uniform texture offset lowering"
This reverts commit 23de5abcb5.

Fixes: 23de5abcb5 ("anv: enable non uniform texture offset lowering")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37050>
2025-08-29 06:29:14 +00:00
Lionel Landwerlin
d0e1dffcb7 anv: temporary disable KHR_maintenance8
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 47cfc77085 ("anv: expose VK_KHR_maintenance8 support")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37050>
2025-08-29 06:29:13 +00:00
Faith Ekstrand
c6e831ac44 nak,nir: Use a simpler version of phis_to_regs_block in lower_cf
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The original lower_phis_to_regs_block() is a little too clever.  It
crawls up the predecessor tree until it finds a cross edge and places
the register writes as deep as it can.  This breaks nak_nir_lower_cf().
Say you have a shader like...

    con %0 = load_uniform()
    con loop {
        if div {
        } else {
        }
        break;
    }
    con %1 = phi %0

The original lower_phis_to_regs_block() will turn it into

    con %0 = load_uniform()
    con %r = decl_reg();
    con loop {
        if div {
           reg_store(%r, %0)
        } else {
           reg_store(%r, %0)
        }
        break;
    }
    con %1 = reg_load(%r)

We then convert it into unstructured control-flow and run regs_to_ssa()
to get our phis back, which lowers each of the registers we inserted to
a phi tree.  When we try to recover divergence information on phis by
looking at their sources, this works fine if each source maps directly
to a reg_store() whic maps directly to a phi in the original IR.
However, because the reg_store() instructions are placed deeper, it may
introduce false divergence.

Switch to the simple version of nir_lower_phis_to_regs_block() which
places reg writes directly in phi predecessor blocks.  We could probably
be more conservative and just avoid placing writes to uniform regs in
divergent control-flow but it's more robust to make the load/store_reg
intrinsics match the original phis directly.

This fixes some shaders in Horizon: Zero Dawn Remastered

Fixes: b013d54e4f ("nak/lower_cf: Flag phis as convergent when possible")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36914>
2025-08-29 01:24:56 +00:00