Commit graph

210148 commits

Author SHA1 Message Date
Gert Wollny
db8c3aae8d r600: Update GPR count when adding a GDS instruction
CC: mesa-stable

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36554>
2025-08-11 22:28:35 +00:00
Gert Wollny
ed04848770 r600/sfn: update readports before trying to schedule group instrutions
We only do minimal checks to ensure that copy propagation doesn't break
the readport setup, but we don't update the groups readport setup. So
before scheduling the group do this update. Also check the readport
constellation when scheduling a group is finished.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36572>
2025-08-11 22:10:08 +00:00
Gert Wollny
070f56237f r600/sfn: Fix update readports method
- If a readport reservation is not successful then we have to reset the
  readport reservation.
- Since the scheduler can add instructions in any order, we have to
  update the readports in the same order the slots were filled when
  re-evaluating.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36572>
2025-08-11 22:10:08 +00:00
Gert Wollny
316d3a3f95 r600/sfn: reuse readport for already loaded registers
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36572>
2025-08-11 22:10:07 +00:00
Gert Wollny
68d5f1c456 r600/sfn: unify and fix naming of group readport reserver
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36572>
2025-08-11 22:10:07 +00:00
Gert Wollny
9ce6d9ff1f r600/sfn: Simplify test code when scheduling a vec instr into trans
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Now that we track the free slots right away, we can make use of this
information when testing whether a vec instruction can be scheduled into
a trans slot.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36584>
2025-08-11 21:54:38 +00:00
Gert Wollny
a6d97070a7 r600/sfn: rename free_slots and improve updating it
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36584>
2025-08-11 21:54:38 +00:00
Gert Wollny
67d0f51029 r600/sfn: check number of fsat64 source uses properly
Fixes: 255eee10ac
    r600/sfn: Implement fsat for 64 bit ops

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36585>
2025-08-11 21:40:10 +00:00
Gert Wollny
206ec1ff77 r600/sfn: lower u2f64 and i2f64 in nir
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36587>
2025-08-11 21:26:20 +00:00
Gert Wollny
f7552429ef r600/sfn: remove first call to r600_split_64bit_alu_and_phi
The pass is run later a second time, but there is no need to do it twice.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36587>
2025-08-11 21:26:20 +00:00
Gert Wollny
6fea840c2c r600/sfn: Allow f2f64 to use vec2
Lowering u2f64 and i2f64 will create such instructions and with that
the ALU groups are filled without the need to do scheduler trickery with
two-slot ops that have also two dest registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36587>
2025-08-11 21:26:20 +00:00
Gert Wollny
fdaf105178 r600/sfn: lower b2f64 in nir
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36587>
2025-08-11 21:26:20 +00:00
Yonggang Luo
f12ad5da70 microsoft/clc: Improve clc_compiler_test.cpp to use defined expect value
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36723>
2025-08-11 21:11:18 +00:00
Yonggang Luo
c2f6efbc8a microsoft/clc: {} for struct initialize to avoid warning
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36723>
2025-08-11 21:11:18 +00:00
Faith Ekstrand
6ece4f3fa0 vulkan: Add a vk_video_session_finish() helper
It's always better if init/finish come in pairs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
22a1f34728 radv: Delete radv_video_session_params
It was just a dummy wrapper around the runtime struct.  We do, however,
have to keep at least the Create/Update entrypoints because RADV has to
do some patching for video encode.  Since we're keeping Create, we keep
Destroy as well.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
e0b25e78ff anv: Delete anv_video_session_params
It's just a dummy wrapper around the common struct.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
8f03f9b443 vulkan: Add common VideoSessionParametersKHR entrypoints
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
9d6f65db9a vulkan: Add handle casts for vk_video_session[_parameters]
This also allows us to simplify the interface to
vk_video_session_parameters_create().

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Faith Ekstrand
f8086c6472 vulkan/video: Switch vk_video_session_parameters to create/destroy
These are never created on the stack or deep inside other objects so it
makes sense to use create/destroy instead of init/finish.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36646>
2025-08-11 20:34:56 +00:00
Marek Olšák
d93156c2a2 ac: merge AC_ARG_INT & AC_ARG_FLOAT into single AC_ARG_VALUE
nothing uses the type anymore

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:30 -04:00
Marek Olšák
bb8d2e55d1 ac/llvm: make AC_ARG_FLOAT equal to AC_ARG_INT
Nothing cares about the type anymore.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:29 -04:00
Marek Olšák
9cede6e8b0 radeonsi: bitcast shader args to float in LLVM IR manually
This will allow us to merge AC_ARG_FLOAT/INT because nothing else uses
the type.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:27 -04:00
Marek Olšák
324a7f7e24 ac/llvm: make ac_get_arg non-inline
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:25 -04:00
Marek Olšák
54fe9aa664 ac: simplify AC_ARG_CONST_*PTR enums
The pointer type doesn't matter anymore.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:23 -04:00
Marek Olšák
d5d5726908 ac/nir: remove unused ac_get_ptr_arg & ac_arg_type_to_pointee_type
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:19 -04:00
Marek Olšák
dbefe0c26d ac/nir: inline ac_get_ptr_arg
so that we can get rid of ac_get_ptr_args.

