Commit graph

200653 commits

Author SHA1 Message Date
Konstantin Seurer
01ec2f59a4 nir/print: Do not print trailing spaces after preds/succs
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32644>
2025-01-18 11:02:25 +00:00
Konstantin Seurer
6ddd791d6b nir: Add a test runner
The test runner can automatically update reference shaders when the
result changes.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32644>
2025-01-18 11:02:25 +00:00
Konstantin Seurer
eb3ab68e5e nir/tests: Add reference shaders
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32644>
2025-01-18 11:02:25 +00:00
Konstantin Seurer
8838a0c595 nir/tests: Add a helper for comparing a shader against a string
This allows unit tests to compare against a reference nir shader instead
of implementing checks for interesting instructions/CF nodes.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32644>
2025-01-18 11:02:25 +00:00
Konstantin Seurer
6d1d15183f nir/tests: Improve shader creation
Sets some fields so they are not printed and allows specifying a stage.
This decreases the size of reference shaders.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32644>
2025-01-18 11:02:25 +00:00
Konstantin Seurer
305be9cf5e nir/print: Print less unused shader info
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32644>
2025-01-18 11:02:25 +00:00
Caio Oliveira
94fa449318 intel/brw: Add missing cases to flags_written()
These virtual opcodes will write the whole flag set, either directly
(via brw_fill_flag()) or indirectly by using LOAD_LIVE_CHANNELS.

Issue was found when analysing a hang that would disappear
if the lowering of those opcodes was pulled all the way up
right before brw_opt_cmod_propagation (which uses the
flags_written).

