Commit graph

223974 commits

Author SHA1 Message Date
Emma Anholt
fbd9c67e2a drm-shim/freedreno: Fix VM_BIND support.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We need to initialize the out fence.  This was supposed to be in the
merged code, but I failed to force-push before marging.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42103>
2026-06-09 03:39:42 +00:00
Christian Meissl
9da4fb526a nir/lower_tex: skip external texture YUV lowering for query instructions
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Guard external texture lowering by !nir_tex_instr_is_query(), matching
the pattern already used by swizzle_result and lower_srgb.

Fixes textureSize() on samplerExternalOES on panfrost, which triggers
the assertion:

```
Invalid invariant idx.type == BI_INDEX_REGISTER:
	   r10 = TEX_SINGLE.rgb.2d.f32.zero_lod _.h00, ^r10, ^r11, sr_count:0
```

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41454>
2026-06-09 01:26:45 +00:00
Karol Herbst
9d858b6719 rusticl/program: implement CL_PROGRAM_BUILD_LOG without a copy
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:10 +00:00
Karol Herbst
fed9ea7aa7 rusticl/program: implement CL_PROGRAM_BUILD_OPTIONS without a copy
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:10 +00:00
Karol Herbst
23295a7f3e rusticl/program: store build options as CString
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:10 +00:00
Karol Herbst
6abe48d835 rusticl/program: set __OPENCL_C_VERSION__ ourselves
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:10 +00:00
Karol Herbst
7aa9a36ade rusticl/program: move -cl-std handling inside CompileOptions::get_clang_args
Also ignore empty options while at it, because that can now happen and
makes other part of the code upset.

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:10 +00:00
Karol Herbst
d1482321ae rusticl/program: handle -create-library inside CompileOptions::new
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:09 +00:00
Karol Herbst
13511279c9 rusticl/program: turn iter map into loop inside CompileOptions::new
Otherwise error handling is going to be painful later on.

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:08 +00:00
Karol Herbst
1e41c73cf5 rusticl/program: construct __OPENCL_VERSION__ inside CompileOptions::get_clang_args
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:08 +00:00
Karol Herbst
73b3d81a48 rusticl/program: add CompileOptions::get_clang_args
Soon we'll parse the options earlier where we don't target a specific
device yet, so we need to be able to generate the clang arguments on the
fly after parsing.

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:08 +00:00
Karol Herbst
33f6c01caa rusticl/util: add CStrExt::from_ptr_or_empty
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:08 +00:00
Karol Herbst
23b0d9c6f7 rusticl/util: add CStrExt trait
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:08 +00:00
Karol Herbst
890a51c207 rusticl/program: print compiler output as Rust string
The CString Debug implementation does not handle new lines, so it gets all
printed as a single row, which is not what we want at all.

Fixes: 01de0ff26f ("rusticl/program: store log as a CString")
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42021>
2026-06-09 00:38:07 +00:00
Alyssa Rosenzweig
8150ce8531 anv: enable jay ray query
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42006>
2026-06-08 23:57:46 +00:00
Calder Young
4aca86b383 jay: Implement ray tracing trace intrinsics
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42006>
2026-06-08 23:57:46 +00:00
Calder Young
667a330512 jay: Implement ray tracing topology id intrinsics
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42006>
2026-06-08 23:57:46 +00:00
Calder Young
576fc784c9 jay: Disable SIMD32 if ray queries are used
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42006>
2026-06-08 23:57:46 +00:00
Alyssa Rosenzweig
773a0e71ce jay/lower_pre_ra: allow immediate on bfe
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42006>
2026-06-08 23:57:46 +00:00
Calder Young
03bff227db brw: Move topology id helper intrinsics to NIR
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42006>
2026-06-08 23:57:46 +00:00
Calder Young
9f2c6fdca4 brw: Move ray payload bitfield generation to NIR
This will save us the trouble of faking constant folding for the BVH level and
trace ray control values when we lower this intrinsic in the new backends.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42006>
2026-06-08 23:57:46 +00:00
Alyssa Rosenzweig
2a1588c09e bin: add drm-shim script
Add a script to run whatever you want under drm-shim given only a driver name,
CI job name or GPU model, plus the option to dump assembly with a common option.
This lets people debugging common code easily run shader-db or whatever with
whatever they want without needing to look up a million driver specific
options/paths/etc.

Must run inside a meson devenv. Example usage (path symlinked):

  drm-shim --disasm glk ./run shaders/glmark/1-1.shader_test
  drm-shim --disasm asahi ./run shaders/glmark/1-1.shader_test
  drm-shim --disasm panfrost-t860 ./run shaders/glmark/1-1.shader_test
  drm-shim --disasm zink-radv-navi31-valve ./run shaders/glmark/1-1.shader_test

Makes for a fun compilerexplorer like tool too