RADV uses AC_ARG_CONST_PTR for num_work_groups, which maps to i8, which
seems wrong.

No functional change.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:17 -04:00
Marek Olšák
4edcd8a87f ac/llvm: inline ac_array_in_const*_addr_space
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36696>
2025-08-11 15:32:15 -04:00
Job Noorman
a1278095d3 ir3: align alias sequences to work around hardware bug
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
There seems to be a hardware bug that sometimes causes a GPU hang when
an alias...sam sequence crosses an instruction cache line boundary. This
commit adds a workaround pass that inserts padding nops to ensure no
such sequence cross a cache line. Until an alternative solution is
found, this is the best we can do.

While the number of nops we have to insert is fixed at this point, we
can try to minimize the number of nops executed at runtime by replacing
nops encoded in instructions by standalone nops. That is, if this pass
has to insert one nop, it will try to make one of the following
replacements:
- (rptN)nop -> (rptN-1)nop; nop
- (nopN)foo -> (nopN-1)foo; nop

It does so by keeping track of "insert points". Each insert point keeps
track of the instruction and the maximum number of nops that can be
inserted there without pushing any subsequent alias sequences over the
next cache line. Whenever we need to insert nops, we first try it at the
encountered insert points and only if that doesn't work, we insert them
right before the first alias. The pass makes sure the insert points are
only visited a bounded number of times in total to keep the whole pass
O(n).

Totals:
Instrs: 48207402 -> 48278230 (+0.15%)
CodeSize: 101907026 -> 102294524 (+0.38%)
NOPs: 8386320 -> 8457148 (+0.84%)
(ss)-stall: 4013046 -> 4012931 (-0.00%)
(sy)-stall: 16741190 -> 16741033 (-0.00%)
Preamble Instrs: 11506988 -> 11520671 (+0.12%)
Last helper: 11686328 -> 11701615 (+0.13%)
Cat0: 9241457 -> 9312285 (+0.77%)

Totals from 25237 (15.32% of 164705) affected shaders:
Instrs: 22172360 -> 22243188 (+0.32%)
CodeSize: 44372164 -> 44759662 (+0.87%)
NOPs: 4201698 -> 4272526 (+1.69%)
(ss)-stall: 1982473 -> 1982358 (-0.01%)
(sy)-stall: 7379552 -> 7379395 (-0.00%)
Preamble Instrs: 4552074 -> 4565757 (+0.30%)
Last helper: 6260280 -> 6275567 (+0.24%)
Cat0: 4616677 -> 4687505 (+1.53%)

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36639>
2025-08-11 17:07:10 +00:00
Eric Engestrom
b24709960d ci: move setting python path for structured_logger.py to where it's actually used
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36685>
2025-08-11 16:36:45 +00:00
Eric Engestrom
2161b47d3f ci/init-stage2: drop no-op "copy python path into python path"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36685>
2025-08-11 16:36:45 +00:00
Eric Engestrom
aef01d73d8 ci: uprev vkd3d
Fixes all the workgraph failures, but also introduces two new failures
for lavapipe.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36712>
2025-08-11 15:57:35 +00:00
Corentin Noël
de55edade7 docs/features: Add missing llvmpipe extensions
Also mark GL 4.6, GLSL 4.60 as all DONE for llvmpipe.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36721>
2025-08-11 15:52:38 +00:00
Erik Faye-Lund
657080fe59 nvk: drop some needless definitions and deps
We already have these two:
- dep_android comes from vulkan_lite_runtime_deps, through
  idep_vulkan_runtime.
