Commit Graph

215446 Commits

Author SHA1 Message Date
David Rosca
15e02eb6ab frontends/va: Use util_dynarray for decode slice data buffers
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38241>
2025-11-26 15:49:59 +00:00
Corentin Noël
3b086706fe ci: Uprev crosvm and virglrenderer
Update to their latest commit on time.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38570>
2025-11-26 15:04:25 +00:00
Dmitry Osipenko
25881c701a virgl: Support new resource-layout command
Support new vrend command that queries layout of a backing GBM buffer
for a giver vrend resource. Use it for querying stride/modifier of a
PIPE_SHARED resource, passing this info down to WSI for exported resources.
Now venus is able to import vrend resources, making gamescope work in KMS
mode on QEMU. Virgl doesn't use stride/modifier info of winsys when it
imports classic vrend resources, hence this change only affects venus
context when it imports virgl WSI buffers.

Based on initial version of resource-layout command from Daniel Stone.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Yiwei Zhang <zzyiwei@gmail.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37646>
2025-11-26 14:43:12 +00:00
Dmitry Osipenko
29b64d6636 virgl: Implement resource_create_with_modifiers
The .resource_create_with_modifiers() callback became required after
7d1a32fafd for venus to work in KMS mode. This fixes GBM buffer
allocation failure for vkmark-kms and fixes implicit modifier not
working on host when using Intel i915 driver for running Steam with
gamescope-kms on guest. Note that KMS support for venus on QEMU never
worked before, hence this is not regression fix.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37646>
2025-11-26 14:43:12 +00:00
Karol Herbst
d06aff2243 nak/cmat: use movm
Sadly I don't see an obvious way to use it for int8 matrices, therefore
the code is a bit of a mess right now.

It allows us to vectorize load/stores more often as we can simply
transpose row/col major matrices when needed.

And the movm optimization is also only enabled for 16 bit types, even
though we _could_ do it for 32 bit. It's not clear yet if using it for 32
bit types is an overall advantage or not.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37998>
2025-11-26 14:09:37 +00:00
Karol Herbst
626c6b35f0 nak: add Movm
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37998>
2025-11-26 14:09:37 +00:00
Karol Herbst
c4f07f3d79 nir: mark cmat_load_shared_nv as CAN_ELIMINATE
It's just a special load shared and has no side effects.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37998>
2025-11-26 14:09:35 +00:00
Karol Herbst
6e89dc33fe nak/cmat: add optimisation to cmat load/store to do 32-bit load for f16vec2
Initial idea and code from Dave, but this is a complete rewrite of the
patch.

The Matrix layouts contain groups of values, for int8 we have vec4 groups,
for fp16, fp32 and int32 we have vec2s. With this we load and store them
as vectors getting rid of a bunch of address calculation.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37998>
2025-11-26 14:09:35 +00:00
Karol Herbst
79b3386810 nak/cmat: add alignment info to matrix load/stores
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37998>
2025-11-26 14:09:34 +00:00
Iago Toral Quiroga
a643681dd5 broadcom/compiler: use nir_opt_uub
Shows performance improvement on aztec/aztec_high

fps_avg  helped:  gl_aztec.trace:       6.37 -> 6.45 (1.26%)
fps_avg  helped:  gl_aztec_high.trace:  4.29 -> 4.33 (0.93%)

And a significant instruction count reduction in the affected
shaders. But some shaders show a huge reduction.

gles_aztec/274.shader_test MESA_SHADER_COMPUTE: 1375 -> 1196 (-13.02%)
gles_aztec_high/499.shader_test MESA_SHADER_COMPUTE: 1375 -> 1196 (-13.02%)
master-of-orion/1253.shader_test MESA_SHADER_FRAGMENT: 305 -> 262 (-14.10%)
blender/7.shader_test MESA_SHADER_FRAGMENT: 12389 -> 10455 (-15.61%)
master-of-orion/1256.shader_test MESA_SHADER_VERTEX: 170 -> 131 (-22.94%)

total instructions in shared programs: 14679696 -> 14675496 (-0.03%)
instructions in affected programs: 196683 -> 192483 (-2.14%)
helped: 430
HURT: 8
Instructions are helped.