Reduces amount of docs needed for https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41959

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42055>
2026-06-08 23:07:43 +00:00
Rob Clark
b340a00c29 tu: Un-open-code RB_A2D_PIXEL_CNTL
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: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42089>
2026-06-08 22:21:40 +00:00
Rob Clark
bc45a27323 freedreno/a6xx: Un-open-code RB_A2D_PIXEL_CNTL
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42089>
2026-06-08 22:21:39 +00:00
Rob Clark
b13abd08f2 freedreno/registers: Add RB_RESOLVE_CNTL_0.YUV_PLANE_ID
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42089>
2026-06-08 22:21:39 +00:00
Rob Clark
aea956a25f freedreno/registers: Improve A2D docs
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42089>
2026-06-08 22:21:39 +00:00
Rob Clark
88210dfcf5 freedreno/a6xx: Push RB_A2D_PIXEL_CNTL magic into blitter
This is about partial (only z or only s) z24s8 blits.  Just push the
buffers mask down to blitter to consolidate the magic.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42089>
2026-06-08 22:21:39 +00:00
Yiwei Zhang
301a1f9a61 anv: fix lock scope in anv_ensure_fp64_shader
Fixes: 7d3b62e13d ("anv: only load fp64 software shader when needed")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42094>
2026-06-08 21:55:45 +00:00
Jason Macnak
e0646b3b83 gfxstream: kumquat: validate device dmabuf support before use
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42091>
2026-06-08 21:38:19 +00:00
Paulo Zanoni
547432e85a intel/blorp: don't include "util/format_rgb9e5.h"
We don't use anything from that header. We call
nir_format_pack_r9g9b9e5(), which comes from nir_format_convert.h,
which we already include.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41976>
2026-06-08 21:18:47 +00:00
Paulo Zanoni
0d8f487e06 intel/blorp: move struct blorp_blit_prog_key to blorp_blit.c
The key is only used inside that file. Make it like we do with the
keys in blorp_clear.c.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41976>
2026-06-08 21:18:47 +00:00
Paulo Zanoni
081dd1db75 intel/blorp: fix blorp base key initialization
When you use designated initializers, anything that is not explicitly
set is set to zero. When you do something like:

  struct blorp_blit_prog_key {
    .base = BLORP_BASE_KEY_INIT(BLORP_SHADER_TYPE_BLIT),
    .base.shader_pipeline = BLORP_SHADER_PIPELINE_RENDER,
  };

the second initialization is the only one that does something: it sets
shader_pipeline to the desired value, and all the other fields in
"base" are set to 0. This is easily verifiable by just examining the
contents of all the blorp keys we initialize this way: name and
shader_type are always zero.

This means that if two blorp shaders of different types have the
same key size, the shader cache could confuse them. Still, I don't
think this is happening in the real world.

Fixes: 22ecb4a10f ("intel/blorp: Support compute for slow clears")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/11690
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41976>
2026-06-08 21:18:46 +00:00
Paulo Zanoni
ed098570bc intel/blorp: don't silently ignore compilation failures
If we fail to compile a Kernel, don't silently fail: call mesa_loge()
so we can at least know it happened. On debug builds, just assert(),
so if they ever happen in CI, we'll know.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41976>
2026-06-08 21:18:46 +00:00
Mike Blumenkrantz
824518737a zink: always return DMA_BUF type handles from resource_get_handle
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
OPAQUE_FD here was a historical remnant (9fa7400564)
from before zink actually handled dmabufs, but now that it does,
use dmabuf for exports since that's what is actually desired

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42092>
2026-06-08 19:41:41 +00:00
Jason Macnak
e6f5d0c691 gfxstream: support testing d32 s8
Originally from bohu's ag/39789592

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42090>
2026-06-08 19:26:52 +00:00
Jason Macnak
1ca550927f virtgpu_kumquat_ffi: replace mutex.get_mut() with mutex.lock()
mutex.get_mut() says

   Since this call borrows the Mutex mutably, no actual locking
   needs to take place – the mutable borrow statically guarantees
   no new locks can be acquired while this reference exists.

However, the borrow checker does not really apply inside of the
unsafe ffi functions which can result in unintended concurrent
access.

Bug: b/519657682
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42061>
2026-06-08 19:07:43 +00:00
José Roberto de Souza
573368af88 anv: Replace most parameters of fill_inline_param() by a struct
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
A future patch will add more parameters to fill_inline_param(), so lets reduce
the number of parameters by passing a struct to this function instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41351>
2026-06-08 18:41:25 +00:00
José Roberto de Souza
dbfb0a3b0d anv: Add assert to make sure we don't push more than max_push_regs to push constants
As the push constant size limit is only valid in stages that don't use inline
param I had to add and call stage_has_inline_param() first.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41351>
2026-06-08 18:41:25 +00:00
Samuel Pitoiset
bcae3b8005 radv: handle errors correctly when creating gang waits
r was only assigned for the first cmd stream.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42027>
2026-06-08 17:57:42 +00:00
Samuel Pitoiset
2b8b6fd292 radv: add the mesh scratch ring BO to the preambles BO list
This was missing and this can technically causes issues.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42027>
2026-06-08 17:57:42 +00:00
yserrr
314962b0f8 v3d: lower more 64-bit integer operations
The QPU ALUs operate internally on 32-bit data, and V3D already asks
nir_lower_int64 to lower several 64-bit integer operations before they
reach the backend.

