Commit graph

224438 commits

Author SHA1 Message Date
Rhys Perry
546442a751 radv: rework creation of traveral radv_shader_stage_key
It doesn't make sense to use a key from a random intersection shader.

fossil-db (gfx1201):
Totals from 3 (0.00% of 210263) affected shaders:
Instrs: 9728 -> 10024 (+3.04%)
CodeSize: 60140 -> 60012 (-0.21%)
Latency: 95724 -> 95905 (+0.19%)
InvThroughput: 15015 -> 15044 (+0.19%)
VALU: 2985 -> 2997 (+0.40%)
VMEM: 345 -> 429 (+24.35%)
VOPD: 307 -> 323 (+5.21%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:39 +00:00
Rhys Perry
fc02ffed24 radv: merge radv_shader_stage_key for combined ahit/isec shaders
This should be done if the any-hit enables robustness but the intersection
does not.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:39 +00:00
Rhys Perry
ec21d14a30 radv: make raytracing radv_shader_stage_key initialization per-shader
The traversal stage key is still a bit nonsense.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:39 +00:00
Rhys Perry
8dabaa50c5 radv: make raytracing radv_shader_stage_key array per-shader
It doesn't really make sense to make this per-mesa_shader_stage. Each
VkPipelineShaderStageCreateInfo can have different flags.

This is just a refactor at the moment. Actually letting them differ within
a mesa_shader_stage is for a later commit.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:39 +00:00
Rhys Perry
e5dfdfa1e0 radv: parse stats from binary in radv_parse_binary_debug_info
This is more appropriate, and can be done now that the function is called
in radv_shader_deserialize().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:38 +00:00
Rhys Perry
64b4cb001c radv: cache shader IR, asm and spir-v
This improves RADV_DEBUG=hang's pipeline.log when shader caching is not
disabled.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:38 +00:00
Rhys Perry
53e127e33b radv: add radv_shader_stage_key::keep_shader_arg_info
We're going to be caching args_string soon.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:38 +00:00
Rhys Perry
e2d834fde6 radv: simplify radv_declare_shader_args parameters
Instead of passing various fields from stage, just pass the entire object.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:37 +00:00
Rhys Perry
1ab613dc5b radv: don't create nir_string if dump_shader=true
NIR printing is done earlier without nir_string, so I don't know why this
was done.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:37 +00:00
Rhys Perry
52e37fba33 radv: move nir_debug_info from debug to key
It seems likely that this could affect compilation.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:36 +00:00
Rhys Perry
6df83703c9 radv: use radv_shader_stage_key::keep_{statistic,executable}_info more
No need to create these again and pass them around as parameters. These
functions already have plenty of those.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42175>
2026-06-16 15:35:36 +00:00
Samuel Pitoiset
9a2d7186eb vulkan: fix lowering untyped accel struct with descriptor heap
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It points to the heap variable.

This fixes
dEQP-VK.binding_model.descriptor_heap.basic.raygen.acceleration_structure_untyped.

Fixes: 20d11c59a4 ("vulkan: Add a lowering pass for descriptor heap mappings")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42252>
2026-06-16 15:12:33 +00:00
Samuel Pitoiset
ee5f548678 radv/amdgpu: fix padding by one VM page
This isn't intended to be used for sparse BOs and it was incorrect
anyways because flags isn't initialized, so it was only clearing the
original VA range, not including the padding. Since sparse is still
experimental on GFX6-7, let's just apply the workaround to non-sparse
BOs.

This fixes sparse support on VEGA10, since addc719ec2
("radv: workaround has_smem_partial_oob_access_bug").

Fixes: 10a5e5e4f3 ("radv/amdgpu: Add ability to pad BOs with a read-only VM page")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42245>
2026-06-16 14:37:17 +00:00
Samuel Pitoiset
d72d4666ba radv: fix REPLAYED shader arena blocks not being marked as holes on free
Because free_list is always NULL for REPLAYED arenas, freed blocks were
never passed to add_hole() and freelist.prev was still NULL. So,
adjacent blocks were never merged together and that caused a memleak
with unreachable blocks.

This fixes a memleak detected by ASAN in
dEQP-VK.ray_tracing_pipeline.pipeline_library.configurations.singlethreaded_compilation.s0_l11_check_capture_replay_handles
and similar tests.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42012>
2026-06-16 13:16:39 +00:00
Caius-Moldovan-img
44290e1899 nir: Fix trailing comment generation for variable naming
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Add semantic location check, because multiple variables can share same
component location.

Fixes: ea863c0c1c ("nir/print: Do not access invalid indices of load_uniform")

Signed-off-by: Caius Moldovan <caius.moldovan@imgtec.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42114>
2026-06-16 12:20:38 +00:00
Rhys Perry
1845e53865 ac/lower_global_access: combine multiple 32-bit offsets
fossil-db (gfx1201, dEQP-VK.compute.pipeline.cooperative_matrix.*):
Totals from 224 (13.80% of 1623) affected shaders:
Instrs: 16351 -> 13429 (-17.87%)
CodeSize: 100640 -> 84732 (-15.81%)
VGPRs: 4428 -> 3636 (-17.89%)
Latency: 171321 -> 166654 (-2.72%); split: -2.76%, +0.04%
InvThroughput: 13990 -> 11588 (-17.17%)
VClause: 453 -> 436 (-3.75%)
Copies: 1350 -> 1159 (-14.15%); split: -18.07%, +3.93%
PreSGPRs: 2010 -> 2084 (+3.68%)
PreVGPRs: 1888 -> 1586 (-16.00%)
VALU: 7066 -> 4648 (-34.22%)
SALU: 2432 -> 3004 (+23.52%)
VOPD: 20 -> 5 (-75.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41968>
2026-06-16 10:59:28 +00:00
Rhys Perry
2292109694 ac/lower_global_access: extract constants after ishl/imul
Extract constants from imul(iadd(a, #b), #c) or
imul(u2u64(iadd.nuw(a, #b)), #c). nir_opt_algebraic tries to make sure
those expressions don't appear, but it's not perfect.

fossil-db (gfx1201, dEQP-VK.compute.pipeline.cooperative_matrix.*):
Totals from 308 (18.98% of 1623) affected shaders:
Instrs: 38046 -> 23516 (-38.19%)
CodeSize: 220700 -> 142704 (-35.34%)
VGPRs: 9720 -> 6084 (-37.41%)
Latency: 264784 -> 241855 (-8.66%); split: -8.71%, +0.05%
InvThroughput: 43237 -> 21806 (-49.57%)
VClause: 630 -> 647 (+2.70%)
Copies: 1812 -> 1762 (-2.76%)
PreVGPRs: 4081 -> 2606 (-36.14%)
VALU: 19466 -> 9765 (-49.84%)
VOPD: 45 -> 36 (-20.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41968>
2026-06-16 10:59:28 +00:00
Rhys Perry
a197036242 ac/lower_global_access: parse u2u64 even if *out_offset!=NULL
We might be able to extract constants from this 32-bit value.

fossil-db (gfx1201, dEQP-VK.compute.pipeline.cooperative_matrix.*):
Totals from 74 (4.56% of 1623) affected shaders:
Instrs: 7412 -> 5184 (-30.06%)
CodeSize: 44416 -> 31064 (-30.06%)
VGPRs: 1920 -> 1392 (-27.50%)
Latency: 55606 -> 55354 (-0.45%); split: -0.56%, +0.10%
InvThroughput: 7612 -> 4504 (-40.83%)
PreVGPRs: 648 -> 578 (-10.80%)
VALU: 3960 -> 2406 (-39.24%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41968>
2026-06-16 10:59:27 +00:00
Rhys Perry
3b4a317439 ac/lower_global_access: rewrite try_extract_additions
In preparation for future improvements.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41968>
2026-06-16 10:59:27 +00:00
Rhys Perry
4a906e2b03 ac/lower_global_access: set cursor earlier
This can improve CSE.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41968>
2026-06-16 10:59:27 +00:00
Jose Maria Casanova Crespo
cff8dbd452 v3dv: rename format_plane unorm/snorm flags to sw_unorm/sw_snorm
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42176>
2026-06-16 10:46:39 +02:00
Jose Maria Casanova Crespo
4edc659231 v3dv: route blending of UNORM16/SNORM16 RTs through software lowering
UNORM16/SNORM16 render targets are backed by 16-bit-integer TLB
formats, which V3D HW cannot blend. The compiler already supports
software blend lowering in NIR, but V3DV only enabled it for dual-src
blending. As a result format_supports_blending refused the BLEND_BIT
for these formats and Dawn could not advertise the WebGPU
Unorm16TextureFormats feature.

Set pipeline->blend.use_software when any color attachment uses a
software-normalised format so the existing NIR blend lowering kicks
in, and expose VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT for
those formats.

Assisted-by: Claude Opus 4.7
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42176>
2026-06-16 10:46:38 +02:00
Lionel Landwerlin
051ede709c anv: fix 3DSTATE_SF line width programming with Bresenham lines
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42249>
2026-06-16 08:21:35 +00:00
Lionel Landwerlin
373ec78bc8 anv: add missing condition to update 3DSTATE_RASTER
update_clip_raster() checks the rasterization sample count.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42249>
2026-06-16 08:21:35 +00:00
Lorenzo Rossi
1a7ee324e4 kraid: Add Foldable and initial tests for OpShiftLop
Add a Foldable trait similar to what is already used in NAK for software
emulation of opcodes, since Mali has many variations like V4I8 that run
the same exact operation independently on each component of the vector,
this commit also adds a FoldableComp trait that lets the implementor
only focus on a single component and automatically implements Foldable.

We also add tests on OpShiftLop as an initial subject, we'll add most of
the arithmetic opcodes as time goes on to have a tight description of
the hardware.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
15d6595a62 kraid: Add basic hw_tests
Add the generic infrastructure to load/store the test data and compile
the shader, along simple tests that use the hw_runner.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
1d171a4174 kraid: Add hw_runner
This is a very small driver that just sends compute jobs to the graphics
card without any of the Vulkan or OpenGL indirections.  For now it only
supports v10-v13 since it's what Kraid is targeting.  Lots of the
low-level code that handles CSF encoding and descriptor handling is in C
foir semplicity (and because there is no genxml equivalent for rust yet).

device.rs also implements a barebone memory-safe Rust abstraction for
mali GPUs, as a treat.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
a3d39ec727 kraid/model: Ensure dyn Model is Send + Sync
We'll need the extra ensurance if we want to share the model across
threads.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
b4b8604fd0 kraid: Add OpIMul
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
83c26dd3a6 kraid/ops: Add a small crate documentation for conventions
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
838ee00c7d kraid: Fix FauRef Display bug
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
cbf450c7ff kraid: Add alloc_vec utility
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
18b425ede5 kraid/ir: Add FauRef UserPage creation utilities
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
fab6bd5a8a kraid/ir: Add SrcMod::fold_u64
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
5f61d83766 kraid/swizzle: Add fold_u64
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
b83297c9a1 compiler/rust/lower_bounded: Add FromIterator impl
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
de432135b4 panfrost: Reorder meson definitions
The compiler will also implement a very small driver that depends
on genxml and libpanfrost, so it needs to be defined after them, but
before clc.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
323d32bb00 panfrost: Separate the compiler from libpanfrost
Previously libpanfrost depended on the panfrost compiler, that was just
used for the pan_disassemble function used to disassemble and print
shaders. We'll need to add a dependency from kraid tests to libpanfrost
and this made things harder due to meson shenanigans.

This commit splits the dependency between libpanfrost and the compiler by
adding the disassembler as a callback, so that the user can provide its
own disassembler.

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
7634b2da20 kraid/tests: Edit meson to help rust-analyzer provide IDE suggetsions
If tests are enabled with the same name as the original crate two entries
are placed in rust-project.json with identical name, rust-analyzer does
not like that, rename tests to "kraid_test" to fix it.

Also, meson rust tests are weird as they directly call rustc --test flag
directly, and rust-project.json does not see any test cfg option.
To have proper code analysis in #[cfg(test)] we need to specify that
option directly in meson (this will mean that rustc will see --test and
--cfg test at the same time, it doesn't seem to mind though)

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Faith Ekstrand
b4e58c2bdb panfrost: Set the rustfmt edition to 2024
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Lorenzo Rossi
0675ce49c5 kraid: Fix out-of-tree build issue
Rust bindgen creates include dependencies that are relative to the
project root, that works perfectly if the build root is inside of the
project root, but breaks when it's a separate directory

Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42189>
2026-06-16 07:32:12 +00:00
Valentine Burley
40d4cf7a70 intel/gen: Explicitly declare gen_opcodes_private.h dependency
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The gen_opcodes custom target generates gen_opcodes.h,
gen_opcodes_private.h, and gen_opcodes.cpp, but idep_gen_opcodes_h only
declared gen_opcodes.h.

Declare gen_opcodes_private.h as well so that generated-header
dependencies are exported correctly to downstream hermetic build systems.

Fixes ninja-to-soong build failures due to missing gen_opcodes_private.h.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42248>
2026-06-16 06:36:04 +00:00
squidbus
a7575d7e98 kk: Respect precomp-compiler options when setting up kk_clc
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42221>
2026-06-15 20:39:44 -07:00
Sagar Ghuge
0b7dd78814 intel: Add debug hook to dump out BVH after update
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
INTEL_DEBUG=bvh_update_as will dump out AS after update pass.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39617>
2026-06-15 18:27:03 -07:00
Sagar Ghuge
5003ddb0a8 anv: Implement update BVH
Felix:
   - Fix typo in the end debug marker for update

Thanks to Kevron, He tested couple of workloads on BMG:

   - Hitman +50.3%
   - F122   +26.8%
   - SOTR   +18%

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39617>
2026-06-15 18:27:03 -07:00
Sagar Ghuge
b00f00a87a intel: Add debug option to dump out parent-child map
This commit adds new debug options to dump out parent-child relationship
map using INTEL_DEBUG=bvh_pcrel_map.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39617>
2026-06-15 18:27:03 -07:00
Sagar Ghuge
fc4458db9e anv: Track leaf block offset map
Track where is each leaf_id encoded in final BVH.
It's a map of leaf_id == final_bvh_offset. This will help us to navigate
the BVH layout in update pass.

Leaf block offset will give us : Leaf id -> bvh block
and parent-child map can be used for: bvh_block -> parent offset.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39617>
2026-06-15 18:27:03 -07:00
Sagar Ghuge
6ef5d17523 anv: Track parent-child map for BVH update
This map stores parent BVH offset for each of their children. This will
help us to walk the BVH layout later in the update pass.

Since we are tracking block indexes, even with 2^32 large BVH size, we
can have 2^26 max indices (each block 64B wide) that leaves us 6 bits in
which we can track child slot index occupancies in parent.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39617>
2026-06-15 18:27:03 -07:00
Sagar Ghuge
1f4b6f21ea anv/rt: Use constant BVH offset instead of pushing
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39617>
2026-06-15 18:27:03 -07:00
Sagar Ghuge
4c9a4abb65 anv/rt: Extract common code in separate header
Extract leaf encoding in encode.h and move some of the helper in
anv_build_helper.h

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39617>
2026-06-15 18:27:03 -07:00