Commit graph

220276 commits

Author SHA1 Message Date
Eric Engestrom
26b19e355f ci: yaml-toml-shell-test runs on generic runners, not hw farm runners
Fixes: 1ba84bc5ca ("ci: add check for misleading indentation in ci toml files")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31763>
2026-03-18 09:25:05 +00:00
Mary Guillemard
d00965651a nvk: Broacast viewport0 and scissor0 in case of FSR on Turing
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
On Turing, the hardware rely on the viewport index for FSR.
If not all viewports are defined, we will end up not rendering
anything when selecting the primitive shading rate.

This patch makes it that we now broadcast the viewport and scissor 0
likes the proprietary driver.

This fixes "dEQP-VK.mesh_shader.ext.builtin.primitive_shading_rate_*" on
Turing.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 2fb4aed9 ("nvk: Advertise VK_KHR_fragment_shading_rate")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40314>
2026-03-18 08:14:17 +00:00
Mary Guillemard
56e31d8145 nvk: Move viewport and scissor emit to their own function
We are going to need to reuse those functions to fix FSR support on
Turing.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40314>
2026-03-18 08:14:17 +00:00
Timothy Arceri
09393b33b2 util/driconf: add workarounds for Lethis - Path Of Progress
The game uses glGetUniformLocation() but specifies the wrong program id
for one of the uniforms. The shader programs both contain shaders with
a uniform of the same name but because they have a different number of
uniforms the returned uniform location does not match the expected uniform.

Here we add a workaround to force the uniform with the wrong get location
params to always have the location 0 so that it doesn't matter which
shader the application checks for the location.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14864
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40448>
2026-03-18 07:28:07 +00:00
Timothy Arceri
87ae5cab94 mesa: add force_explicit_uniform_loc_zero workaround
Allows a uniform name to be passed to force_explicit_uniform_loc_zero
allowing us to set that uniform to an explicit location of zero.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40448>
2026-03-18 07:28:07 +00:00
José Roberto de Souza
2b91888e54 anv: Remove asserts() added in resource_barrier_wait_stage()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
In commit 10b5b279a4 ("anv: Fix CmdResetEvent2() with RESOURCE_BARRIER::Wait stage == none")
I haved added assert to catch invalid cases but looks like we have several tests
affected by that problem causing crashes in debug builds.

So here I'm removing those asserts(), will then work on all the fixes and bring
it back.

Acked-by: Ivan Briano <ivan.briano@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40476>
2026-03-18 05:36:38 +00:00
Karol Herbst
21aac29da8 nak: vectorize f2f16 even more
Totals:
CodeSize: 8662212288 -> 8662208848 (-0.00%)
Static cycle count: 4713275320 -> 4713273530 (-0.00%)

Totals from 91 (0.01% of 1163204) affected shaders:
CodeSize: 1936288 -> 1932848 (-0.18%)
Static cycle count: 644443 -> 642653 (-0.28%)

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40298>
2026-03-18 05:22:06 +00:00
Karol Herbst
b5a2685cf8 nak: vectorize f2f16
Totals:
CodeSize: 8662332112 -> 8662212288 (-0.00%); split: -0.00%, +0.00%
Number of GPRs: 47508046 -> 47507734 (-0.00%); split: -0.00%, +0.00%
SLM Size: 1203000 -> 1202992 (-0.00%)
Static cycle count: 4713330409 -> 4713275320 (-0.00%); split: -0.00%, +0.00%
Spills to memory: 45073 -> 45059 (-0.03%)
Fills from memory: 45073 -> 45059 (-0.03%)
Max warps/SM: 50564816 -> 50564980 (+0.00%)

