Commit graph

217128 commits

Author SHA1 Message Date
Faith Ekstrand
fa9b2e7404 pan/bi: Add a bi_instr::blend_target
On Bifrost, we have to return the blend return offset in the compiled
shader info and that means we need to be able to index into an array by
blend target deep inside the compiler.  Instead of assuming bound blend
targets and subtracting BIR_FAU_BLEND_0 from fau_idx, add a separte
blend_target to bi_instr and use that.  This way what we return will be
based on the nir_io_semantics::location, regardless of where the actual
blend descriptor comes from.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39274>
2026-01-15 21:55:28 +00:00
hmtheboy154
0ee1631120 v3dv: add support for driconf
Signed-off-by: hmtheboy154 <buingoc67@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>

[Eric: fixed the v3dv instance]

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30263>
2026-01-15 21:36:16 +00:00
Nick Hamilton
69a56d33de pco: Fix for shadow sampler comparison not clamping the compare value
When doing sample comparisons on shadow images the compare value
should be clamped to [0,1]

Fix:
dEQP-VK.glsl.texture_functions.texture.samplercubearrayshadow_fragment

Signed-off-by: Nick Hamilton <nick.hamilton@imgtec.com>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39327>
2026-01-15 21:15:48 +00:00
Radu Costas
0eb3eaa806 pvr: Add calculation for spill/scratch buffers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Replace hardcoded value with hardware information-based calculation

Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Radu Costas <radu.costas@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39262>
2026-01-15 20:56:37 +00:00
Erik Faye-Lund
f8b8a57f2f panvk/meta: make helpers static
There's no good reason to keep these global, as they are only used from
the same source as they are defined in.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39304>
2026-01-15 20:21:42 +00:00
Erik Faye-Lund
a6009833c3 panvk: move cmd_resolve_attachments to panvk_vX_cmd_meta.c
This uses the vk-meta framework, so it feels more like it belongs here.
While we're at it, rename the function as well.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39304>
2026-01-15 20:21:42 +00:00
Caio Oliveira
b542ac4ca0 brw: Fix and properly use increment_a64_address()
Since the move to MEMORY_*_LOGICAL the result value was being ignored, so
change to use that.

Since the conversion to use new registers, some issues were introduced:
- Even with `has_64bit_int` ADD with 64-bit immediate value is not supported;
- `dst_high` was not being filled if there was no overflow;
- Only `dst_low` returned.

Found when writing some new code involving large block loads.

Fixes: b79e85a93f ("brw: always use new registers for load address increments")
Fixes: b55f77161d ("intel/brw: Switch to emitting MEMORY_*_LOGICAL opcodes")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39282>
2026-01-15 19:47:23 +00:00
Konstantin Seurer
4c30c44b75 nir: Generate unit tests for nir_opt_algebraic
This catches a number of bugs in the current NIR algebraic optimizations
or opcodes implementations (as fixed in this series, or documented in the
XFAIL tests), and should prevent many future bugs from landing.

This required bumping the test timeout, because s390x is very slow to
emulate in CI.

Closes: #3338
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:43 +00:00
Emma Anholt
df215cc3cd nir/opt_algebraic_tests: Mark patterns as unsupported or xfails.
This way as a pattern author/editor you can immediately see whether it's
getting test coverage and if there are known issues with the pattern.
This will also give us clear outcomes from testing as we fix failing
patterns.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:43 +00:00
Konstantin Seurer
f5864ed408 nir/opt_algebraic_tests: Add an option for generating unit tests
It only emits tests for exact patterns which do not use instructions
that drop precision by design.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:40 +00:00
Emma Anholt
14fafebc1a nir/algebraic: Fix typo in error message print.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:40 +00:00
Konstantin Seurer
363b2655b6 nir: Add a unit test base class for algebraic patterns
nir_algebraic_pattern_test can validate shaders with the following
structure:

%0 = @provide(base = 0)
...
%N = @provide(base = input_count)

// multiple equivalent expressions
a = ...
b = ...

valid = ieq(a, b)
@use(valid)

