Commit graph

220995 commits

Author SHA1 Message Date
Jesse Natalie
6ffac15b31 wgl: Flush and wait when unbinding a context that references a swapchain
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40876>
2026-04-10 19:37:58 +00:00
Mel Henning
ad65ed643b nvk: SET_ROOT_TABLE_PREFETCH
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:39 +00:00
Mel Henning
30b3de6ec4 nvk: Wire up ROOT_TABLE
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/12576
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:39 +00:00
Mel Henning
bff2d8dd9b nvk: Move mme_set_anti_alias_tests to a check func
This is more flexible than the expected array and will be necessary in
the following patches.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:38 +00:00
Mel Henning
26c00f6e17 nvk/cmd_indirect: Pass pdev into more functions
This will be used for checking if root table is enabled.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
701a2579fe nak: Add printf_cb to nak_constant_offset_info
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
aa782218e5 nak: Add an is_graphics param to nak_const_offsets
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
017bb885db nak: Turn nak_const_offsets into a function.
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
7fc8fdbdaf nvk: Factor out build_push_write_push_const
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
3b4b72f546 nvk: Reorder nvk_root_descriptor_table
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
18fcf24547 nvk: Initialize NVC597_SET_ROOT_TABLE_VISIBILITY
This matches the initialization I've seen in traces from the proprietary
driver.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
398837aa58 nvk: Swizzle root_table.dynamic_buffers[]
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
54b41565a0 nvk: Rename macro loop index from i to _index
Calling this varaible `i` made it very easy for it to shadow a loop
variable in the enclosing scope, which became an issue if `src` were an
expression referencing a different variable `i`. Rename the variable to
make shadowing less likely.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
3476b34f63 nvk/lower_descriptors: Change ROOT_DESC addr space
The more general address space we used to have cannot be
implemented on top of ROOT_TABLE because of ROOT_TABLE's bank pattern.
Instead, adjust the address space so it provides a less general index
into dynamic_buffers.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:37 +00:00
Mel Henning
e53036c85a nvk/lower_descriptors: Add load_root_table_array()
This is a helper function for loading from an index of an array member
of root_table.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:36 +00:00
Mel Henning
5d90bbe8e5 nvk/lower_descriptors: .base in load_root_table
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:36 +00:00
Mel Henning
4bdbd6c341 nvk/lower_descriptors: Use more load_root_table
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:36 +00:00
Mel Henning
153454a6fd nvk/lower_descriptors: Move load_root_table up
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40639>
2026-04-10 19:21:36 +00:00
Alyssa Rosenzweig
fc00e2c815 anv: wire up jay
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
c96762ad57 iris: wire up jay
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
e42e319313 intel: add Jay
Jay is a new SSA-based compiler for Intel GPUs. This is an early
work-in-progress. It isn't ready to ship, but we'd like to move development in
tree rather than rebasing the world every week. Please don't bother testing yet
- we know the status and we're working on it!

Jay's design is similar to other modern NIR backends, particularly ACO, NAK and
AGX. It is fully SSA, deconstructing phis after RA. We use a Colombet register
allocator similar to NAK, allowing us to handle Intel's complex register
regioning restrictions in a straightforward way. Spilling logical registers is
straightforward with Braun-Hack.

Thanks to the SSA-based design, the entire backend is essentially linear time,
regardless of register pressure, addressing brw's excessive compile time when
especially spilling with brw.

In this current early draft, we support a limited subset of all three APIs on
Xe2. A lot works and a lot doesn't. The core compiler is there (spilling,
scoreboarding, SIMD32, etc should more or less work), but there are details to
fill in for both performance and correctness. We essentially pass conformance on
OpenGL ES 3.0 and OpenCL 3.0, and we're busy iterating on Vulkan.

Likewise, additional hardware support will come down the line. There's nothing
fundamentally Xe2-specific here. I just have a Lunarlake laptop on my desk, Ken
has a Battlemage card, and we had to pick _something_ as the first target.

Co-authored-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Kenneth Graunke
7468261d3d intel/nir: Make intel_nir_lower_sparse work for either brw or jay
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
5c4cae2661 brw: lower ifind_msb for Jay
I'm not sure brw wants the common lowering but Jay definitely does.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
3afd572d8f brw: add Jay-specific SIMD selection rule
In the future this might even do something clever.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
f33454e35a brw: disable nir_opt_uniform_atomics for Jay
While Jay supports subgroups, efficient reductions are TODO so it's probably
better not to run this pass yet.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
4778fc1ab7 brw: disable hw generate local ID for jay
Jay will need more work to handle these payloads properly especially in SIMD32.
For now just disable the optimization for Jay for correctness.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
e8b9f26561 brw: subgroup lowering for jay
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Kenneth Graunke
2780a327fa intel: add INTEL_JAY environment variable
Add a new environment variable controlling which shader stages use the
experimental compiler.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
4356ad1bf5 nir: add pixel_coord_intel
This is a 2x16 bitpacked version of load_pixel_coord which maps directly to the
hardware value and is much easier for Jay to consume due to the sadness that is
true 16-bit on Intel. Jay will lower to this internally.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
bd6d210386 nir: add shuffle_intel
Jay will use this to lower & optimize subgroup shuffles. This is closer to
how Intel hardware works but still much higher level than the hardware
primitive. This gets us NIR optimizations on the multiply however.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
b840b178af nir: add Intel RT write intrinsic
This exposes the underlying render target write message directly, which Jay will
use to lower RT writes in NIR. I'm still on the fence about what exactly this
should look like but this is good enough for GLES3.0 (so, multiple render
targets but not necessarily dual source blending).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Alyssa Rosenzweig
566047222e nir: add frag_coord_w_rcp intrinsic
This maps directly to what Intel's thread payload gives us, allowing us to
optimize out frcp's in some cases. Jay will use this.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Kenneth Graunke
09089fdd13 nir: Add nir_texop_sparse_residency[_txf]_intel operations
These lowered versions map to what Jay can deal with. The hardware is more
flexible but we're not due to data model restrictions. We choose to lower to get
us off the ground, we can revisit later.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40835>
2026-04-10 18:21:21 +00:00
Pavel Ondračka
79e3196320 gallium/u_blitter: remove unused CONST declaration when using IMM
The immediate fs_clear_color shader uses IMM[0] but still declares
CONST[0][0]. That can make drivers try to read a fragment constant
buffer even though one is never uploaded on this path. Only declare
CONST[0][0] when the shader actually uses a constant buffer.