Totals from 1498 (0.13% of 1163204) affected shaders:
CodeSize: 20737136 -> 20617312 (-0.58%); split: -0.63%, +0.05%
Number of GPRs: 97659 -> 97347 (-0.32%); split: -0.33%, +0.01%
SLM Size: 13104 -> 13096 (-0.06%)
Static cycle count: 100260225 -> 100205136 (-0.05%); split: -0.17%, +0.11%
Spills to memory: 262 -> 248 (-5.34%)
Fills from memory: 262 -> 248 (-5.34%)
Max warps/SM: 50504 -> 50668 (+0.32%)

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40298>
2026-03-18 05:22:06 +00:00
Karol Herbst
f2fa7d0e9c nak: allow vector sources for f2f16 conversions
Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40298>
2026-03-18 05:22:06 +00:00
Karol Herbst
458923803d nak: enable vectorize_vec2_16bit
This is intended for backends that do SIMD within a register, like we do.

Helps with register pressure. This will also prevent f2f from being
scalarized, which will help on Ampere+ as a later patch will use F2FP for
those.

Totals:
CodeSize: 8662362848 -> 8662332112 (-0.00%); split: -0.00%, +0.00%
Static cycle count: 4713321839 -> 4713330409 (+0.00%); split: -0.00%, +0.00%
Spills to reg: 149117 -> 149128 (+0.01%)
Fills from reg: 170680 -> 170693 (+0.01%)

Totals from 19 (0.00% of 1163204) affected shaders:
CodeSize: 732208 -> 701472 (-4.20%); split: -4.22%, +0.02%
Static cycle count: 1670226 -> 1678796 (+0.51%); split: -0.10%, +0.61%
Spills to reg: 517 -> 528 (+2.13%)
Fills from reg: 486 -> 499 (+2.67%)

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40298>
2026-03-18 05:22:05 +00:00
Sagar Ghuge
87f7f0f039 anv/rt: Drop header update using blorp code path
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Updating header using blorp code path involves setting up the render
surface state. Header (CPU) update code path involves
compute_w_to_host_r barrier which involves heavy flushing. Switching to
completely shader based header update avoid all that overhead.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39971>
2026-03-18 03:49:17 +00:00
Sagar Ghuge
37f26e346a anv: Write IR header using shader instead of CS
On integrated platforms, we have issue where L3 cache not being coherent
with CS and it forces us to push data out L3.

To avoid data cache flush, let's write the IR header with BLORP shader.
There is a small shader launch latency but eventually that should not
matter because writing data with CS (MI_STORE) commands is slower than
shader execution when we consider large number of BVH tree getting
built.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39971>
2026-03-18 03:49:17 +00:00
Dave Airlie
5bfaf7536a st/mesh: handle mesh shader point size
This sets the per-vertex point size state correctly in the presence of mesh shaders.

(fixes line is just a educated pick)

Fixes: 51d6e4404a ("mesa: allow NULL for vertex shader when mesh pipeline")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40475>
2026-03-18 02:00:35 +00:00
Valentine Burley
a2b0dd80f3 ci: Uprev GL & GLES CTS
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: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40061>
2026-03-18 00:19:19 +00:00
Valentine Burley
d3cb6d9fb5 ci/android: Update Cuttlefish build
The new version adds lavapipe compatibility in minigbm.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40061>
2026-03-18 00:19:19 +00:00
Collabora's Gfx CI Team
178c98655f Uprev ANGLE to 599125448d7ad53b2868a7b5d2e3e8d3bfbc1717
b90b9ee1a4...599125448d

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40061>
2026-03-18 00:19:19 +00:00
Icenowy Zheng
38cf1b3829 vulkan/wsi/headless: properly use CPU images for CPU devices
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Currently the headless WSI unconditionally uses DRM images as WSI
images, which isn't proper behavior for working with lavapipe driver,
and leads to either error or crash (depending on whether udmabuf is
available).

Properly setup CPU images instead of DRM images for software-rendering
WSI devices.

This fixes (at least) `dEQP-VK.wsi.headless.swapchain.render.*` on
lavapipe.