Expressions are evaluated by emulating the shader using
nir_eval_const_opcode.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:37 +00:00
Emma Anholt
8ebe630a13 nir/search_helpers: Avoid UB in is_2x_16_bits()/is_neg2x_16_bits().
Same trick we do for nir_imul evaluation -- do the multiply in unsigned to
get defined behavior from C.  Fixes UBSan failures with
nir_opt_algebraic_pattern_tests.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:37 +00:00
Emma Anholt
7dbd170a7f nir/opcodes: Cast isub/iadd3's args to uint to avoid UB integer underflow.
Same treatment as iadd itself got.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:37 +00:00
Emma Anholt
8529aaa399 nir/opcodes: Avoid technical UB left shifting ints.
We all know that (int)0xff << 24 is fine, but UBSan doesn't like it.
These were triggered by nir_opt_algebraic_pattern_tests.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:37 +00:00
Konstantin Seurer
079d416e99 nir: Fix the types of udot_.*_uadd_sat
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:37 +00:00
Konstantin Seurer
38d0bd7dd3 nir: Add an assert_eq intrinsic for testing nir_opt_algebraic
During the test this will compares both sources and fails the test if they
are not equal.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:37 +00:00
Emma Anholt
ed8676dc28 nir: Rename the unit_test_*_amd intrinics to be un-vendored.
We'll reuse these from the nir_opt_algebraic_pattern_test.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:37 +00:00
Emma Anholt
0dc3276a26 nir: Define udot_2x16_uadd_sat to have UB according to the SPIRV spec.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:32 +00:00
Emma Anholt
f638eb1b85 nir: Define extract/insert_i8 and friends to be UB if the shift is too large.
These opcodes are generated inside NIR algebraic when the shift is
constant, but this will help us do automated algebraic pattern testing
with arbitrary inputs that are unaware of the opcode's restrictions.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:32 +00:00
Emma Anholt
045ae759a5 nir: Specify f2i/f2u as undefined if the float is out of range of the int.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:32 +00:00
Emma Anholt
94f0e2dbaf nir/constant_expressions: Set the poison flag during i/ubitfield_extract.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:32 +00:00
Emma Anholt
b375da7f2a nir: Let nir_eval_const_opcode() return a poison mask in case of UB.
This is unused by any callers currently, but will be useful for nir
algebraic pattern testing, and as a way to turn our comments in
nir_opcodes.py into actual C code.  For now, always returns false.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:32 +00:00
Emma Anholt
f6008645f6 nir: Fix constant evaluation of non-32-bit bitfield_extract.
Caught by nir_opt_algebraic_pattern_tests.

Fixes: 226b0e28db ("nir: generalize bitfield insert/extract sizes")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39076>
2026-01-15 19:09:29 +00:00
Samuel Pitoiset
ae34627e54 ac/cmdbuf: disable ENABLE_PING_PONG_BIN_ORDER on GFX11.5
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Might be a hardware bug.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14240
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39315>
2026-01-15 17:55:26 +00:00
Erik Faye-Lund
e7ac3b32a4 lima: update unknown field
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We know what's at the four bits starting at 11:0; that's the uniform
count. But we don't know whats at 12:0, so let's update the start
address here.

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38493>
2026-01-15 13:40:09 +00:00
Nick Hamilton
68cb76de5d pco: Fix encoding of branch to an empty block
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When calculating the relative offset for a branch the pco_first_igrp
function is used to find the first instruction of a block.

However if the block is empty the function does not return NULL as it
description implies but returns a pointer to the list head which is not a
valid node. Using this leads to a garbage relative offset been calculated
which leads to unexpected behaviour.

Fix is to add a check for the list been empty and return NULL (the same
issue also exists in pco_last_igrp). This leads to the calling function,
pco_cf_node_offset, searching for the next none empty block which is the
expected behaviour.

Fix deqp:
dEQP-VK.graphicsfuzz.cov-two-nested-loops-switch-case-matrix-array-increment
dEQP-VK.graphicsfuzz.stable-binarysearch-tree-false-if-discard-loop

Signed-off-by: Nick Hamilton <nick.hamilton@imgtec.com>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39287>
2026-01-15 12:09:26 +00:00
Benjamin Cheng
371656de90 radv/video_enc: Remove CTS WA
This has been fixed in CTS since ebe05a88f36e3be8e232bfce97812353c396674a.

Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39242>
2026-01-15 11:45:33 +00:00
Erik Faye-Lund
70889a672e docs/faq: do not recommend basing drivers on i965
We no longer have classic drivers, don't recommend people writing new
ones.

