Natalie Vock
0cb1fca8fa
nir: Use sparse bitset for liveness information
...
Some shaders, especially RTPSO shaders that have parts of the PSO
inlined, can become absolutely huge. Using a sparse bitset avoids
quadratic complexity in memory consumption for the liveness information.
This reduces peak memory usage in worst-case tests (hammering
compilation of many huge RTPSOs on 32 threads concurrently) by ~60%,
from 43GB to 18GB.
CPU time (seconds) differences for a workload with mostly small shaders:
Difference at 95.0% confidence
-5.27 +/- 1.08963
-0.88811% +/- 0.183626%
(Student's t, pooled s = 0.629735)
Peak resident set usage for the mostly-small workload:
Difference at 95.0% confidence
30809 +/- 13394.3
1.59276% +/- 0.69246%
(Student's t, pooled s = 7741.09)
CPU time for the heavy workload did not show any difference.
Co-authored-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37908 >
2025-11-06 21:34:33 +00:00
Natalie Vock
a8b75dd0f4
util: Add sparse bitset data structure
...
Useful for potentially huge bitsets that are expected to be mostly
filled with zeroes, reducing memory consumption by assuming bits being
zero by default (without wasting memory to store zeroes).
Co-authored-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37908 >
2025-11-06 21:34:33 +00:00
Natalie Vock
1920a99115
util/bitset: Wrap __size in braces
...
Otherwise funny things can happen with the < operator because of
precedence rules.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37908 >
2025-11-06 21:34:33 +00:00
Dylan Baker
12e22d5bc1
anv: prevent potential, but unlikely, overflow
...
The code in question multiplies `uint32_t`s together and assigns them to
a `uint64_t`. It seems rather unlikely at there would be an overflow,
but we might as well do the cast.
CID: 1649587
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38289 >
2025-11-06 21:07:11 +00:00
Dylan Baker
d5199b07d2
anv: assert that we don't overflow
...
Our exposed limits say we shouldn't be able to, but let's add an assert
in case something changes, and to help Coverity out.
CID: 1662103
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37583 >
2025-11-06 20:45:41 +00:00
Danylo Piliaiev
01cbd0f24a
tu: Fix renderpass-level tracepoints not showing up in binning
...
They should be cloned not only per-tile but also for binning IB.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38240 >
2025-11-06 19:05:49 +00:00
Danylo Piliaiev
c04e375588
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 >
2025-11-06 19:05:49 +00:00
Yiwei Zhang
4ec2a921d3
panvk: fix mem alloc size for VkBuffer backed by imported blob AHB
...
For AHB VkBuffer import, the allocationSize comes from the raw external
AHB props query and it can be larger than the underlying buffer memory
requirement. So we must respect the allocationSize for the actual mem
import to support mapping the whole AHB size, and the dedicated buffer
info has to be stripped to obey the spec.
Test: CtsNativeHardwareTestCases no longer crashes on debug build panvk
Fixes: 66bbd9eec8 ("panvk: implement AHB image deferred init and memory alloc")
Tested-by: Valentine Burley <valentine.burley@collabora.com >
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com >
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38274 >
2025-11-06 18:26:01 +00:00
Alyssa Rosenzweig
2d98d44e63
brw,elk: drop unused spirv->nir routines
...
Unused since switching to vtn_bindgen2.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com >
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38246 >
2025-11-06 17:47:41 +00:00
Emma Anholt
31a4a5ee8c
docs: Give more reproducible instructions for how to build the docs.
...
I routinely don't update the docs because the build (hawkmoth in
particular) is a pain. The prior instructions almost worked, except that
on Debian you need to use a venv (which is a good idea to do for py3-clang
as well for reproducibility, anyway), and the versions that were listed
didn't actually run any more due to a revoked dependency.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38266 >
2025-11-06 17:42:45 +00:00
Faith Ekstrand
4909af6bae
panvk: Advertise VK_KHR_pipeline_binary
...
Closes: https://gitlab.freedesktop.org/panfrost/mesa/-/issues/216
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38284 >
2025-11-06 11:33:55 -05:00
Faith Ekstrand
acd00c07f6
panvk: Initialize the disk cache earlier
...
We want to know whether or not we successfully initialized before
filling out physical device properties.
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38284 >
2025-11-06 11:33:55 -05:00
Aksel Hjerpbakk
bbe6fff677
panvk: include cmd stages for semaphores on submit
...
CTS regressed due to c2a6fb6419 not considering cmd stages for
signaling and waiting. Before this patch panvk did consider cmd stages,
but not semaphore stage masks.
With this fix we consider both which is what the spec requires
Fixes: c2a6fb6419 ("panvk: cull semaphores in unrelated subqueues")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com >
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38138 >
2025-11-06 15:57:22 +00:00
Faith Ekstrand
60ad7e8da2
nvk: Advertise VK_KHR_pipeline_binary
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:29 +00:00
Lionel Landwerlin
21aafaea16
anv: enable KHR_pipeline_binary support
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12802
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:29 +00:00
Faith Ekstrand
cb7df84430
vulkan/runtime: Add an environment variable to validate shader binaries
...
Setting MESA_VK_VALIDATE_SHADER_BINARIES will cause the shader code to
round-trip every shader through [de]serialize and only ever use the
deserialized version. This catches bugs where the driver may drop
things in the [de]serialization process. It also deserializes the new
shader again and compares it against the original to ensure that
deserialize -> serialize is idempotent.
Acked-by: Eric R. Smith <eric.smith@collabora.com >
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:29 +00:00
Faith Ekstrand
59a89cd762
vulkan/runtime: Add a vk_compile_shaders() helper
...
This is just a wrapper around ops->compile() for now but we'll extend it
in the next commit to add some validation.
Acked-by: Eric R. Smith <eric.smith@collabora.com >
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:29 +00:00
Lionel Landwerlin
5c47ac640b
vulkan/runtime: implement VK_KHR_pipeline_binary
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Co-Authored-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:28 +00:00
Lionel Landwerlin
2e42e03cec
vulkan/runtime: track imported stages
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:28 +00:00
Lionel Landwerlin
708cc72b11
vulkan/runtime: switch precomp shaders to blake3 hashes
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:27 +00:00
Lionel Landwerlin
e9c1947ed6
vulkan/runtime: use only blake3_hash to shader key
...
To match the VK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR of only 32B.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:26 +00:00
Lionel Landwerlin
e05a9b77b6
vulkan/runtime: split rt shaders hashing from compile
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:26 +00:00
Lionel Landwerlin
08ed1c3da2
vulkan/runtime: split graphics shaders hashing from compile
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:25 +00:00
Lionel Landwerlin
b2d6ead1ee
vulkan/runtime: split compute shader hashing from compile
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:24 +00:00
Faith Ekstrand
440e71bdbd
vulkan/runtime: Add a get_push_range_for_stage() helper
...
This is already duplicated a few times and we're about to duplicate it
more.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:23 +00:00
Lionel Landwerlin
9a5b0bbba4
vulkan/runtime: use stage flags to track valid stages
...
We'll want to have only hashes in vk_pipeline_stage so the
vk_pipeline_stage_is_null() helper won't work.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:23 +00:00
Lionel Landwerlin
8e93938c3f
vulkan/runtime: keep the set layouts on the stack until pipeline creation
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:21 +00:00
Lionel Landwerlin
ab0bcefab1
vulkan/runtime: split precomp shader hashing from precomp loading
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:21 +00:00
Lionel Landwerlin
cbc8ec2cc4
vulkan/runtime: drop blake3 hash on precomp shaders
...
In order to implement VK_KHR_pipeline_binary, we need to be able to
build hash from pipeline creation structures without looking at the
cache.
The blake3 hash on precomp shaders prevents that as its loading from
cache and potentially apply transformation to NIR.
Let's stick to the hash generated by vk_pipeline_hash_shader_stage(),
it does not look at NIR (except for internal shaders) and already hash
the same information :
* shader code (SPIR-V, identifier, hash)
* robustness state
* specialization constants
* pipeline flags
* entry point name
* subgroup information
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:20 +00:00
Lionel Landwerlin
6279645fed
vulkan/runtime: drop some geometry shader hashing
...
Following bc64ea2815 ("vulkan: fix shader linking with common
pipelines") we're always linking pre-rasterization shaders together
and the shader hashes are hashed together, so there is no point
hashing :
- a bitfield of active shaders
- merged tesselation information
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:19 +00:00
Lionel Landwerlin
fc6d17a290
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 >
2025-11-06 15:27:19 +00:00
Lionel Landwerlin
f56e118ecd
vulkan/runtime: split out partitioning logic
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36647 >
2025-11-06 15:27:18 +00:00
Faith Ekstrand
69d7fcd613
pan: Move point size and viewport lowering to postprocess
...
Panvk calls pan_preprocess_nir() from its preprocess hook that it hands
off to the Vulkan pipeline code. That hook gets called before we have
the opportunity to lower geometry shaders. This means that we get our
viewports lowered for the VS and then the geometry shader is trying to
work on lowered viewports, which is wrong. Instead, we want to lower
later and only apply the viewport transform in the shader that runs as
the hardware VS.
Reviewed-by: Olivia Lee <olivia.lee@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265 >
2025-11-06 14:57:32 +00:00
Faith Ekstrand
6c5f981ba8
pan/bi: Move lower_noperspective*() to postprocess()
...
Reviewed-by: Olivia Lee <olivia.lee@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265 >
2025-11-06 14:57:32 +00:00
Faith Ekstrand
0ccadf7a86
nir: Check the deref mode in lower_point_size()
...
This is more robust because it ensures that we only ever check the
location on something that we know is an outupt. Also, if it's an
output then we know (thanks, validation!) that it's a variable.
Reviewed-by: Olivia Lee <olivia.lee@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265 >
2025-11-06 14:57:31 +00:00
Faith Ekstrand
5ed35866c2
nir: Handle lowered I/O in lower_viewport_transform()
...
While we're here, make the variable handling a little more robust by
checking the deref mode before assuming there's a reachable variable.
Reviewed-by: Olivia Lee <olivia.lee@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265 >
2025-11-06 14:57:31 +00:00
Faith Ekstrand
949a4458ea
pan/bi: Call constant folding in postprocess()
...
The comment explicitly calls out pan_nir_lower_store_component(), which
is in a different function call so it's a bit weird to have it in the
caller. Also, we already do this in postprocess() on midgard so it
makes more sense to just move it into bifrost.
Reviewed-by: Olivia Lee <olivia.lee@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265 >
2025-11-06 14:57:31 +00:00
Faith Ekstrand
0fae56e100
pan: roll lower_texture() into postprocess()
...
Every caller of pan_shader_lower_texture() immediatly called
pan_shader_postprocess() and every caller of pan_shader_postprocess()
lowered textures except blend shaders and those don't texture anyway.
Reviewed-by: Olivia Lee <olivia.lee@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265 >
2025-11-06 14:57:30 +00:00
Samuel Pitoiset
dcb9ca1aa6
radv/ci: remove RADV_PERFTEST=video_encode,video_code for GFX6-7
...
It's not supported at all, so no need to force enable all video
extensions.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38280 >
2025-11-06 14:35:19 +00:00
Daniel Schürmann
f37bdd664d
amd/common: rename ac_fake_hw_db.h -> ac_surface_test.h
...
As the surface tests are the only user now.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:07 +00:00
Daniel Schürmann
7e0ba40264
radeonsi: use ac_null_device_create() when AMD_FORCE_FAMILY is set
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:07 +00:00
Daniel Schürmann
4d68056e83
radv: delete winsys/null/*
...
The null device works without winsys, and now can be found in
amd/common/ac_null_device.c.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:07 +00:00
Daniel Schürmann
7d6de8b17e
amd, radv: create null device without winsys
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:07 +00:00
Daniel Schürmann
04ebbc3c41
radv: remove radeon_winsys::get_chip_name() and use info->marketing_name directly
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:07 +00:00
Daniel Schürmann
797ddfe4d2
radv/device: return early in radv_CreateDevice() if creating a null device
...
Also reorder initialization, so that everything required for compilation
is done first.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:07 +00:00
Daniel Schürmann
23ef756496
radv/null_device: set more options which affect compilation
...
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:06 +00:00
Daniel Schürmann
4ad9fb9d2e
radv/null_device: don't attempt to upload shaders
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:06 +00:00
Daniel Schürmann
6c2d614412
radv: hash keep_executable_info into shader key rather than device cache key
...
for consistency.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:06 +00:00
Daniel Schürmann
5ef8930636
radv: skip shader cache if trap handler is enabled
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525 >
2025-11-06 13:53:06 +00:00
Jose Maria Casanova Crespo
a58db214bb
v3dv: Enable VK_FORMAT_B8G8R8A8_SNORM format
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38278 >
2025-11-06 13:34:53 +00:00