Daniel Schürmann
e1a692f74b
nir/opt_offsets: allow for unsigned wraps when folding load/store_shared2_amd offsets
...
Totals from 131 (0.16% of 79839) affected shaders: (Navi48)
Instrs: 217026 -> 216541 (-0.22%); split: -0.24%, +0.01%
CodeSize: 1150136 -> 1146772 (-0.29%); split: -0.31%, +0.02%
Latency: 4225732 -> 4225549 (-0.00%); split: -0.01%, +0.00%
InvThroughput: 840231 -> 839823 (-0.05%); split: -0.05%, +0.00%
VClause: 3815 -> 3816 (+0.03%)
Copies: 15414 -> 15358 (-0.36%); split: -0.38%, +0.02%
PreSGPRs: 6322 -> 6323 (+0.02%)
PreVGPRs: 6064 -> 6062 (-0.03%)
VALU: 117317 -> 116873 (-0.38%); split: -0.40%, +0.02%
SALU: 25384 -> 25331 (-0.21%); split: -0.22%, +0.02%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37453 >
2025-09-24 14:28:24 +00:00
Rhys Perry
7538167096
nir: add NIR_DEBUG=progress_validation
...
Fails if a shader was changed but the pass didn't report progress.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069 >
2025-09-24 08:20:28 +00:00
Rhys Perry
706ba80057
nir: fix NIR_DEBUG=extended_validation
...
This broke after divergence became metadata because the divergence
analysis pass does not support all instructions.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069 >
2025-09-24 08:20:28 +00:00
Rhys Perry
026e2527bf
nir/opt_if: rewrite progress reporting and metadata invalidation
...
This would unconditionally invalid all metadata except
nir_metadata_control_flow and then invalidate that if opt_if_safe_cf_list
and opt_if_regs_cf_list made no progress.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069 >
2025-09-24 08:20:27 +00:00
Rhys Perry
da23b17c8b
nir/opt_if: fix progress reporting with multiple function impls
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069 >
2025-09-24 08:20:27 +00:00
Rhys Perry
12ee2b0fd4
nir: fix progress reporting in nir_io_add_const_offset_to_base
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069 >
2025-09-24 08:20:27 +00:00
Pierre-Eric Pelloux-Prayer
81f3a5a035
nir/opcodes: remove invalid comment
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
"\b" is interpreted by python which results in an invalid char being
written to the C file.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331 >
2025-09-23 09:09:55 +02:00
Pierre-Eric Pelloux-Prayer
cc4b50b023
nir/opcodes: use u_overflow to fix incorrect checks
...
Operands of an addition will be promoted to int making the a+b<a
kind of checks ineffective.
Use u_overflow.h helpers to perform the check correctly.
The commit would be simpler if it used __typeof__ like so:
util_add_check_overflow(__typeof__(src0), src0, src1)
But typeof only became a standard in C23 so this commit instead extends
nir_opcodes a bit to allow opcodes that need the dest_type to get it.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331 >
2025-09-23 09:09:55 +02:00
Caleb Callaway
97b4a6d0e3
compiler: SPIR-V shader replacement
...
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36472 >
2025-09-22 19:06:07 +00:00
Caleb Callaway
72a43c76c2
compiler: auto-stage file ext for SPIR-V capture
...
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36472 >
2025-09-22 19:06:07 +00:00
Caleb Callaway
df2f7bda4f
compiler: BLAKE3 ID for SPIR-V capture
...
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36472 >
2025-09-22 19:06:07 +00:00
Caleb Callaway
16a855ae61
compiler: use PATH_MAX for SPIR-V capture filename
...
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36472 >
2025-09-22 19:06:07 +00:00
Simon Perretta
7b7fb811ab
pvr, pco: switch to clc load/store sr and idfwdf shaders
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439 >
2025-09-22 14:52:05 +01:00
Simon Perretta
c2127bf4f7
pvr, pco: switch to usc generated clear attachment shaders
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439 >
2025-09-22 14:52:04 +01:00
Simon Perretta
6dd0a5ee2d
pvr, pco: switch to clc query shaders
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439 >
2025-09-22 14:52:04 +01:00
Simon Perretta
3fd3d7ee69
pvr, pco: switch to clc vertex passthrough shaders
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439 >
2025-09-22 14:52:04 +01:00
Simon Perretta
96e4026273
nir: print loop unroll info if present
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37439 >
2025-09-22 14:52:03 +01:00
Qiang Yu
d52452a486
glsl: allow barrier builtin functions for mesh shader
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:50 +00:00
Qiang Yu
9ffbf9f96b
glsl: translate mesa stage for mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:50 +00:00
Qiang Yu
ecb1322737
glsl: flat qualifier is not needed for per primitive IO
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:50 +00:00
Qiang Yu
521aa2e010
glsl: no xfb buffer qualifier for mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:50 +00:00
Qiang Yu
8c58bd5acf
glsl: lower shared and task playload for mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:49 +00:00
Qiang Yu
2b76809dfc
glsl: handle explicit location for mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:49 +00:00
Qiang Yu
bd365d1d2a
glsl: handle mesh shader when optimize varying
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:49 +00:00
Qiang Yu
6176b85d2c
glsl: add mesh pipeline varying linkage
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:48 +00:00
Qiang Yu
6e41854f1d
glsl: pack varying limit check code into functions
...
To be shared with mesh shader linkage.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:48 +00:00
Qiang Yu
59f1186af2
glsl: pack vertex pipeline varying linkage into a function
...
No functional change, prepare for add mesh pipeline varying
linking.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:48 +00:00
Qiang Yu
c6b24b4cc2
glsl: disable mesh shader output remove when separate shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:47 +00:00
Qiang Yu
38d385673f
glsl: validate MS/FS interstage in/out variable type
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:46 +00:00
Qiang Yu
6da726c59c
glsl: handle per primitive varying when link
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:46 +00:00
Qiang Yu
faa9fea7d2
glsl: validate MS/FS interstage in/out block
...
Mesh shader output block is always in array type, need
to validate if the mesh shader output array element type
match the fragment shader input type.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:45 +00:00
Qiang Yu
ae3c0ac9e9
glsl: gl_nir_link_glsl handle mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:45 +00:00
Qiang Yu
5b87ef9560
glsl: nir_build_program_resource_list support mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:44 +00:00
Qiang Yu
30fde159eb
glsl: add mesh shader builtin functions
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:44 +00:00
Qiang Yu
69127db647
glsl: handle mesh shader output block
...
Mainly redeclare of gl_MeshPerVertexEXT and gl_MeshPerPrimitiveEXT.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:43 +00:00
Qiang Yu
0e26c48d79
glsl: assign mesh shader output variable array size
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:42 +00:00
Qiang Yu
6a2bf2024d
glsl: add mesh shader builtin outputs
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:42 +00:00
Qiang Yu
c260aa3928
glsl: add input builtin variables for mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:42 +00:00
Qiang Yu
691601e89e
glsl: handle work group in layout for mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:41 +00:00
Qiang Yu
611370965f
glsl: handle max_vertices/primitives for mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:40 +00:00
Qiang Yu
de22e59231
glsl: handle mesh shader primitive type layout qualifier
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:39 +00:00
Qiang Yu
c2a35ae70d
glsl: allow shared variables in task and mesh shader
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:38 +00:00
Qiang Yu
6415cec230
glsl: handle PerPrimitiveEXT qualifier
...
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:37 +00:00
Qiang Yu
b2e9a6d935
glsl: handle taskPayloadSharedEXT variables
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:36 +00:00
Qiang Yu
2b8c273322
glsl: prepare parse state for mesh shader
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36405 >
2025-09-22 02:19:35 +00:00
Timur Kristóf
da184ddbe4
spirv: Always mark FS layer and viewport index inpus as flat
...
The spec requires these to be decorated as FLAT,
but some apps forgot to set that,
eg. old DXVK before d12a8e09a855
Let's unconditionally decorate these FS inputs as FLAT
in spirv_to_nir, we can do that for free and prevent those
apps from crashing RADV.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33205 >
2025-09-19 14:59:12 +02:00
Timothy Arceri
870ce22754
nir: fix uniform cloning helper again
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
UBOs in different stages can have the same instance name for
different UBOs so here we make sure to also check that types match
before deciding we have a match.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13254
Fixes: b47b8d16d9 ("nir: expose reusable linking helpers for cloning uniform loads")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37428 >
2025-09-18 22:28:54 +00:00
Alyssa Rosenzweig
c0c70cb392
nir/lower_flatshade: clean up
...
while in the area.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37448 >
2025-09-18 13:37:03 +00:00
Mary Guillemard
d9b11cd7a2
nir/print: Fix load_converted_output_pan and load_readonly_output_pan
...
We were not printing IO infos properly for those intrinsics.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37452 >
2025-09-18 10:41:50 +00:00
Gert Wollny
3b3c3ccf56
nir+r600: add option to avoid contracting fabs into ffma
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
On r600 ternary operations can't use the fabs source modifier, so
converting "fadd(fabs(fmul(a, b), c)" to "ffma(fabs(a), fabs(b), c)"
adds one more instruction in the backend, hence avoid this.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37440 >
2025-09-17 21:03:58 +00:00