Commit Graph

194434 Commits

Author SHA1 Message Date
Qiang Yu e24082cfe0 mesa: count mesh shader when init limits
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:45 +00:00
Qiang Yu 13312c12fb mesa: set a more accurate value for combined limits
Program can only contain either graphics shaders or compute
shader. So these limits should use a MAX2 for different
shader pipeline.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:44 +00:00
Qiang Yu 5f1983f346 glsl,gallium,mesa: replace MESA_SHADER_STAGES with MESA_SHADER_MESH_STAGES
Prepare for mesh shader support, change all shared code to
use MESA_SHADER_MESH_STAGES.

Use command:
  find src/gallium/auxiliary/ -type f -not -path '*/.git/*' -exec sed -i 's/\bMESA_SHADER_STAGES\b/MESA_SHADER_MESH_STAGES/g' {} +
  find src/compiler -type f -not -path '*/.git/*' -exec sed -i 's/\bMESA_SHADER_STAGES\b/MESA_SHADER_MESH_STAGES/g' {} +
  find src/mesa -type f -not -path '*/.git/*' -exec sed -i 's/\bMESA_SHADER_STAGES\b/MESA_SHADER_MESH_STAGES/g' {} +

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:44 +00:00
Qiang Yu fba8bddc4f mesa: init program constants for mesh shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:43 +00:00
Qiang Yu 4ce6448f2a mesa: enlarge the shader resourse limits for mesh shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:43 +00:00
Qiang Yu 4b8c63e211 gallium/dd: enlarge shader string for mesh shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:42 +00:00
Qiang Yu 4aa2510bc0 radeonsi: do not init nir_options for mesh shader
nir_options array include mesh shader, radeonsi does not
support mesh shader at this point.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:42 +00:00
Qiang Yu d42936c6a7 compiler: adjust comments for mesa_shader_stage
We're going to support mesh shader in GL, the stage order
is not sorted as comment described.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:42 +00:00
Qiang Yu 08b643f244 mesa/st: use shader_caps.max_instructions to check shader present
It's documented cap for shader presentation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:42 +00:00
Qiang Yu e697b9119e mesa,gallium: remove tgsi_processor_to_shader_stage
It just pass though the input.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:42 +00:00
Qiang Yu aebf0abbf1 gallium: add mesh shader caps
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36596>
2025-08-11 01:44:41 +00:00
Yiwei Zhang d88fd2c582 vulkan/wsi/headless: clean up headless wsi device and headers
Still keep the wsi_headless container in case of future customizations.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36687>
2025-08-10 07:16:46 +00:00
Yiwei Zhang 90caf9bdbd vulkan/wsi/headless: drop the wsi_create_null_image_mem override
The existing wsi code paths work in the most correct manner now w.r.t
implicit fencing, memory allocation, prime buffer blit, etc.

With this and the prior change, ANV with headless doubled the perf and
beats the windowed vkmark run.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36687>
2025-08-10 07:16:46 +00:00
Yiwei Zhang 6ac8ac38f1 vulkan/wsi/headless: acquire the most likely idle image
Previously the present marks the image free, and the next acquire would
immediately acquire the just presented image back, which likely still
has pending gpu work going on. To avoid introducing a present queue in
headless, we simply tweak to acquire swapchain images in a loop to give
the app the most likely idle image.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36687>
2025-08-10 07:16:46 +00:00
Yonggang Luo 826c7fec4b gallium/mesa: Change type of tgsi_shader_info::processor st_init_limits::sh to mesa_shader_stage
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36698>
2025-08-10 06:09:49 +00:00
Yonggang Luo 5a93e94d83 gallium: Remove unused TRACE_FLAG_USER_BUFFER
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36698>
2025-08-10 06:09:49 +00:00
Yonggang Luo a5522142f8 broadcom: gl_shader_stage_to_broadcom => mesa_shader_stage_to_broadcom
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36698>
2025-08-10 06:09:49 +00:00
Olivia Lee c11f47481a panvk: stop CPU mapping all index buffers on JM
This can be removed now that we do compute shader minmax. Fixes failed
mmap errors on PPSSPP and some other vulkan applications:

MESA: error: mmap(..., size=4194304, prot=2, flags=0x1) failed: Invalid argument

