Mike Blumenkrantz
30415fe835
nir/lower_clip_disable: fix for lowered io
...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28463 >
2024-04-04 18:58:42 +00:00
Alyssa Rosenzweig
d1eb17e92e
treewide: Drop nir_ssa_for_src users
...
Via Coccinelle patch:
@@
expression b, s, n;
@@
-nir_ssa_for_src(b, *s, n)
+s->ssa
@@
expression b, s, n;
@@
-nir_ssa_for_src(b, s, n)
+s.ssa
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25247 >
2023-09-18 10:25:17 -04:00
Alyssa Rosenzweig
465b138f01
treewide: Use nir_shader_intrinsic_pass sometimes
...
This converts a lot of trivial passes. Nice boilerplate deletion. Via Coccinelle
patch (with a small manual fix-up for panfrost where coccinelle got confused by
genxml + ninja clang-format squashed in, and for Zink because my semantic patch
was slightly buggy).
@def@
typedef bool;
typedef nir_builder;
typedef nir_instr;
typedef nir_def;
identifier fn, instr, intr, x, builder, data;
@@
static fn(nir_builder* builder,
-nir_instr *instr,
+nir_intrinsic_instr *intr,
...)
{
(
- if (instr->type != nir_instr_type_intrinsic)
- return false;
- nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
|
- nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
- if (instr->type != nir_instr_type_intrinsic)
- return false;
)
<...
(
-instr->x
+intr->instr.x
|
-instr
+&intr->instr
)
...>
}
@pass depends on def@
identifier def.fn;
expression shader, progress;
@@
(
-nir_shader_instructions_pass(shader, fn,
+nir_shader_intrinsics_pass(shader, fn,
...)
|
-NIR_PASS_V(shader, nir_shader_instructions_pass, fn,
+NIR_PASS_V(shader, nir_shader_intrinsics_pass, fn,
...)
|
-NIR_PASS(progress, shader, nir_shader_instructions_pass, fn,
+NIR_PASS(progress, shader, nir_shader_intrinsics_pass, fn,
...)
)
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/24852 >
2023-08-24 15:48:02 +00:00
Alyssa Rosenzweig
09d31922de
nir: Drop "SSA" from NIR language
...
Everything is SSA now.
sed -e 's/nir_ssa_def/nir_def/g' \
-e 's/nir_ssa_undef/nir_undef/g' \
-e 's/nir_ssa_scalar/nir_scalar/g' \
-e 's/nir_src_rewrite_ssa/nir_src_rewrite/g' \
-e 's/nir_gather_ssa_types/nir_gather_types/g' \
-i $(git grep -l nir | grep -v relnotes)
git mv src/compiler/nir/nir_gather_ssa_types.c \
src/compiler/nir/nir_gather_types.c
ninja -C build/ clang-format
cd src/compiler/nir && find *.c *.h -type f -exec clang-format -i \{} \;
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24585 >
2023-08-12 16:44:41 -04:00
Faith Ekstrand
777d336b1f
nir: clang-format src/compiler/nir/*.[ch]
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382 >
2023-08-12 19:27:28 +00:00
Erik Faye-Lund
6d142078bc
nir: use generated immediate comparison helpers
...
This makes the code a bit less verbose, so let's use the helpers.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23393 >
2023-06-05 13:40:08 +00:00
Marcin Ślusarz
c6e4641a21
nir: use nir_shader_instructions_pass in nir_lower_clip_disable
...
Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
make progress
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282 >
2022-09-26 11:13:03 +00:00
Connor Abbott
77fcb01f7f
nir/lower_clip_disable: Fix store writemask
...
We're storing into the array element, not the whole variable.
Fixes: fb2fe80 ("nir: add lowering pass for clip plane enabling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7274 >
2021-04-26 17:07:02 +00:00
Mike Blumenkrantz
0b0f152c54
nir/clip_disable: handle 2x vec4 case
...
some drivers may have pre-lowered gl_ClipDistance to 2x vec4 to match hw
usage, so for those cases we'll be getting deref_var here and then components
will be stored to the deref at some point
fixes mesa/mesa#3480
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6563 >
2020-11-05 21:32:27 +00:00
Mike Blumenkrantz
5e43ba39e1
nir/clip_disable: try for better no-op
...
we can just check the bits using clip_distance_array_size here to simplify
everything and more easily determine if we need to be running this pass
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6563 >
2020-11-05 21:32:27 +00:00
Mike Blumenkrantz
1d23a88c6e
nir/clip_disable: write 0s instead of undefs for disabled clip planes
...
this should yield more reliable and ideally even correct results
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6563 >
2020-11-05 21:32:27 +00:00
Jason Ekstrand
2956d53400
nir: Add nir_foreach_shader_in/out_variable helpers
...
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966 >
2020-07-29 17:38:57 +00:00
Mike Blumenkrantz
fb2fe802f6
nir: add lowering pass for clip plane enabling
...
a pass which rewrites gl_ClipDistance[n] to an undef if the corresponding
clip plane is disabled in the rasterizer state
this pass is needed for zink to handle api disables of clip planes
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5529 >
2020-07-03 08:56:30 +00:00