Fixes: 2ff9fa8b72 ("gallium/u_blitter: add a new fs_color_clear variant")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40760>
2026-04-10 17:50:23 +00:00
David Rosca
33ab9087c8 radv/video: Remove unused function radv_vcn_sq_start
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Not used since 19a8b7121e ("radv/video: Remove old VCN and UVD decode implementation")

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40888>
2026-04-10 17:24:56 +00:00
Pavel Ondračka
5aa4bdc8e7 r300: fix BE CBZB clears for swapped 8888 formats
On big-endian hosts, r300 handles A8R8G8B8 and X8R8G8B8 by using
DWORD swap and programming component order as the matching B8G8R8A8 or
B8G8R8X8 formats. Reuse the same mapping when packing CBZB clear colors.

Fixes the bad lower-screen colors in Extreme TuxRacer on RV350.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40885>
2026-04-10 17:01:51 +00:00
Pavel Ondračka
c52bc90076 r300: fix BE 32-bit CBZB clear values
CBZB clears use ZB_DEPTHCLEARVALUE for the clear color. On big-endian
hosts the 32-bit payload needs little-endian byte order.

Fixes fast_color_clear/all-colors on RV350.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40885>
2026-04-10 17:01:50 +00:00
Raviraj Uppal
c5423d3e27 ac/nir: Fixed OpenGL CTS transform feedback overflow detection test case
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The ordered atomic commits the post-add offset to memory, but overflow was computed using the pre-add offset, causing partial overflows to be missed and counters to become corrupted.

Fixes: "KHR-GL46.transform_feedback_overflow_query_ARB.multiple-streams-one-buffer-per-stream" based on the postwrite buffer offset, rather than the offset before the current workgroups writes.
Reviewed-by: Marek Olsak <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40745>
2026-04-10 15:43:21 +00:00
Boris Brezillon
f76e940fb2 pan/format: Advertise support for AFBC(16x16,sparse,split)
Some video decoders spit out AFBC(16x16,sparse,split) images. Advertise
support for this modifier so we can import such images.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40746>
2026-04-10 14:57:26 +00:00
Karmjit Mahil
718f90dd8c tu: Remove unecessary forward declaration
tu_queue.h is included so this isn't necessary.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:55:01 +00:00
Karmjit Mahil
0fcecb97f1 tu: Cleanup some includes
Remove unused includes or heavy includes (e.g. `tu_common.h`) when
we could have done with lighter ones.

iwyu was used to find these cases.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:55:01 +00:00
Karmjit Mahil
9429b474f6 tu: Reorder includes
These follow our clang-format style now.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:55:01 +00:00
Karmjit Mahil
ef0de29292 tu: Update .clang-format include categories
Add missing folder patterns, and make the `^<vulkan/` pattern
apply to system includes too, so that all system includes are
in one group.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:55:00 +00:00
Karmjit Mahil
3c9ce4fdbc tu: Undef before redefining MESA_LOG_TAG
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:55:00 +00:00
Karmjit Mahil
bd66b7bc01 tu: Use "nir/" for the nir includes
This is to match the pattern used in our clang-format file

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:55:00 +00:00
Karmjit Mahil
cd299b433e freedreno: Add check_xml_includes to meson setup
This avoids wasting CI time by catching the error early. We do
still need the meson test to catch these issues locally when
rebuilding from an already configured build directory though.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:54:59 +00:00
Karmjit Mahil
1208d84f3c freedreno: Add check_xml_includes test
Add a test to ensure that we're always using one of the wrapper
files instead of including the XML generated headers directly.

Assisted-by: Opencode (MiniMax M2.7)
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:54:59 +00:00
Karmjit Mahil
396201a9ab freedreno: Add fd{2,3,4,5}_hw.h and fd_hw_common.h
Add some wrapper header files so that we always include everything
that's needed by the generated header. This is in preparation for
setting up a script which enforces using these instead of importing
the xml generated headers directly.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:54:59 +00:00
Karmjit Mahil
35f6efac76 freedreno/a6xx: Add missing include to fd6_pack.h
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:54:59 +00:00
Karmjit Mahil
b6ddd10d21 freedreno/registers: Add some missing include in fd6_hw.h
The generated header can't be used stand-alone so add the includes
in fd6_hw.h

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40853>
2026-04-10 13:54:59 +00:00