total uniforms in shared programs: 6775582 -> 6775495 (<.01%)
uniforms in affected programs: 21155 -> 21068 (-0.41%)
helped: 48
HURT: 2
Uniforms are helped.

total max-temps in shared programs: 2709673 -> 2709710 (<.01%)
max-temps in affected programs: 403 -> 440 (9.18%)
helped: 2
HURT: 16
Max-temps are HURT.

Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38642>
2025-11-26 13:32:39 +00:00
Jose Maria Casanova Crespo
4234e7eed0 broadcom/compiler: enable umul24 and imul24 ALU opcodes
For umul24 we expose the operation as UMUL24_RTOP0 so we can identify
the difference between umul24 as part of a sequence generated from an
imul as "multop+umul24" and a simple umul24 where rtop will always be 0.

For umul24_rtop0 instructions we relax the scheduling restrictions,
so they don't need to be serialized like the multop+umul24 ops. But
we maintain the read dependency with the last_rtop.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38642>
2025-11-26 13:32:39 +00:00
Timur Kristóf
29dff2fd75 radv: Check RADV_PERFTEST=sparse for image formats and sparse queue
Without this, we will report some image formats as unsupported
and the dedicated sparse binding queue won't work
when sparse support is enabled using RADV_PERFTEST=sparse

Fixes: dd90c76cea12 ("radv: Advertise sparse features pre Polaris with perftest flag")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38676>
2025-11-26 13:12:27 +00:00
David Rosca
1884b03a10 radeonsi/vcn: Fix maybe uninitialized warning
Backport-to: 25.3
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38545>
2025-11-26 12:22:06 +00:00
Erik Faye-Lund
e119091e7d panfrost/ci: remove some out-of-date xfails
These are failing in nightly builds. Seems we forgot to update these
xfails when fixing the problem.

Fixes: a6bf07e7c2 ("dri: avoid sending too many present reuqests when app start or pause"
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38675>
2025-11-26 12:55:41 +01:00
Samuel Pitoiset
f14e0d9f09 radv: add radv_hide_rebar_on_dgpu and enable for Red Dead Redemption 2
RDR2 VRAM memory management when resizable BAR is enabled seems
incorrect because it keeps allocating VRAM without freeing anything.

This introduces a drirc option to emulate a fake carveout of 256MiB to
workaround this game bug. This also adjust memory budgets by
distributing it between visible and invisible because AMDGPU reports
the same value for both when REBAR is enabled.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12091
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38627>
2025-11-26 10:12:45 +00:00
Samuel Pitoiset
9cca79d8f8 radv: fix resetting descriptor pool since the new descriptor sets allocator
RADV uses low VAs.

This fixes rendering issues and eventually GPU hangs with Detroit.

Fixes: 849d41dbf8 ("radv: implement a new descriptor sets allocator")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38650>
2025-11-26 09:09:13 +00:00
Icenowy Zheng
54077d9893 pvr: fix cleaning up failed CreateDevice
When running the Vulkan CTS test
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic ,
the driver sometimes crashes because of cleaning up sequences try to do
pvr_suballoc_bo_free() on bo's that is never initialized (thus old stale
value remains as pointer).