Reviewed-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19106>
2026-01-15 11:16:26 +00:00
Erik Faye-Lund
27e71d71f6 docs: remove ancient stuff from faq
These are very unlikely to be frequently asked questions in 2026.

Reviewed-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19106>
2026-01-15 11:16:26 +00:00
Dylan Baker
1055004693 anv: initialize anv_address to ensure that the protection field is set
It is unconditionally used, but is uninitialized.

CID: 1675079
Fixes: b1e74a1bb1 ("anv: shrink image opaque data")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39245>
2026-01-15 10:19:12 +00:00
Dylan Baker
bc1ccebb0e anv: Use { 0 } to initialize struct
The previous approach does ensure that all entries are zero'd, but that
may not be clear to the reader (i.e., me). Using `{ 0 }` is clearer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39245>
2026-01-15 10:19:12 +00:00
Yogesh Mohan Marimuthu
ddf1e34dd6 winsys/amdgpu: userq job log fwm packet debug count
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Add WRITE_DATA packet before and after FENCE_WAIT_MULTI packet. Based
on the last number written in WRITE_DATA packet buffer, it can be
found if FENCE_WAIT_MULTI packet passed or not in CP firmware.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39206>
2026-01-15 09:45:10 +00:00
Yogesh Mohan Marimuthu
2547fd0f59 winsys/amdgpu: print userq job info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39206>
2026-01-15 09:45:09 +00:00
Yogesh Mohan Marimuthu
a542715271 winsys/amdgpu: use mesa_log functions instead of fprintf
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39206>
2026-01-15 09:45:07 +00:00
Yogesh Mohan Marimuthu
f050e6ea74 util/log: add MESA_LOG_FILE_AUTO to generate log file
if set, creates a file in /tmp folder with mesa_<process_name>_<pid>_XXXXXX.log
logging all errors, warnings, etc., rather than stderr. The XXXXXX will be replaced
with alpha numeric character so for each run of the app a new log file will be
created guaranteed.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39206>
2026-01-15 09:45:04 +00:00
Marek Olšák
fa88c65bb8 radv,radeonsi: don't set LINE_STIPPLE_TEX_ENA on gfx12
Fixes: 3c5c96fedb - radv: double pixel throughput in certain cases of PS without interpolated inputs
Fixes: 5acabdd1f8 - radeonsi: double pixel throughput in certain cases of PS without inputs
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14646

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39316>
2026-01-15 09:12:13 +00:00
Samuel Pitoiset
c559042a2a radv/dgc: adjust task+mesh SQTT markers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39178>
2026-01-15 09:43:00 +01:00
Samuel Pitoiset
82d00a4963 radv: fix missing SQTT markers for task+mesh draws
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39178>
2026-01-15 09:43:00 +01:00
Samuel Pitoiset
aee006efcd radv/sqtt: emit userdata in the gang CS when needed
For task shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39178>
2026-01-15 09:43:00 +01:00
Samuel Pitoiset
4da2e971e6 radv/sqtt: rework radv_emit_sqtt_userdata() to support gang CS
For task shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39178>
2026-01-15 09:42:59 +01:00
Emma Anholt
8ed2447554 ir3: Rename the file for ir3_nir_lower_load_sample_pos().
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38911>
2026-01-15 07:52:14 +00:00
Emma Anholt
aea58ebb4b ir3: Use the new NIR pass for load_barycentric_at_* optimization.
The core pass can do our at_sample lowering, while also optimizing it and
at_offset.  This leaves just load_sample_pos lowering in our pass, which
will be renamed in the next commit.  However, the prior load_sample_pos
lowering needed to be split between load_sample_pos and
load_sample_pos_from_id, because the new at_sample lowering generates
load_sample_pos_from_id directly.

shader-db effect (Batman: Arkham Origins, Fallout4, GTAV, Metro Exodus,
Sherlock):

