Caio Oliveira
2506540566
brw: Repack brw_inst fields
...
In Release build, goes from 72 to 64 bytes, and now fits
in a single cacheline.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:05 +00:00
Caio Oliveira
8ded571ef4
brw: Allocate only brw_inst for BASE instructions
...
Now that all the other kinds were added, all transforms to SEND will
come from non-BASE kinds, so we don't need overallocate for BASE
instructions.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:05 +00:00
Caio Oliveira
08c0f33874
brw: Add a generic LOGICAL instruction kind
...
This kind of instruction doesn't have a special struct but
will still be always allocated so that it can be lowered to SEND.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:05 +00:00
Caio Oliveira
df2b5fb03f
brw: Add brw_fb_write_inst
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:04 +00:00
Caio Oliveira
d06c0a370e
brw: Add brw_urb_inst
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:04 +00:00
Caio Oliveira
90967e7b16
brw: Add brw_load_payload_inst
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:03 +00:00
Caio Oliveira
388bac06ce
brw: Add brw_dpas_inst
...
Fixed the types in brw_inst::bits so the struct is packed correctly.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:03 +00:00
Caio Oliveira
09a26526cc
brw: Add brw_mem_inst
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:02 +00:00
Caio Oliveira
f0f1e63f99
brw: Add brw_tex_inst
...
Incorporate some "control sources" directly into the instruction.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:02 +00:00
Caio Oliveira
0fcce2722f
brw: Add brw_send_inst
...
Move all the SEND specific fields from brw_inst into brw_send_inst.
This new instruction kind will contain all variants of SENDs plus the
virtual opcodes that were already relying on those SEND fields.
Use the `as_send()` helper to go from a brw_inst into the brw_send_inst
when applicable. Some of the code was changed to use the brw_send_inst
type directly.
Until other kinds are added, all the instructions are allocated the same
amount of space as brw_send_inst. This ensures that all
brw_transform_inst() calls are still valid. This will change after
a few patches so that BASE instructions can use less memory.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:01 +00:00
Caio Oliveira
b27f6621ae
brw: Add initial support for different instruction kinds
...
Prepare code for supporting subclasses of brw_inst for certain
specialized kinds of instructions. This will allow
- Move certain fields from brw_inst to the specialized one,
reducing its size and making it easy to understand what applies
to which instruction;
- Move certain control sources into the specialized inst type, which
currently take a full brw_reg to encode small integers. Reducing
the overall sources we walk and care also might help the code
in general.
Next commits will add the new instruction kinds.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:01 +00:00
Caio Oliveira
339a4e8680
brw: Remove the extra function call when lowering samplers
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:00 +00:00
Caio Oliveira
71c23c6722
brw: Add brw_builder::URB_READ and URB_WRITE helpers
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:25:00 +00:00
Caio Oliveira
f92116832f
brw: Add brw_builder::SEND() helper
...
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:59 +00:00
Caio Oliveira
e194909b3f
brw: Add and use brw_transform_inst()
...
The new function takes care of changing an instruction opcode and sources,
which will allow later patches to tweak how allocations are done in
those cases. Like the instruction allocation, this also takes a shader
(or a builder, for it to get a shader).
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:59 +00:00
Caio Oliveira
5d0160a87f
brw: Pass brw_shader in fold_instruction
...
Will be used later for the general instruction transforming
function.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:58 +00:00
Caio Oliveira
8f16cac492
brw: Allow emit instruction with only number of sources
...
The emit will allocate the necessary number of sources but will
let the caller fill them in.
Change a couple of places to take advantage of that.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:58 +00:00
Caio Oliveira
3ef86a8d00
brw: Let the builder fill the sources of brw_inst
...
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:58 +00:00
Caio Oliveira
506fce20f0
brw: Bundle the allocation of brw_inst and its sources
...
Flatten all the work being done into brw_new_inst() and
brw_clone_inst() and allocate both the instruction and
the sources in one swoop.
For now we still keep a pointer to the array instead of
declaring an array as last element to still allow growing
the array -- which is used by the compiler in a few places.
This commit removes the constructors for brw_inst, the idea
is that the instructions are managed by the brw_shader, so
we always go through it for new ones.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:57 +00:00
Caio Oliveira
c81c8c917f
brw: Remove builtin sources from brw_inst
...
A later patch will add a different mechanism to achieve the same
goal.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:57 +00:00
Caio Oliveira
858162a2fc
brw: Allocate brw_inst::src with ralloc
...
In the few cases we have to _increase_ the number of sources, the new
code will not attempt to recollect the memory, i.e. it delays freeing
the old smaller one source array. For the instructions that may need
this (when making a SEND into a SEND_GATHER), this is not expected to
happen more than once.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:56 +00:00
Caio Oliveira
29c12bbebf
brw: Centralize brw_inst allocation
...
Add and use brw_new_inst() and brw_clone_inst() and do not use stack
allocated brw_insts. The builder was changed to not use the temporary
ones either.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:56 +00:00
Caio Oliveira
c90ec6d7e7
brw: Use uint16_t for size_written
...
UINT16_MAX is larger than the maximum number of bytes in the
general register file: 256 GRFs * 16 slots * 4 bytes = 16384.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:55 +00:00
Kenneth Graunke
6281a12822
brw: Remove brw_inst::no_dd_check/no_dd_clear
...
These dependency hints were primarily useful for the vec4 backend, where
it was common to write subsets of a vec4's components across multiple
instructions. In the scalar backend, we rarely used them. They also no
longer exist on Tigerlake and later in favor of software scoreboarding.
Dropping this allows us to clean up the IR a bit.
We still use the hardware hints in the generator in a couple places:
- Gfx9-12.0 scratch headers
- Quad swizzles
- Indirect MOV lowering
In theory we might want them back if we moved that lowering to the IR.
For scratch at least, I suspect it won't have a huge impact, as we're
already incurring the cost of spills/fills. The others are fairly rare
as well, so it may not be worth keeping.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730 >
2025-09-12 00:24:55 +00:00
Gert Wollny
b26c68e40a
r600/sfn: Filter lowering of b2f32(comp(x,y)) for 64 bit sources
...
Instead of skipping later, we can filter these instructions right away.
Fixes: 51d8ca2dff ("r600/sfn: optimize comparison results")
Signed-off-by: Gert Wollny <gert.wollny@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37298 >
2025-09-11 23:00:21 +00:00
Sagar Ghuge
99cd6ffd1f
isl: Respect driconf option for EnableSamplerRoutetoLSC
...
For EnableSamplerRoutetoLSC, we do check driconf option. Buffer state
setup is just missing that option so add check for that too.
Fixes: 7934b70f ("isl/iris/anv: provide drirc toggle intel_sampler_route_to_lsc")
Cc: mesa-stable
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com >
Reviewed-by: Caleb Callaway <caleb.callaway@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37190 >
2025-09-11 20:31:51 +00:00
Danylo Piliaiev
715b8ba539
egl: Bring back util_cpu_trace_init
...
Partially reverts "perfetto: unify init". EGL lib uses perfetto,
but after the change, util_cpu_trace_init doesn't happen inside
libEGL.so, so when it tries to use perfetto, it crashes.
Perfetto initialization happens inside other Mesa's libs, but
each lib that uses perfetto must initialize it.
Fixes: c7045e3e63 ("perfetto: unify init")
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37303 >
2025-09-11 19:49:51 +00:00
Mike Blumenkrantz
32b4412d54
zink: update gfx pipeline less frequently
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37308 >
2025-09-11 18:21:40 +00:00
Mike Blumenkrantz
b497a81dd1
zink: make find_completed_batch_state() only return state for COPY_ONLY ctx
...
COPY_ONLY has no descriptor support, so these states cannot be recycled
like the others
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37306 >
2025-09-11 17:54:22 +00:00
Mike Blumenkrantz
13ea671b68
zink: simplify state iterating in find_completed_batch_state()
...
this is a bit easier to read
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37306 >
2025-09-11 17:54:22 +00:00
Mike Blumenkrantz
a6918f1bed
zink: don't init batch descriptors for copy contexts
...
these are never used and waste memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37306 >
2025-09-11 17:54:22 +00:00
Eric Engestrom
2fe2ab2bd0
zink+nvk/ci: update test expectations
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
d195e64278
zink+turnip/ci: update test expectations
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
11a7693065
turnip/ci: update test expectations
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
f21d4d78b0
etnaviv/ci: update test expectations
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
26f04c213d
broadcom/ci: update test expectations
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
4db3851b5a
zink+lvp/ci: document recent flakes
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
bea53ef23c
broadcom/ci: document recent flakes
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
6ecb7f11b7
radv/ci: document recent flakes
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
ce39a7e2a8
zink+radv/ci: document recent flakes
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Eric Engestrom
bcb66ddd28
zink+radv/ci: sort vangogh flakes
...
removes noise out of the next commit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37302 >
2025-09-11 16:02:38 +00:00
Samuel Pitoiset
d46a114206
zink/ci: mark one test as crash/flake for turnip a618
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174 >
2025-09-11 15:21:50 +00:00
Samuel Pitoiset
c122d70dfd
radv: set radv_gfx12_hiz_wa=partial for some games to mitigate performance loss
...
The full workaround can hurt performance and there is no other known
solution. The only one is to select which HiZ WA works the best by
trial and error.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174 >
2025-09-11 15:21:50 +00:00
Samuel Pitoiset
b00b8c763b
radv: disable radv_disable_hiz_his_gfx12 for Mafia Definition Edition
...
This should be properly fixed now. Also remove this drirc option which
should no longer be needed.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174 >
2025-09-11 15:21:50 +00:00
Samuel Pitoiset
ec09ac1501
radv: switch to the full HiZ workaround by default on GFX12
...
The full HiZ workaround is the only one that fixes the issue reliably.
Sadly, the performance results are mixed and sometimes it hurts. To
maintain performance, RADV will opt-in by selecting which workarounds
to apply from drirc.
As we can't know the full list of games that will be affected by a
potential performance regression, users are encouraged to try with
RADV_GFX12_HIZ_WA (see Mesa documentation for more explanations).
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174 >
2025-09-11 15:21:50 +00:00
Samuel Pitoiset
5f8f4686bf
radv: replace RADV_GFX12_HIZ_WA by a drirc option
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174 >
2025-09-11 15:21:50 +00:00
Samuel Pitoiset
0a2ef363a8
radv: report an message when RADV_GFX12_HIZ_WA value is invalid
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174 >
2025-09-11 15:21:50 +00:00
Erik Faye-Lund
fc0418a69f
aux/pp: fixup sampler-view release
...
Without this, the prost-processing mechanism crashes badly, whoops.
Fixes: 73da0dcddc ("gallium: eliminate frontend refcounting from samplerviews")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37290 >
2025-09-11 13:44:55 +00:00
Karol Herbst
b584b47d01
rusticl/mem: fix Image::read for 1Darray images
...
Some drivers do not return identical strides when mapping 1Darray images
leading to data being written in the wrong place.
Cc: mesa-stable
Tested-by: Rob Clark <rob.clark@oss.qualcomm.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37284 >
2025-09-11 09:26:30 +00:00
Samuel Pitoiset
ec87f1338f
radv: emit more push shader registers on GFX12
...
They are supposed to be slightly faster.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37256 >
2025-09-11 06:47:40 +00:00