Fixes: 90caf9bdbd ("vulkan/wsi/headless: drop the wsi_create_null_image_mem override")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40360>
2026-03-17 23:49:38 +00:00
Eric Engestrom
a90a3341ef ci: let shader-db run on regular runners
Prompted by the same change for another job in d542a92d50
("zink/ci: Run zink-lavapipe on regular runner")

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40474>
2026-03-17 23:03:54 +00:00
Rob Clark
4fc7a26aed meson: Fix build break on f43, gentoo, etc
Suggested-by: Marek Olšák <maraeo@gmail.com>
Fixes: e1b20bb883 ("meson.build: require python 3.10, try python3.12")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15079
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40463>
2026-03-17 22:15:00 +00:00
Erik Kurzinger
addadd20df wsi/display: retrieve monitor size from EDID
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When libdisplay-info is available and we are able to retrieve the
physical size of a display from its EDID, use that to populate the
physicalDimensions field of VkDisplayPropertiesKHR.

Signed-off-by: Erik Kurzinger <ekurzinger@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39989>
2026-03-17 21:40:12 +00:00
Erik Kurzinger
64f2f97fb8 wsi/display: retrieve monitor name from EDID
When libdisplay-info is available and we are able to retrieve the make
and model of a display from its EDID, use those to construct a more
useful displayName for VkDisplayPropertiesKHR.

Signed-off-by: Erik Kurzinger <ekurzinger@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39989>
2026-03-17 21:40:12 +00:00
Michael Cheng
2eebe7b884 intel/blorp: use dedicated clear ops in clear paths
Select dedicated blorp ops for clear requests instead of reusing generic
depth/color labels.

Signed-off-by: Michael Cheng <michael.cheng@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40414>
2026-03-17 21:10:40 +00:00
Michael Cheng
061ed05c7a intel/blorp: Remove unused blorp_gfx8_hiz_clear_attachments
Signed-off-by: Michael Cheng <michael.cheng@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40414>
2026-03-17 21:10:40 +00:00
Michael Cheng
b901ff322a intel/blorp: add explicit clear op enums for stencil and linear paths
Add dedicated BLORP op enums so clear paths can be represented
precisely.

This is enum-only groundwork; behavior and trace output are wired in
follow-up commits.

Signed-off-by: Michael Cheng <michael.cheng@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40414>
2026-03-17 21:10:40 +00:00
Radu Costas
7d117e44be pvr, ci: Update expected failures list
Update to the correct failure type (Crash instead of fail)

Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Signed-off-by: Radu Costas <radu.costas@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40472>
2026-03-17 20:53:15 +00:00
Lionel Landwerlin
173a4c6170 vulkan/runtime: break view mask from renderpass information
The runtime builds a final pipeline state with pointers to structures
coming from the associated pipelines libraries.

So far it has considered that the viewMask was part of a structure
together with the rest of the renderpass information. This information
can be specified in pre-raster, fragment & color-output state groups
and it was assumed would be consistent for all 3. And the runtime
currently takes the pointer to the structure from the last pipeline
library (color output).

Some coming spec/cts will clarify that the viewMask only needs to be
specified for pre-raster & fragment groups, making the value in the
color-output group untrustworthy.