Fixes: e25064c026 ("panvk: Use indirect path for indexed draw on JM")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36695>
2025-08-09 01:21:43 -07:00
llyyr dbb779967c vulkan: Update enum_to_str conversion to handle AMDX enum names
Without this, mesa fails to build with:
src/vulkan/util/vk_enum_to_str.c:684:14: error:
‘VK_COMPRESSED_TRIANGLE_FORMAT_AMDX_MAX_ENUM’ undeclared (first use in
this function); did you mean
‘VK_COMPRESSED_TRIANGLE_FORMAT_MAX_ENUM_AMDX’?

Fixes: c74ad9f142 ("vulkan: Update headers/xml for 1.4.325")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36693>
2025-08-09 01:24:10 +00:00
Yiwei Zhang c58b3fa3a4 venus: fix a race condition in ring shmem reuse
With the shmem cache, vkDestroyRingMESA must be a synchronous call to
ensure renderer side ring destruction has finished before the same shmem
gets reused by other things.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13672
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36664>
2025-08-09 00:24:28 +00:00
Faith Ekstrand 65f3d7fb7f nvk: Advertise KHR_shader_untyped_pointers
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36681>
2025-08-08 22:41:15 +00:00
Caio Oliveira e8fe6273f9 anv: Advertise VK_KHR_shader_untyped_pointers
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36681>
2025-08-08 22:41:15 +00:00
Caio Oliveira c74ad9f142 vulkan: Update headers/xml for 1.4.325
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36681>
2025-08-08 22:41:14 +00:00
Caio Oliveira c00b167d16 vulkan: Update enum_to_str conversion to handle ARM enum names
Next Vulkan update will have
VK_DATA_GRAPH_PIPELINE_PROPERTY_MAX_ENUM_ARM and similar names,
so apply the same rule for ARM prefix.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36681>
2025-08-08 22:41:14 +00:00
Caio Oliveira 12cdcccf24 spirv: Update headers and metadata from latest Khronos commit
This corresponds to a7361efd139bf65de0e86d43b01b01e0b34d387f
("Fixed typo in operand name of OpSubgroupAvcImeSetDualReferenceINTEL (#537)")
in https://github.com/KhronosGroup/SPIRV-Headers.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36681>
2025-08-08 22:41:14 +00:00
Kenneth Graunke 5e9de5317e brw: Validate that send payloads can't be imms or have source mods
To ensure we haven't missed resolving these things.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:11 +00:00
Kenneth Graunke 22165defb5 brw: Drop interlock and memory fence logical opcodes from is_payload()
These are lowered to sends prior to any callers of this helper.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:11 +00:00
Kenneth Graunke ed4fadbb16 brw: Drop INTERPOLATE_AT_* opcodes from is_payload()
These are lowered to sends prior to any callers of this helper.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:10 +00:00
Kenneth Graunke e2022017ce brw: Drop uniform pull constant load virtual opcode from is_send()
The logical send lowering already resolves sources when constructing
the send payload, so prior to that lowering, we don't need to apply
any special restrictions here.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:10 +00:00
Kenneth Graunke 9d5cd03ea8 brw: Drop interlock and memory fence logical opcodes from is_send()
The logical send lowering already resolves sources when constructing
the send payload, so prior to that lowering, we don't need to apply
any special restrictions here.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:09 +00:00
Kenneth Graunke 342ff81df0 brw: Drop INTERPOLATE_AT_* opcodes from is_send()
The goal here was to avoid propagating source modifiers, unusual
regions, and other things that couldn't be used as a send source.