Fixes: 019770f026 ("intel/brw: Add SHADER_OPCODE_VOTE_*")
Fixes: 2bd7592b0b ("intel/brw: Add SHADER_OPCODE_BALLOT")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12347
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12479
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33085>
2025-01-18 05:30:23 +00:00
Samuel Pitoiset
0a4584a684 radv: bump maxViewportDimensions to 32K on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33064>
2025-01-17 21:10:23 +00:00
Mike Blumenkrantz
3d7d303dc5 zink: enable maintenance8
this avoids validation errors from 3d<->2d blits

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33102>
2025-01-17 20:46:43 +00:00
Mike Blumenkrantz
0d29ddb328 lavapipe: maintenance8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33098>
2025-01-17 19:41:45 +00:00
Mike Blumenkrantz
c285a2a354 lavapipe: support zs<->color copies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33098>
2025-01-17 19:41:45 +00:00
Mike Blumenkrantz
00d478d96d lavapipe: abort on unsupported depth copy ops
better than silently failing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33098>
2025-01-17 19:41:45 +00:00
Mike Blumenkrantz
7e8c13ea64 lavapipe: fix 3D->2D blitting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33098>
2025-01-17 19:41:45 +00:00
Samuel Pitoiset
2ba91d1deb radv: promote VK_EXT_depth_clamp_zero_one to KHR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33090>
2025-01-17 19:02:02 +00:00
Lionel Landwerlin
f96e95fcc9 anv: remove print lowering
This is handled by the back compiler.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:46 +00:00
Lionel Landwerlin
e1074f5bd4 anv: update debug printf example code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Lionel Landwerlin
2603dbd796 nir: make lower-level printf helper respect buffer size
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Lionel Landwerlin
58a3ef4160 anv: handle printf buffer size relocations
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Lionel Landwerlin
d63b5fc8c5 brw: handle load_printf_buffer_size intrinsic
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
c1e685bfe9 util,vulkan,asahi,hk: hash format strings
flag day change to use the new infra. as-is this is a bit pointless, but it
unblocks the new bindgen work.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
43e79b26de nir/lower_printf: drop static buffer addr lowering
no longer used, replaced by the new pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
c4bd2e691b agx: defer printf address lowering
this will be needed with vtn_bindgen2

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
07ad850787 nir: add nir_lower_printf_buffer pass
this is a helper for lowering the printf buffer intrinsics to constants for
backend convenience.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
7bc9bbcc6e nir/lower_printf: support dynamic buffer size
this is required for vtn_bindgen2 where we don't know the buffer size until
the driver-specific code paths, but we need to lower printf (to hash format
strings) in common code. so defer the buffer size decision to an intrinsic.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
6db9218ec3 nir/lower_printf: add option to hash format strings
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
dd66287e63 util/u_printf: allow printing from singleton
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
007f60c8b8 util/u_printf: add singleton implementation
Currently, nir_lower_printf depends on a per-nir_shader table, writing out
indices into the printf buffer. This works for real OpenCL implementations
(rusticl, microsoft) which can associate the printf buffer with a particular
kernel, I guess. (Actually it's not clear to me that it works well there either
but that's not my problem.)

This mechanism is unsuitable for internal driver shaders, where printfs with
unique format strings can come from many different nir_shaders. There are two
current solutions in tree to this for driver CL:

* Honeykrisp: Only use one single nir_shader (libagx). This prevents us from
  using printf in common CL and requires extra driver tracking. It won't work
  with my upcoming vtn_bindgen rework, which is why I'm addressing this now.

* Anv: Offset format-string indices by a dynamic "base identifier" using relocs
  or a push constant, then pool format strings into a table from nir_shader's
  across the device. The problem here is that these indices now depend on the
  order that nir_shaders are seen (which causes a mess for caching if relocs are
  used, or requires extra push constants and extra bookkeping if relocs aren't
  used). And the driver tracking required to do this pooling correctly is even
  more complicated than what Honeykrisp does. I do not want every driver in-tree
  needing to go down this path, and it wouldn't work with my upcoming
  vtn_bindgen.

This MR introduces an alternate approach: rather than writing indices into the
table, we instead hash the format string itself and write the hash. That doesn't
depend on what nir_shader we came from, so we can freely mix & match and get
consistent hashes. That greatly alleviates driver tracking burden. To make that
possible, we need a global hash table mapping hashed format identifiers to the
format strings themselves.

That approach still requires a step to "register" format strings into the table.
That step would not be required if we wrote the actual strings themselves into
the table, but that was ruled out for performance/code size reasons. However, we
do not want drivers to need to explicitly register all the strings they use,
because once we have OpenCL in common code via vtn_bindgen2, drivers won't know
all the strings they use. Fortunately, there's a neat solution for that too.

By making this global table a singleton (with internal locking), vtn_bindgen2
can automatically register format strings via a static constructor. In
conjunction with the infrastructure added here, that eliminates all driver
bookkeeping required for format-strings.

The code itself is inspired by the glsl type singleton. Is it pretty? Not
really, but it gets the job done well.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
48dbfba17a util: add u_printf_hash helper
for hash-based printf. this just shells out to XXH - convenience wrapper.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
e1368f0a30 nir,util: move printf serializing into util
there's nothing NIR specific here and these routines will be useful otherwise.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
47e16cab5e nir/lower_printf: drop default max buffer size
no uses and it doesn't make sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
621ff262bc nir/lower_printf: drop null check
we derefernce options above.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Alyssa Rosenzweig
e7a1d704d0 intel: set max_buffer_size to nir_lower_printf
instead of relying on an implicit value which doesn't make much sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33067>
2025-01-17 18:09:45 +00:00
Gurchetan Singh
61d66a6ea7 gfxstream: fix some integration bugs
- Fix end2end test target (AOSP-only)
- Fix decoder to use host vk_util.h, not guest
- typo fixes

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33077>
2025-01-17 17:26:45 +00:00
Samuel Pitoiset
78f5dfca86 vulkan: Update XML and headers to 1.4.305
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33089>
2025-01-17 16:42:27 +00:00
Mike Blumenkrantz
667745857d lavapipe: handle VK_REMAINING_ARRAY_LAYERS with HIC
this otherwise goes oob and crashes

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33071>
2025-01-17 15:35:09 +00:00
Lu Yao
7679102b45 zink: fix decomposed_attrs val error when zink_vs_key->size is 4
decomposed_attrs and decomposed_attrs_without_w should get from vs->u32
when zink_vs_key->size is 4.

Fixes: 19fbdb9064 ("zink: move shader keys to be persistent on pipeline state")
Signed-off-by: Lu Yao <yaolu@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33079>
2025-01-17 14:51:49 +00:00
Karol Herbst
0b6446efe2 rusticl/mem: use get_res_for_access instead of get_res_of_dev
Fixes multi-device cl_mem support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32581>
2025-01-17 14:09:39 +00:00
Karol Herbst
2c2c06b93e rusticl/mem: add Allocation::is_user_alloc_for_dev
get_res_of_dev will entirely be reworked, but there is one user only
wanting to know if the allocation is a user_ptr one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32581>
2025-01-17 14:09:39 +00:00
Karol Herbst
de8b2f108e rusticl/mem: rework last user of get_parent() and remove it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32581>
2025-01-17 14:09:39 +00:00
Karol Herbst
944f47f103 rusticl/mem: reimplement has_same_parent and rename it to backing_memory_eq
We actually want to know if the backing memory is the same, it's also
easier to implement than checking on the parent memory object.

This will also allow for more flexibility if more memory types are
supported, e.g. proper SVM allocations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32581>
2025-01-17 14:09:39 +00:00
Karol Herbst
787d3b0ffc rusticl/mem: add Allocation type
This will handle the raw memory operations in the future, mostly focused
on guaranteeing consistency across devices.

It also handles sub allocation because it is the better place of tracking
this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32581>
2025-01-17 14:09:38 +00:00
Karol Herbst
e118fb6492 rusticl/mem: simplify is_svm implementation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32581>
2025-01-17 14:09:38 +00:00
Karol Herbst
e74ad38204 rusticl/device: add unsynchronized mapping functions to helper context
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32581>
2025-01-17 14:09:38 +00:00
Zan Dobersek
0cf29bf0ce freedreno/a7xx: fix fd_lrzfc_layout
Various vkd3d-proton tests run via Turnip exposed an issue with the
a7xx-specific instantiation of the fd_lrzfc_layout struct used to allocate
memory for LRZ fast-clear operations.

The correct layout is quite bigger in size, and the duplicated FC buffers
are positioned at the beginning and the end of it. Smaller part of the area
in the middle is used for metadata, but it already seems to be used more
extensively than how we currently understand it.

Fixes in vkd3d-proton on tu/a750:
  test_clear_depth_stencil_view
  test_copy_texture
  test_early_depth_stencil_tests

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33080>
2025-01-17 13:32:38 +00:00
Caleb Callaway
aae9a2c399 docs: clarify ASPM performance tips
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33052>
2025-01-17 13:21:38 +00:00
Valentine Burley
de6f654b60 pan/ci: Document some flakes
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33086>
2025-01-17 12:50:20 +00:00
Erik Faye-Lund
90d5366b2a pan/ci: drop empty trailing variables-list
This job is somehow failing to expand $RUNNER_TAG, and it seems to have
happened around the time that the last entry from the variables list was
removed.

Let's remove this, it's no longer needed anyway. And it seems to fix the
problem, so yay.

Fixes: 61d9c47944 ("ci/lava: Use CI_JOB_TIMEOUT instead of separate variable")
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33086>
2025-01-17 12:50:20 +00:00
Vignesh Raman
3f8046fd3e ci: export RESULTS_DIR in crosvm-script.sh
Export the RESULTS_DIR environment variable in crosvm-script.sh
to ensure it points to the correct directory. Without this,
artifacts are not generated because the results directory is
created in the wrong location after the directory changes in the VM.

Also fix https://www.shellcheck.net/wiki/SC2129 shellcheck error.

Suggested-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Reviewed-by: Eric Engestrom <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33023>
2025-01-17 12:08:49 +00:00
Erik Faye-Lund
2f168fe92c docs/features: mark panfrost as supporting GL_OES_texture_view
We've been supporting this for a while, let's make sure it's documented
correctly.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33057>
2025-01-17 12:00:14 +00:00
Erik Faye-Lund
1e8a017de3 docs/features: add a few missing extensions
Here's a few extensions we've forgotten to report in features.txt

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33057>
2025-01-17 12:00:14 +00:00