Extend that set to cover bit count, div/mod, abs, and min/max, so these
operations are expanded into 32-bit sequences instead of being left for
backend codegen.

Signed-off-by: yserrr <dlwognsdc610@naver.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42052>
2026-06-08 16:49:01 +00:00
Vinson Lee
718236ebb8 ethosu: use FALLTHROUGH macro in ethosu_emit_operation_accesses
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Compiling with clang produces a -Wimplicit-fallthrough warning:

  src/gallium/drivers/ethosu/ethosu_cmd.c:1032:7: warning: unannotated
  fall-through between switch labels [-Wimplicit-fallthrough]

The plain "/* fall-through */" comment is not recognized by clang as a
fall-through annotation, so the intentional fall-through from the
ETHOSU_OPERATION_TYPE_CONVOLUTION case into the default case is flagged.
Replace the comment with the FALLTHROUGH macro, which expands to the
appropriate attribute and documents the intent for both GCC and clang.

Fixes: dce4b0313a ("ethosu: Add reshape operation")
Assisted-by: Claude Code (Claude Opus 4.8)
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42069>
2026-06-08 16:33:15 +00:00
Tapani Pälli
b33635bbe7 iris: align down the max_shader_buffer_size
Fixes many failing CTS tests in following set:
   KHR-Single-GL46.enhanced_layouts.ssb_member_invalid_offset*

See commit e58dcc47c3 that made the same change for radeonsi.

Fixes: 1eb4a2f5cd ("iris: Limit max_shader_buffer_size to INT32_MAX")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41958>
2026-06-08 16:15:13 +00:00
Alyssa Rosenzweig
ce4d2d7faa jay/register_allocate: make phi webs conservative
Noticed in a bunch of vkpeak shaders which had extra moves in the loop.

SIMD16:
   Totals from 547 (20.66% of 2647) affected shaders:
   Instrs: 1139024 -> 1131482 (-0.66%); split: -0.68%, +0.02%
   CodeSize: 15919528 -> 15834088 (-0.54%); split: -0.56%, +0.02%

SIMD32:
   Totals from 523 (19.76% of 2647) affected shaders:
   Instrs: 1271749 -> 1263534 (-0.65%); split: -0.75%, +0.10%
   CodeSize: 18180076 -> 18091180 (-0.49%); split: -0.60%, +0.11%

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42056>
2026-06-08 15:56:28 +00:00
Alyssa Rosenzweig
62e8998e39 jay: optimize out more early eot related copies
SIMD16:
   Totals from 1790 (67.62% of 2647) affected shaders:
   Instrs: 2082218 -> 2080428 (-0.09%)
   CodeSize: 29060912 -> 29046464 (-0.05%)

SIMD32:
   Totals from 2071 (78.24% of 2647) affected shaders:
   Instrs: 2163230 -> 2161159 (-0.10%)
   CodeSize: 30923760 -> 30906832 (-0.05%)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42056>
2026-06-08 15:56:28 +00:00
Alyssa Rosenzweig
6812bddfe1 jay: uniformize bti indirects
these must be dynamically uniform but can be GPR. fixes validation on
dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.dynamically_uniform_tessellation_evaluation,
and probably really bugs doing indirect loads in divergent control flow
(when lane 0 is masked off).

no fossil-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42056>
2026-06-08 15:56:28 +00:00
Kenneth Graunke
9b82818510 anv: Fix shader stats when using jay for non-compute stages
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42056>
2026-06-08 15:56:27 +00:00
Calder Young
04cbd47f72 jay: Disable avoid_ternary_with_two_constants when using jay
This optimization mostly helped BRW because 3-src instructions can't take
immediates, and BRW can't allocate scalars without wasting an entire GRF unit
per scalar. Jay has a better RA that can pack many scalars into a single GRF
unit, so allocating temporary registers for the immediates is far less likely
to lead to as much spilling as it does on BRW.

SIMD16:
   Totals from 1331 (50.28% of 2647) affected shaders:
   Instrs: 1665848 -> 1665514 (-0.02%); split: -0.16%, +0.14%
   CodeSize: 23192072 -> 23215672 (+0.10%); split: -0.30%, +0.40%

SIMD32:
   Totals from 1114 (42.09% of 2647) affected shaders:
   Instrs: 1959968 -> 1960548 (+0.03%); split: -0.30%, +0.33%
   CodeSize: 28004460 -> 28023468 (+0.07%); split: -0.39%, +0.46%
   Number of spill instructions: 31157 -> 31161 (+0.01%); split: -0.01%, +0.03%
   Number of fill instructions: 32138 -> 32130 (-0.02%); split: -0.05%, +0.02%

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42056>
2026-06-08 15:56:27 +00:00
Alyssa Rosenzweig
e5450c4c85 jay: allow null in jay_collect_vectors
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42056>
2026-06-08 15:56:27 +00:00
Calder Young
101cc5e331 jay: Add support for saturating f2i16 and f2i8 NIR opcodes
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42056>
2026-06-08 15:56:27 +00:00