A few patches ago ("brw: Properly resolve non-sendable sources in a few
logical opcodes") we fixed the logical send lowering to handle these
by resolving them when constructing the send payload.  So now prior
to lowering, we don't need to treat these opcodes specially.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:08 +00:00
Kenneth Graunke 47fe9d28e7 brw: Enumerate SHADER_OPCODE_SEND sources and standardize how many
This introduces enums for SHADER_OPCODE_SEND[_GATHER] sources, similar
similar to what we've done for most of the newer logical opcodes.  This
allows us to use actual names for sources rather than remembering their
order, or leaving ourselves comments like /* ex_desc */ all over.  It
will also make it easier to add or reorder sources in the future.

While we're at it, we also standardize on the number of sources.
Previously, we allowed SHADER_OPCODE_SEND to have either 3 (monosend) or
4 (split send) sources, but this is mostly for haphazard historical
reasons.  We now specify all sources every time, eliminating the need
for careful inst->source checks before accessing the last source.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:08 +00:00
Kenneth Graunke 00d38b980d brw: Properly resolve non-sendable sources in a few logical opcodes
Sources decorated with source modifiers, immediates, or particular
stride combinations may not be directly usable as SEND operands.  We
have to resolve them to an ordinary VGRF first.

Most opcodes do this as part of broader payload construction, but these
send directly because the messages are very simple.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:06 +00:00
Kenneth Graunke b848fa4595 brw: Rename is_send_from_grf to is_send, replace other is_send() helper
The is_send() helper is just a wrapper around inst->is_send_from_grf()
now, so we can combine the two.  Trim the name from is_send_from_grf()
to is_send(), as it's shorter, and also matches is_math().

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:05 +00:00
Kenneth Graunke e7d20bc86a brw: Drop inst->mlen check from is_send()
We used to have inst->mlen set on various virtual opcodes, but these
days the only instructions that should have inst->mlen set are
SHADER_OPCODE_SEND and SHADER_OPCODE_SEND_GATHER, which are already
covered in inst->is_send_from_grf().  So we don't need to check for mlen
specifically.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:05 +00:00
Kenneth Graunke 3c455c3532 brw: Stop using is_send_from_grf() in CSE pass
Explicitly list FS_OPCODE_INTERPOLATE_AT_* as allowed, as they were
already allowed by the default case.  Interlock, memory fence, and
barrier were disallowed and remain so.  Uniform pull constant load
was allowed and remains so.  SHADER_OPCODE_SEND and SEND_GATHER get
explicit handling.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:05 +00:00
Kenneth Graunke e5ed6f64d9 brw: Stop checking inst->is_send_from_grf() for g127 register hack
Every case but SHADER_OPCODE_SEND and SHADER_OPCODE_BARRIER will be
lowered to SEND before register allocation happens.  And the barrier
send has a null destination, so the restriction doesn't apply.

Note that this hack is for Gfx9 only, so we don't need to worry about
Xe3's SHADER_OPCODE_SEND_GATHER feature.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:05 +00:00
Kenneth Graunke b0eb90ddb1 brw: Assert that EOT is always SHADER_OPCODE_SEND on pre-Xe3
We used to have other opcodes as well, but we've since transitioned
entirely to logical send lowering prior to register allocation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:05 +00:00
Kenneth Graunke 90dbbc69bb brw: Use BAD_FILE instead of ARF null for second send payload
A number of places emit monolithic sends, where the second payload is
empty.  Some places were using a BAD_FILE register, while others were
specifying the hardware ARF null register.  Switch to BAD_FILE for
consistency - this is usually what we do for "source isn't present".

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34040>
2025-08-08 22:12:04 +00:00
Aleksi Sapon 9366968b40 meson: add missing x11 dependency on libloader_x11
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36683>
2025-08-08 21:45:59 +00:00
Eric Engestrom 05446eee25 lavapipe/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:46 +00:00
Eric Engestrom 33eff12590 llvmpipe/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:46 +00:00
Eric Engestrom fc1a56161e llvmpipe/ci: document fixed test
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:46 +00:00
Eric Engestrom 622257f4b9 zink+radv/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:46 +00:00
Eric Engestrom a1636dad43 radv/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:45 +00:00
Eric Engestrom d5473d0f19 radeonsi/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:45 +00:00
Eric Engestrom fb42ec3163 broadcom/ci: fix another slow & flaky CL test on rpi4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:45 +00:00
Eric Engestrom 5a4780e44a turnip/ci: document regression in 0a12ff6f...8fe0a347
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:45 +00:00
Eric Engestrom c64872ad56 r300/ci: document fixes tests and one regression in c64c6a0c...bf8ebb6a
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:45 +00:00
Eric Engestrom 6019ba7ee6 radeonsi/ci: document fixes test
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36684>
2025-08-08 21:27:45 +00:00