Fix the issues that lead to wild pointers access (a wrong cleanup
sequence and trying to free bo's that fails to be allocated).

The CTS test still fails here with "Allocations still remain, failed on
index 4274", but at least it does not crash now.

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38506>
2025-11-26 08:52:27 +00:00
Icenowy Zheng
ab9e148bfb pvr: enable samplerMirrorClampToEdge feature
This is forgotten when advertising the corresponding extension, which
leads to inconsistency, thus fail of
dEQP-VK.api.info.vulkan1p2.feature_extensions_consistency CTS testcase.

Enable the corresponding feature too. I ran all CTS tests with
"mirror_clamp_to_edge" in name, which are all skipped with NotSupported
before (because of the feature being not advertised), and gain
3695/11140 Pass with the remaining ones still NotSupported (no Fail).

This also makes the feature extension consistency CTS testcase Pass too.

Fixes: 4d34c07b7a ("pvr: advertise VK_KHR_sampler_mirror_clamp_to_edge")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38653>
2025-11-26 08:35:46 +00:00
Alyssa Rosenzweig
1574a71438 nir/lower_wrmasks: clean up & deprecate pass
The usual pass modernization with the twist that I don't want new drivers
actually using it (-:

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38533>
2025-11-26 03:20:39 +00:00
Alyssa Rosenzweig
2c2dd835af nir/lower_wrmasks: drop callback
All drivers use the same callback and it is unlikely that new drivers will use
this pass since it has better replacements today (lower_mem_bit_sizes for
memory, and it never worked for I/O). This should discourage as much.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38533>
2025-11-26 03:20:39 +00:00
Alyssa Rosenzweig
5515160b55 nir/lower_wrmasks: drop support for I/O
nir_lower_wrmasks as-is is broken for semantic I/O, since semantic I/O is slot
based and nir_lower_wrmasks is purely byte-based. No drivers use it as such, and
no drivers should. Remove the support so people don't think it works. This came
up in !38482.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38533>
2025-11-26 03:20:39 +00:00
Aitor Camacho
bdaff0b457 kk: Handle memory coherency for textures and buffers
M1 chips are more restrictive than M2 and above. We need to enforce memory
coherency when needed through "coherent" for buffer memory and
"memory_coherence_device" for textures. Without these the memory operations
are not visible to other threads.

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/38595>
2025-11-26 02:26:21 +00:00
Faith Ekstrand
3aa4be52f3 poly: Make all heap allocations atomic
All non-atomic allocations are on pretty slow paths where we only have a
single invocation running.  This means they're technically thread-safe
(assuming only a single queue) but it also means the perf of a single
allocation doesn't matter much.  However, as a bunch of things are
becoming helpers that may or may not be run in parallel for things like
multi-draw, it becomes harder to know when non-atomic is safe.  We're
probably better off using atomic allocations everywhere.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:28 +00:00
Faith Ekstrand
ed0998ca98 poly: Generalize unroll_restart() to arbitrary workgroup/subgroup sizes
The original asahi code assumed a subgroup size of 32 and a workgroup
size of 32 * 32 = 1024.  This makes doing ctz(ballot(b)) across an
entire workgroup an almost trivial operation.  On panfrost, we won't be
so blessed unless we choose a workgroup size of 16 * 16 = 256.  It's
also not clear that we want to use workgroups at all and we may better
off sticking to just subgroup parallelism and cutting out memory
bandwidth by more than half.  With the new code, the only requirement
should be that the subgroup size is a power of two (this is always true)
and that the workgroup size is an even multiple of the subgroup size.

Even though the new code looks way more complicated, thanks to the magic
of NIR constant folding, it should all fold down to the original code on
asahi and something even smaller if one opts to go for a single subgroup.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:28 +00:00
Faith Ekstrand
d9f795e6d0 poly,asahi: Pull restart unrolling into libpoly
The interface here intentionally doesn't handle multi-draw.  It's
intended that the caller will sort that out in whatever way they want to
handle multi-draw dispatches.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:28 +00:00
Faith Ekstrand
ddff3700a4 poly/asahi: Pull a bunch of vertex_id_for helpers into poly/prim.h
There's nothing really CL-specific about any of these.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:27 +00:00
Faith Ekstrand
27b2290abe poly: Move vs_grid to poly_vertex_params
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:26 +00:00
Faith Ekstrand
70a1a4013f agx: Use the new poly param helpers
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:26 +00:00
Faith Ekstrand
5b677db712 hk: Use the new poly param helpers
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:25 +00:00
Faith Ekstrand
96421876d7 poly: Add helpers for filling out poly_vertex_params
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:25 +00:00
Faith Ekstrand
fd844e0ad4 poly: Add helpers for filling out poly_geometry_params
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:24 +00:00
Faith Ekstrand
ad30ebccb6 poly,asahi: Put the indirect draw directly in the geometry params
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:24 +00:00
Faith Ekstrand
fcb107accb poly: Fetch the index size from a sysval
On asahi, we can still specialize based on the shader key and get
everything folded.  But this gives drivers the option to make it
dynamic if they wish.

Co-authored-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:23 +00:00
Faith Ekstrand
05aaa7df65 nir: Improve comments for a couple poly intrinsics
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:22 +00:00
Faith Ekstrand
735b4ec9c7 poly: Add a poly_nir_lower_sysvals() pass
There are a few sysvals which exist just so we can specialize them based
on shader keys or linking.  In the case where we can't specialize them,
this provides a pass which loads them from the appropriate poly_*_param
struct.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:22 +00:00
Faith Ekstrand
349219df6a poly: Rename poly_nir_lower_gs.h to poly_nir.h
It has all the poly NIR things so it should have a more generic name.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:21 +00:00
Faith Ekstrand
9ccac4e047 asahi: Reorder state uploads in agx_draw_patches()
The important bit here is that we move agx_update_vs() to before we
build up the poly_*_params so we have access to the final linked vertex
shader.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:21 +00:00
Faith Ekstrand
5f5054a195 SQUASH: poly,asahi: Move the output mask to poly_vertex_state
It makes more sense here along with the output buffer.  I think this
should be squashed with the previous commit (and not sure it works
without).

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:20 +00:00
Faith Ekstrand
05723bfa35 poly,asahi: Fetch directly from poly_vertex_state::output_buffer in GS
We have access to the poly_vertex_state from the GS so we might as well
use it.  Asahi uses a single poly_vertex_state for VS and TCS and just
assumes the tessellator stalls before we update it for TCS.  If a driver
wants to use two separate poly_vertex_state buffers, it will be the
driver's responsibility to make the system values return the right one.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:19 +00:00
Faith Ekstrand
89fbb9cf84 poly,asahi: Move vertex_output_buffer to poly_vertex_param
Instead of having the vertex output buffer be a system value and
something the driver needs to manage, put it in poly_vertex_param.  We
already need to have it somewhere GPU-writable so we can write it from
indirect setup kernels.  Instead of manually allocating 8B all over the
place just to hold this one pointer, stick it in poly_vertex_param.
This also lets us get rid of a NIR intrinsic.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:18 +00:00
Faith Ekstrand
8950efc006 hk: Expose the vertex param buffer to other stages
For vertex shaders, it comes from the preamble.  For geometry and
tessellation shaders it comes straight from the root table.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:17 +00:00
Faith Ekstrand
a96fd8f0a7 asahi: Upload vertex and geom/tess params together
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:16 +00:00
Faith Ekstrand
f36465d574 poly,asahi: Rename poly_ia_state to poly_vertex_params
We're about to put more than just input assembly data in there so the
name will make a lot more sense.  Also, add a comment to make it more
clear that this buffer applys to both VS and TES.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:16 +00:00
Faith Ekstrand
4716858a51 poly,asahi: Rename poly_tess_args to poly_tess_params
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38404>
2025-11-25 23:20:14 +00:00
Kenneth Graunke
3182deaae1 brw: Combine output stores for TCS outputs even when unlinked
Otherwise we get a lot of individual x/y/z stores to tesslevels when
we should really just be storing the whole thing at once.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38482>
2025-11-25 22:44:03 +00:00
Kenneth Graunke
7e02738b63 brw: Drop check for legacy tess levels from remap_patch_urb_offsets
The newly rewritten remap_tess_levels_legacy will have already lowered
anything it cares about to URB intrinsics.  So the generic remapping
pass won't see them, as it operates on generic input/output intrinsics.

This also drops some of the callback boilerplate we needed temporarily.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38482>
2025-11-25 22:44:03 +00:00
Kenneth Graunke
d95a9714c2 brw: Rewrite legacy tess level remapping
This unifies the dynamic (SSO) and fixed (linked together) versions.
We emit piles of NIR as if we were doing the dynamic version, but
replace the tess config field access with constant values.  It all
should optimize away back to something reasonable.  We lower these
directly to URB read/write intrinsics.

It also rewrites the dynamic version to directly read/write the URB
rather than going through temporaries.  The old version was broken
in that tessellation control shader invocations can technically use
the shared output area for cross-invocation data sharing with barriers,
although doing so using the built-in tesslevel patch outputs is very
unlikely.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38482>
2025-11-25 22:44:03 +00:00
Kenneth Graunke
ee407481c2 brw: Switch to URB intrinsics for TCS inputs
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38482>
2025-11-25 22:44:02 +00:00
Kenneth Graunke
943b2acf02 brw: Switch to NIR URB intrinsics for TES inputs
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38482>
2025-11-25 22:44:01 +00:00
Kenneth Graunke
c0d69b2faf brw: Switch to NIR URB intrinsics for TCS outputs
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38482>
2025-11-25 22:44:01 +00:00