This change creates a new state structure to hold the viewMask on its
own so it is only gather on pre-raster & fragment groups.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (radv)
Reviewed-by: Aitor Camacho <aitor@lunarg.com> (kosmickrisp)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com> (turnip)
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (v3dv)
Reviewed-by: Frank Binns <frank.binns@imgtec.com> (powervr)
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (panvk)
Royaled-yes-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> (lavapipe)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39940>
2026-03-17 20:13:35 +00:00
Rob Clark
4fc5879573 freedreno/registers: Remove left-over comment
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
I accidentially left some notes in !39636.  The lua hook for figuring
out which descriptor type(s) to display is already implemented.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40470>
2026-03-17 18:14:39 +00:00
Rob Clark
11fcee57a7 freedreno/registers: Add a couple missing bitfields
Noticed these were missing compared to kernel copy of xml.  Not used by
mesa, but needed by kernel.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40470>
2026-03-17 18:14:39 +00:00
Caio Oliveira
f07138f244 spirv: Lower ShuffleUpINTEL and ShuffleDownINTEL to intrinsics
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40376>
2026-03-17 17:21:52 +00:00
Caio Oliveira
dcba49d7ef intel/compiler: Handle shuffle_*_intel intrinsics in bit size lowering
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40376>
2026-03-17 17:21:52 +00:00
Caio Oliveira
a2cbdfbde3 nir: Add intrinsics for ShuffleUpINTEL and ShuffleDownINTEL
Move lowering to nir_lower_subgroups.  At some point Intel
backend might want to skip that and lower at the backend IR
boundary, but for now lowering always applies.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40376>
2026-03-17 17:21:52 +00:00
Mike Blumenkrantz
95b7a5b82b ntv: always emit const coord components for fbfetch loads
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
VUID-StandaloneSpirv-SubpassData-04660
  The (u,v) coordinates used for a SubpassData must be the <id> of a constant vector (0,0)

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40468>
2026-03-17 17:02:58 +00:00
José Roberto de Souza
10b5b279a4 anv: Fix CmdResetEvent2() with RESOURCE_BARRIER::Wait stage == none
CmdResetEvent2() was calling anv_add_pending_pipe_bits() with no dst_stages
stages causing RESOURCE_BARRIER::Wait stage == none, what causes a GPU hang in
NVL-P simulator.

So here setting dst_stages to VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT and adding
an assert in resource_barrier_wait_stage() to catch hw_stage == 0.

This fixes crucible func.event.cmd_buffer.q0 in simulator.

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/40445>
2026-03-17 16:42:55 +00:00
Gurchetan Singh
53706931bc gfxstream: fixes to get Fuchsia headless to compile
The prior version of gfxstream-fuchsia featured an Android compat
layer, and only worked with Goldfish.  The compat layer was
deleted a while ago.

The Fuchsia Goldfish integration was deleted here:

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33050

since the Fuchsia emulator itself uses a frozen version of the
library.  This goes further in that direction: deleting leftovers
of the Fuchsia Android compat layer, which used provided VK
dispatch.

This allows Fuchsia + gfxstream to build via meson2hermetic, with
the a few additional common core patches applied.

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40442>
2026-03-17 16:25:53 +00:00
Gurchetan Singh
792184b83f gfxstream: add vulkan_gfxstream_structure_type.h to codegen output
It is an output.  Useful for meson-to-bazel conversion, where
Bazel happened to spot this.

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40442>
2026-03-17 16:25:53 +00:00
Gurchetan Singh
bc6bedf0a4 gfxstream: meson: remove duplicate includes
Both inc_guest_iostream and inc_platform_virtgpu were used
twice in the same include_directories array.

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40442>
2026-03-17 16:25:53 +00:00
Gurchetan Singh
7eaa1bb96c gfxstream: explicitly assign INVALID_DESCRIPTOR
Sometimes, it's used with fds (int32_t), sometimes with
gem_handle (uint32_t).  Be consistent and explicitly cast
when needed.

Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40442>
2026-03-17 16:25:53 +00:00
Faith Ekstrand
381bc06c4a nak: Report progress from nak_nir_rematerialize_load_const()
Fixes: 8fffcdb18b ("nak/nir: Re-materialize load_const instructions in use blocks")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40464>
2026-03-17 16:11:38 +00:00
Caio Oliveira
b494faa12d spirv: Remove dead code in subgroup instruction handling
This codepath had a bug (always setting `elems[0]`) since it was last
reworked, but there's no subgroup instruction that uses this helper and
support Composites, so it can be replace with an assert.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40356>
2026-03-17 15:32:36 +00:00
Erik Faye-Lund
224a336bf0 gallium/vl: use common ycbcr helpers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This reduces a bit of complexity across the tree.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
2026-03-17 15:00:55 +00:00
Erik Faye-Lund
28fd6a5789 gallium/vl: do not adjust matrix twice
There's no reason to adjust the matrix once unconditionally, and then
agaiun conditionally after overwriting the matrix. If we just make the
second adjustment unconditional, we should be good.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
2026-03-17 15:00:55 +00:00
Erik Faye-Lund
fdfce5c57f gallium/vl: rename scale/bias variables
This is just cleaning up some naming, so we consistently refer to things
dealing with luma as "y" and things dealing with chroma as "c".

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
2026-03-17 15:00:54 +00:00
Erik Faye-Lund
e32f7ac381 vulkan: use common ycbcr code
There's a few things going on here:

1. Vulkan makes the YCbCr model and YCbCr range completely orthogonal.
   This means that we need to be able to handle an identity transform
   while still doing range-remapping, so we apply the range mapping and
   color-transform separately, and let the optimizer clean things up.
   This is similar to what we did before, but it means it's a bit harder
   to get completely optimal code out of this.

2. Vulkan defines that the YCbCr inputs come in a bit of an unusual
   order; Cr, Y, Cb. This means we need to reorder things a bit when
   applying the YCbCr range and multiplying the YCbCr color-model
   matrix. This makes the code a little bit confusing to read at times.

3. Because the alpha-channel is passed through this function, we need to
   expand the matrix to 4x3. This is similar to what we've already been
   doing, but also a bit unusual. In the future, we might want to keep
   the alpha-channel out of this code-path, and just work on a vec3
   here.

I suspect that all of these can be solved by rearranging the code a bit.
But I've left that as an excercize for later to make sure we get this
right first, with as few modifications as possible. Some people might
disagree with this approach, but let's see.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
2026-03-17 15:00:54 +00:00
Erik Faye-Lund
5127568b98 compiler/nir: use common ycbcr math
Let's use the common code, so we have a single place to update in case
we want to add features etc.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
2026-03-17 15:00:54 +00:00
Erik Faye-Lund
f6f2e16e35 util: add common ycbcr coefficient math code
This adds some reusable math to set up YCbCr to RGB color transforms. It
covers ITU BT.601, ITU BT.709 and ITU BT.2020 YUV <-> RGB conversion, as
well as "narrow"" and "full" range.

This code is intended to replace three different implementations of
YUV-transforms already present in Mesa, all of them with different
parameterizations and differences in data-formats. These implementations
are: nir_lower_tex.c, vk_nir_convert_ycbcr.c and vl_csc.c.

None of the exising implementations seems to fully cover all of the needs
of the others. The one that comes the closest is the one in vl_csc.c, but
it has a few issues:

1. It doesn't differentiate between per-channel bit-sizes, which the
   Vulkan code needs.
2. It uses enums from p_video_enums.h in Gallium to paremeterize the
   behavior.
3. It's written in a monolithic way, handling up to two
   range-remappings, which the other implementations doesn't need.

While it could be possible to entangle all of that, that would likely
end up being a more or less a new implementation anyway. So let's instead
try to pick the best of all three implementations into one new one,
that's broken into smaller pieces that can be assembled into either of
the three.

In addition, this implementation has a bunch of unit-tests, to make sure
we don't introduce subtle breakages down the line.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
2026-03-17 15:00:54 +00:00
Rob Clark
1f93e1b831 ir3: Set max_workgroup options
In some simple math_brute_force tests it cuts instructions 65->57

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40438>
2026-03-17 14:32:43 +00:00
Mike Blumenkrantz
fe2c7af606 util/cso: use the mesh_shader pipe cap for mesh support
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37359>
2026-03-17 14:00:31 +00:00
Mike Blumenkrantz
3ea293a9d1 gallium/util: kill off util_framebuffer_init
no more users

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40440>
2026-03-17 13:24:36 +00:00
Mike Blumenkrantz
f1a52cf71c r300: import util_framebuffer_init
no functional changes

Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40440>
2026-03-17 13:24:36 +00:00
Mike Blumenkrantz
30ba4bfe63 llvmpipe: set prefer_real_buffer_in_constbuf0 and delete user buffer path
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this was redundant

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40439>
2026-03-17 12:21:15 +00:00