Totals from 150 (0.01% of 1560788) affected shaders:
MaxWaves: 1346 -> 1586 (+17.83%); split: +17.83%, -7.73%
Instrs: 31464 -> 30311 (-3.66%); split: -4.52%, +0.57%
CodeSize: 61962 -> 68216 (+10.09%); split: -1.05%, +12.94%
NOPs: 4598 -> 4556 (-0.91%); split: -10.46%, +10.24%
MOVs: 479 -> 523 (+9.19%); split: -17.12%, +32.36%
COVs: 180 -> 171 (-5.00%)
Full: 1300 -> 1067 (-17.92%)
(ss): 880 -> 842 (-4.32%); split: -15.80%, +10.91%
(sy): 510 -> 562 (+10.20%); split: -5.10%, +19.22%
(ss)-stall: 3112 -> 2930 (-5.85%); split: -21.30%, +19.06%
(sy)-stall: 13774 -> 12429 (-9.76%); split: -16.06%, +5.10%
Preamble Instrs: 6814 -> 12145 (+78.24%)
Early Preamble: 75 -> 13 (-82.67%)
Cat0: 4971 -> 4929 (-0.84%); split: -9.68%, +9.47%
Cat1: 650 -> 677 (+4.15%); split: -15.23%, +23.85%
Cat2: 15246 -> 15210 (-0.24%); split: -0.34%, +0.10%
Cat3: 9661 -> 9595 (-0.68%)
Cat4: 2382 -> 2358 (-1.01%)
Cat5: 2209 -> 1672 (-24.31%)
Cat7: 1075 -> 600 (-44.19%)
Subgroup size: 17600 -> 18880 (+7.27%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38911>
2026-01-15 07:52:14 +00:00
Emma Anholt
5bd669868f nir: Add a note on how load_sample_pos_from_id works.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38911>
2026-01-15 07:52:14 +00:00
Samuel Pitoiset
beb3872a4e zink/ci: document a GLX crash on RADV/POLARIS10
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: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39229>
2026-01-15 06:43:34 +00:00
Samuel Pitoiset
1917750baf ci: uprev VKCTS main to 4d3bedc74e2258c483cf968753207cff84d9e4fc
RADV is the only driver using VKCTS main.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39229>
2026-01-15 06:43:34 +00:00
Aitor Camacho
c3aa8f3572 util: Fix HAVE_BUILD_ID ifdefs
Fixes: a77e09eaeb ("util: Introduce HAVE_BUILD_ID for build id utils")

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39201>
2026-01-15 06:12:05 +00:00
Aitor Camacho
1025715c6a kk: Fix compilation error when viewMask is 0
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-By: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39321>
2026-01-15 04:54:45 +00:00
Paulo Zanoni
b52b1a08bf intel/blorp: add blorp_shaders.cl
This gives us the infrastructure that allows us to slowly migrate
pieces of blorp shaders from NIR to OpenCL, which, IMHO, are much
easier to read. We can't fully migrate everything due to all the
conditional building we do with these shaders, but I'm sure we'll find
opportunities to replace some NIR with OpenCL eventually.

The conversion of blorp_check_in_bounds() serves as the first example.

I also plan to have the shaders from the new indirect copy extension
be OpenCL shaders (mixed with some NIR as well), so having this patch
merged now will reduce the diff for the extension later.

Thanks to Alyssa Rosenzweig for her help here.

v2:
- Use SPDX (Alyssa).
- Use nir_trim_vector() (Alyssa).
- Adjust CL variable declaration (Alyssa).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39046>
2026-01-15 04:34:55 +00:00
Paulo Zanoni
f047f0b1be intel/blorp: unionize blorp_params->wm_inputs
We have two distinct code paths sharing blorp_params->wm_inputs for
different purposes: the code from blorp_blit.c and the code from
blorp_clear.c. While blorp_blit.c uses most of the parameters (all
except clear_color), blorp_clear.c only uses clear_color and
bounds_rect. Split the parameters in two structs: one for blits and
the other for clears.

This not only helps save some space in the shader inputs, but it also
organizes things so it's more clear which parameters are used by what.
In addition, my plan is to later add struct blorp_wm_inputs_indirect,
which won't share anything that the others use, and would otherwise
grow the struct even more.

This change would reduce the size of struct blorp_wm_inputs from 96 to
80, but we have to add padding due to the assertion that compares it
to cs_prog_data->push.cross_thread.size. Still good, though.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39046>
2026-01-15 04:34:55 +00:00