- VK_USE_PLATFORM_ANDROID_KHR comes from idep_vulkan_wsi_defines,
  through idep_vulkan_runtime.

So let's remove these two, as they don't really add anything new.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36716>
2025-08-11 15:35:24 +00:00
Aleksi Sapon
3bd0badd3a util: SWAP macro implementation for older MSVC versions
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36682>
2025-08-11 13:50:02 +00:00
Erik Faye-Lund
fe42a3d0eb meson/util: properly detect sysconf
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
There's two functions that use sysconf(), and they don't seem to agree
on what combination of platforms supports the function. Let's perform
proper function detection instead.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36621>
2025-08-11 12:30:23 +00:00
Erik Faye-Lund
e636991c78 prefer _SC_PAGESIZE over _SC_PAGE_SIZE
The POSIX spec says that_SC_PAGE_SIZE is a synonym for _SC_PAGESIZE, and
both will have the same value. Let's be consistent in which one we use,
and let's use the one that points directly to the authoritative
documentation.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36621>
2025-08-11 12:30:23 +00:00
Erik Faye-Lund
590ad7fd42 winsys/radeon: use util_get_cpu_caps()-helper
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36621>
2025-08-11 12:30:22 +00:00
Erik Faye-Lund
91232524bf winsys/radeon: use os_get_page_size and error-check
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36621>
2025-08-11 12:30:22 +00:00
Erik Faye-Lund
ad3445b6df panfrost: use os_get_page_size()
We have an abstraction for this, let's use it to try and keep the code
as portable as possible.

Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36621>
2025-08-11 12:30:22 +00:00
Erik Faye-Lund
44bc8557ae iris: use os_get_total_physical_memory instead of open-coding
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36621>
2025-08-11 12:30:22 +00:00
Erik Faye-Lund
2213a76c0a crocus: use os_get_total_physical_memory instead of open-coding
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36621>
2025-08-11 12:30:22 +00:00
Mary Guillemard
c5c196e6d5 pan/bi: Revamp bi_optimize_nir
This reorder things a bit, ensure we attempt more agressive vectorisation,
attempt to optimize cf and more.

Inspiration from NAK's optimize_nir function.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
ef7095c85b pan/bi: Handle needless conversions in nir_lower_bool_to_bitsize
We can end up with conversion instructions to the same type of integer
with nir_lower_bool_to_bitsize so let's make
bifrost_nir_lower_algebraic_late handle those cases.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
9ec1bb0111 pan/bi: Vectorize UBOs load/store
We can benifit from it, let's allow it when we aren't forced to follow
robustness2.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
b4ce8998d7 pan/bi: Switch to nir_lower_alu_width
Embrace modernity and consistency between alu and vectorization passes.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
0c7aaa7aad panvk: Call nir_opt_access
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:56 +00:00
Lionel Landwerlin
3d85580779 anv: subclass vk_pipeline
We'll have to handle RT pipelines inside of Anv because the runtime
doesn't have support for that.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36711>
2025-08-11 11:14:53 +00:00
Lionel Landwerlin
44aaf88425 anv: rework gfx state emission (again)
Previously we had 2 stages :

  runtime -> precomputed values -> packing/emission

With this change we use 3 stages :

   runtime -> precomputed values -> packing -> emission

Now blorp & other changes to the pipeline should not retrigger
repacking of instructions.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36711>
2025-08-11 11:14:53 +00:00
Lionel Landwerlin
5a2fb0da32 anv: actually use the COMPUTE_WALKER_BODY prepacked field
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36711>
2025-08-11 11:14:52 +00:00