Alyssa Rosenzweig
5555769102
nir: add workgroup size to functions
...
for cl kernel libraries with many entrypoints. spirv can represent, nir should
be able to as well.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32382 >
2024-11-27 20:02:05 +00:00
Alyssa Rosenzweig
d248618d81
nir/print: print parameter names in calls
...
if we have them. example:
call libagx_geometry_input_address %10, p %3, vtx %9, location %0 (0x0)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32208 >
2024-11-20 16:53:51 +00:00
Alyssa Rosenzweig
6b35d7eb13
nir/print: annotate entrypoints
...
we can have multiple in a collection of OpenCL kernels.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32208 >
2024-11-20 16:53:51 +00:00
Alyssa Rosenzweig
eebfbf5ecd
nir/print: print function signature
...
parameter dimensions and names if we have them. example:
decl_function libagx_geometry_input_address (64 return, 64 p, 32 vtx, 32 location)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32208 >
2024-11-20 16:53:51 +00:00
Marek Olšák
dacae272bf
nir: add nir_io_semantics::fb_fetch_output_coherent
...
Lowering IO should preserve this. Freedreno needs it.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32173 >
2024-11-19 23:48:38 +00:00
Marek Olšák
18f3c92b87
nir/print: print fb_fetch_output for variables
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32173 >
2024-11-19 23:48:38 +00:00
Rhys Perry
d3ae1842a2
aco,ac/nir: flag loads to use smem in NIR
...
This pass will be re-used later.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31904 >
2024-11-13 12:59:26 +00:00
Konstantin Seurer
cf447c5da1
nir: Do not gather source locations for phis
...
Phi instructions are expected to be the first instructions in a block.
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29298 >
2024-11-11 08:39:14 +00:00
Konstantin Seurer
f2c204daf0
nir: Add a first_line parameter to gather_debug_info
...
Useful when the file contains multiple shaders.
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29298 >
2024-11-11 08:39:14 +00:00
Konstantin Seurer
d44f74896e
nir: Add missing access flags to print_access
...
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30509 >
2024-11-11 07:53:13 +00:00
Marek Olšák
aee1ebb992
nir: print interp_mode better
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31968 >
2024-11-05 14:13:40 +00:00
Daniel Schürmann
c25c63ebc0
nir/divergence: separately indicate whether loops have divergent continues or breaks
...
bool nir_loop_is_divergent(nir_loop *)
replaces the previous loop->divergent indicator.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30787 >
2024-10-24 10:06:17 +00:00
Marek Olšák
fb6184f89c
nir: add shader_info::tess::tcs_same_invocation_inputs_read(_indirect)
...
We need both the same-invocation usage mask and cross-invocation usage
mask. The AMD reason is below.
Cross-invocation TCS input access doesn't prevent the same-invocation
fast path in AMD hw because it's just a different way to load the same
data, and we want to use both paths for the same TCS input based on
the load instruction. The fast path can't be used for indirect access,
which is gathered separately for same-invocation access.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31645 >
2024-10-21 18:53:51 +00:00
Georg Lehmann
bf0d1a42b4
nir: remove uses_fddx_fddy
...
Unused and the code didn't even do what the comment said.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31014 >
2024-10-17 09:50:19 +00:00
Konstantin Seurer
70a1453537
nir/print: Fix the alignment of 8-bit definitions
...
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31612 >
2024-10-14 21:21:04 +00:00
Caio Oliveira
74be809237
compiler: Allow derivative_group to be used for all stages in shader_info
...
These will now also be used by stages that have workgroups.
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30950 >
2024-09-03 20:03:18 +00:00
Konstantin Seurer
81e3930ec0
nir/print: Add a helper for generating debug info
...
Prints the shader to a string and assigns source locations based on
that.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903 >
2024-08-25 10:26:33 +00:00
Konstantin Seurer
ce24486ee4
nir: Introduce nir_debug_info_instr
...
Adds a new instruction type that stores metadata that might be useful
for debugging purposes. Passes must ignore these instructions when
making decisions.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903 >
2024-08-25 10:26:33 +00:00
Timothy Arceri
017770ff14
nir: add nir_tex_src_{sampler,texture}_deref_intrinsic
...
To be used as a placeholder until after function inlining so we can
replace function params with bindless handles if needed.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30315 >
2024-07-29 00:06:10 +00:00
Marek Olšák
b2d32ae246
nir: add nir_intrinsic_load_per_primitive_input, split from io_semantics flag
...
Instead of having 1 bit in nir_io_semantics indicating a per-primitive
FS input, add a dedicated intrinsic for it.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29895 >
2024-07-23 16:13:16 +00:00
Daniel Schürmann
7af16e9f1e
nir/shader_info: remove uses_demote
...
This flag is mostly redundant with uses_discard and was only
introduced to implement demote with LLVM when it didn't have
that intrinsic.
Reviewed-by: Marek Olšák <marek.olsak@amd.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/27617 >
2024-06-17 19:37:16 +00:00
Faith Ekstrand
290cbf413c
nir/print: Improve divergence information
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591 >
2024-06-13 20:43:44 +00:00
Alyssa Rosenzweig
2912f531a7
nir: add texops for AGX border colour emulation
...
AGX has limited border colour hardware. To support full
customBorderColorWithoutFormat semantics, we're forced to emulate in shaders at
a substantial performance penalty. Actually, that's needed just to pass CTS
because of other hardware issues stacking on top of each others... Hooray!
Add the texops we need to facilitate efficient custom border colour lowering.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29179 >
2024-05-14 04:57:24 +00:00
Saroj Kumar
221371e903
mesa: replace shader_info::source_sha1
...
Replace shader_info::source_sha1 with shader_info::source_blake3 in compiler, mesa and radeonsi.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28156 >
2024-05-09 20:08:18 +00:00
Marek Olšák
1a791c1303
nir: add nir_atomic_op_ordered_add_gfx12_amd
...
for streamout
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28889 >
2024-04-30 17:17:25 +00:00
Marek Olšák
d4cfcbdde8
nir: add ACCESS_CP_GE_COHERENT_AMD
...
required by amd gfx12
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28889 >
2024-04-30 17:17:25 +00:00
Konstantin Seurer
ea863c0c1c
nir/print: Do not access invalid indices of load_uniform
...
load_uniform does not have io_semantics and component.
Fixes: a83fd26 ("nir/print: stop trying to match i/o vars using base/driver_location")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28962 >
2024-04-28 16:06:46 +02:00
Mike Blumenkrantz
cb597cb85e
nir/print: print io instr->name if available
...
this will always be more accurate than trying to find the name from
a variable
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28814 >
2024-04-24 12:35:59 +00:00
Mike Blumenkrantz
a83fd26d0e
nir/print: stop trying to match i/o vars using base/driver_location
...
this is broken
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28552 >
2024-04-18 15:30:47 +00:00
Mike Blumenkrantz
6ae2147dd6
nir: print i/o variables in location order
...
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25036 >
2024-04-17 00:46:40 +00:00
Timur Kristóf
723b3d354e
nir/print: Print per-primitive and explicit strict IO info.
...
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28685 >
2024-04-14 19:51:11 +00:00
Konstantin Seurer
1ff8659f41
nir/print: Fix printing booleans with bit_size>1
...
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187 >
2024-04-09 07:13:01 +00:00
Faith Ekstrand
b069151e62
nir/print: Inline print_ssa_use()
...
It has one caller.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28300 >
2024-03-25 15:55:48 +00:00
Alyssa Rosenzweig
49a89911c4
nir/print: do not print empty lists on intrinsics
...
before:
32 %0 = @load_vertex_id () ()
after:
32 %0 = @load_vertex_id
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27925 >
2024-03-12 19:00:26 +00:00
Marek Olšák
813f37a8ed
nir: add nir_block::divergent to indicate a divergent entry condition
...
to be used by nir_opt_varyings
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049 >
2024-03-12 00:29:03 +00:00
Marek Olšák
936690f733
nir: print nir_io_semantics::invariant
...
this was missing
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28049 >
2024-03-12 00:29:03 +00:00
Lionel Landwerlin
259cdc5496
nir: add additional flag to resource_intel for embedded samplers
...
This will enable specific lowering of embedded samplers.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22151 >
2024-02-29 07:05:06 +00:00
Sagar Ghuge
c984d6e2fc
nir: Drop intel specific lowering code
...
In previous patches, we have moved the Intel specific lowering code in
brw_nir_lower_texture file. We can go ahead and drop the Intel specific
texture source too.
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27458 >
2024-02-12 21:25:48 +00:00
Ian Romanick
c8ba2bc2f0
nir: Pack texture LOD and array index to a single 32-bit value
...
v2: Fix clamped_ai calculation in nir_lower_tex.c. Add
nir_tex_src_combined_lod_and_array_index_intel to
print_tex_instr. Suggested by Sagar.
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27305 >
2024-02-02 02:39:10 +00:00
Konstantin Seurer
e3c2dc2324
nir/print: Rename workgroup-size to workgroup_size
...
Every other field uses _ instead of -.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27318 >
2024-01-30 21:19:40 +00:00
Konstantin Seurer
449e44d6d3
nir/print: Don't print shared_size twice
...
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27318 >
2024-01-30 21:19:40 +00:00
Marek Olšák
b6e98677c3
nir/print: print PATCH0 and VARn_16BIT names instead of numbers for TCS and TES
...
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26275 >
2023-11-25 09:50:19 -05:00
Daniel Schürmann
f1110576d9
nir: add info.fs.require_full_quads
...
This flag indicates the requirement of helper invocations
in fragment shaders, independent from any present instructions.
This fixes the lowering of OpGroupNonUniformQuad* instructions.
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26026 >
2023-11-22 11:31:52 +01:00
Daniel Schürmann
1179d83a89
nir: remove info.fs.needs_all_helper_invocations
...
Use info.uses_wide_subgroup_intrinsics instead.
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26026 >
2023-11-22 11:31:11 +01:00
Alyssa Rosenzweig
8d9d9d0207
nir/print: handle adjacency
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056 >
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
6014f745d5
nir,vtn: Add exported bool to nir_function
...
For optimizing libraries.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498 >
2023-11-02 11:37:46 +00:00
Faith Ekstrand
1a2e8290ab
nir: Add NV-specific texture opcodes
...
These are for implementing various texture queries.
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000 >
2023-10-24 22:21:18 +00:00
Marek Olšák
f3886e9c02
nir: split FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FP* flags
...
GLSL doesn't preserve NaNs, but it optionally preserves Infs.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25392 >
2023-10-17 17:27:12 +00:00
Emma Anholt
40f22f8ecd
nir/print: Decode system values in the variable declarations.
...
decl_var system INTERP_MODE_NONE none vec4 #0
decl_var system INTERP_MODE_FLAT none mediump uint #1
turns into:
decl_var system INTERP_MODE_NONE none vec4 #0 (SYSTEM_VALUE_FRAG_COORD)
decl_var system INTERP_MODE_FLAT none mediump uint #1 (SYSTEM_VALUE_SUBGROUP_INVOCATION)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25647 >
2023-10-12 22:52:42 +00:00
Alyssa Rosenzweig
569d44eff4
nir/print: Handle KERNEL
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625 >
2023-10-12 21:03:31 +00:00