Romaric Jodin
cb86341829
meson: remove '--outdir' argument in script
...
Usage of '--outdir' argument in python scripts makes it very
complicated for tools like ninja-to-soong to generate the Android
equivalent build file.
This is because the option is less clear on what will be generated.
Instead, change it for '--out' where we give the full path of the file
to generate. This has the good point of deduplicating the locations of
the file name to have it only in 'meson.build'.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37741 >
2025-10-08 20:51:20 +00:00
Mike Blumenkrantz
8f0ac427b3
glsl: fix gl_ViewID_OVR type to uint
...
the spec defines this as a uint, and having it as an int breaks anyone
trying to actually use it
cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37766 >
2025-10-08 16:58:52 +00:00
Marek Olšák
3fe651f607
nir: remove load_smem_amd
...
replaced by load_global_amd + ACCESS_SMEM_AMD
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36936 >
2025-10-08 08:54:11 +00:00
Daniel Schürmann
7593667b0a
nir/divergence_analysis: check ACCESS_SMEM_AMD
...
Revert "nir/divergence: make smem load_global_amd uniform"
This reverts commit 2d0f93631c .
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36936 >
2025-10-08 08:53:55 +00:00
Daniel Schürmann
cacb390ec9
nir/load_store_vectorize: Fix parsing offsets through u2u64
...
Fixes: cfba417316 ('nir/load_store_vectorize: optimize accesses with u2u64(ishl.nuw(iadd))')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36936 >
2025-10-08 08:53:51 +00:00
Rhys Perry
8fba196164
nir: assume non-atomic loads don't tear
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36602 >
2025-10-07 17:41:30 +00:00
Rhys Perry
21187c4662
nir,vtn: add shader_info::assume_no_data_races
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> (nir)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36602 >
2025-10-07 17:41:30 +00:00
Rhys Perry
e9d72ea65d
vtn: set ACCESS_ATOMIC
...
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36602 >
2025-10-07 17:41:30 +00:00
Rhys Perry
0dd09a292b
nir: add ACCESS_ATOMIC
...
This is so that passes and backends can tell if a coherent load/store is
atomic or not, instead of having to assume it could be either.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36602 >
2025-10-07 17:41:30 +00:00
Samuel Pitoiset
e868e8d946
nir: adjust nir_tex_instr_need_sampler() for AMD FMASK instructions
...
These instructions don't need a sampler.
This doesn't fix anything now because this helper isn't unused yet, but
it will help for descriptor heap.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37720 >
2025-10-07 15:22:47 +00:00
Georg Lehmann
84f26ed117
nir: optimize atomic isub if supported
...
Foz-DB Navi48:
Totals from 1 (0.00% of 80287) affected shaders:
Instrs: 1641 -> 1637 (-0.24%)
CodeSize: 8472 -> 8456 (-0.19%)
Latency: 19132 -> 19131 (-0.01%)
InvThroughput: 9566 -> 9565 (-0.01%)
Copies: 126 -> 125 (-0.79%)
VALU: 565 -> 563 (-0.35%)
SALU: 439 -> 438 (-0.23%)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37702 >
2025-10-07 14:07:56 +00:00
Georg Lehmann
b0d3db3733
nir: add atomic isub
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37702 >
2025-10-07 14:07:56 +00:00
Lionel Landwerlin
94f8d0072d
nir: add pass to propagate image format to intrinsics
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36773 >
2025-10-07 08:54:26 +00:00
Lionel Landwerlin
0922a0dd50
nir/lower_tex: remove unused options
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37692 >
2025-10-03 20:19:03 +00:00
Lionel Landwerlin
97dde5bc10
nir/lower_tex: add an callback to lower txd ops
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37692 >
2025-10-03 20:19:02 +00:00
Karol Herbst
1db77d08e2
clc: Fix createDiagnostics for LLVM-22
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13986
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37690 >
2025-10-03 18:44:30 +00:00
Daniel Schürmann
0e3bc3d8c0
nir/opt_offsets: call allow_offset_wrap() for try_fold_shared2()
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This prevents applying wrapping offsets on GFX6.
Fixes: e1a692f74b ('nir/opt_offsets: allow for unsigned wraps when folding load/store_shared2_amd offsets')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37667 >
2025-10-03 07:54:12 +00:00
Kenneth Graunke
25cb6dfbf7
nir: Add load_simd_width_intel to divergence analysis
...
For some reason we missed adding this. This prevents some asserts
from triggering when I call divergence analysis at certain points
in an upcoming patch.
Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36750 >
2025-09-30 19:44:02 +00:00
sjfricke
05ea82a766
nir: Fix gnu-empty-initializer warning
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Found with clang 14
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37615 >
2025-09-30 19:09:31 +00:00
Ella Stanforth
082e6369f9
nir: add v3d specific intrinsic normalised to float conversion
...
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35820 >
2025-09-30 12:48:42 +00:00
Simon Perretta
a1acd6f8d1
pvr, pco: add primitive support for VK_KHR_robustness2.nullDescriptor
...
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/37512 >
2025-09-30 12:15:54 +00:00
Simon Perretta
2a7ebf2ae0
nir/lower_alpha: extend to support dynamic a2c
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37512 >
2025-09-30 12:15:53 +00:00
Simon Perretta
6dc5e1e109
pco: fully support Vulkan 1.2 image atomics
...
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/37512 >
2025-09-30 12:15:48 +00:00
Aitor Camacho
06dbd4c33c
nir: Set cursor in lower_sampler_lod_bias
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37494 >
2025-09-29 23:24:52 +00:00
Simon Perretta
b111b8a844
pvr, pco: implement prerequisites for sampleRateShading
...
- Implement load_interpolated_input and friends.
- Optimize load_barycentric_* cases that can be simplified.
- Initial support for non-standard sample locations.
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37540 >
2025-09-27 23:45:54 +01:00
Simon Perretta
83aecc8f3f
mesa/st, nir: commonize unlower_io_to_vars pass
...
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37540 >
2025-09-27 23:45:54 +01:00
Faith Ekstrand
8ef811b02a
spirv: Add support for OpBitcast in OpSpecConstantOp
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is required for OpenCL but not Vulkan. This fixes a bunch of
OpenCL CTS fails using the SPIR-V back-end in LLVM as opposed to
SPIRV-LLVM-Translator.
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37555 >
2025-09-27 13:45:12 +00:00
Aleksi Sapon
8949473023
nir: Fix nir.h MSVC compilation for C++ source files
...
This kind of C initializer is not accepted by MSVC in C++ mode.
Fixed: 75292ae7 ("nir: Fix gnu-empty-initializer warning ")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37604 >
2025-09-26 18:25:22 +00:00
Georg Lehmann
46a4569c22
nir/opt_undef: prefer 0 over NaN for pack_half_2x16_rtz_split
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Using NaN doesn't usually allow any extra optimizations, and 0 is an inline
constant on AMD hw where this opcode is used with undef for fragment shader
exports.
Foz-DB GFX1201:
Totals from 889 (1.11% of 80287) affected shaders:
Instrs: 1676365 -> 1676348 (-0.00%)
CodeSize: 8827040 -> 8821760 (-0.06%)
Latency: 13346728 -> 13346699 (-0.00%)
InvThroughput: 1799283 -> 1799262 (-0.00%)
Copies: 108125 -> 108102 (-0.02%)
VALU: 974875 -> 974852 (-0.00%)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37552 >
2025-09-26 15:11:26 +00:00
Aleksi Sapon
75292ae7e4
nir: Fix gnu-empty-initializer warning
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This also causes a build error on older MSVC.
Fixes: 75381670 ("nir,rusticl: NIR_PASS/nir_pass! validation fixes and improvements")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37569 >
2025-09-25 18:14:22 +00:00
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