Mesa (main): intel: Use nir_test_mask instead of i2b(iand)
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 30 18:29:38 UTC 2022
Module: Mesa
Branch: main
Commit: 85da294bfed775c239a5fdf827ae9f585f1e67a1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=85da294bfed775c239a5fdf827ae9f585f1e67a1
Author: Konstantin Seurer <konstantin.seurer at gmail.com>
Date: Sat Jun 25 10:34:14 2022 +0200
intel: Use nir_test_mask instead of i2b(iand)
Signed-off-by: Konstantin Seurer <konstantin.seurer at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17242>
---
src/intel/compiler/brw_nir_rt.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/intel/compiler/brw_nir_rt.c b/src/intel/compiler/brw_nir_rt.c
index b9fc5de9d0b..ad529cdfcce 100644
--- a/src/intel/compiler/brw_nir_rt.c
+++ b/src/intel/compiler/brw_nir_rt.c
@@ -225,9 +225,8 @@ lower_rt_io_and_scratch(nir_shader *nir)
static void
build_terminate_ray(nir_builder *b)
{
- nir_ssa_def *skip_closest_hit =
- nir_i2b(b, nir_iand_imm(b, nir_load_ray_flags(b),
- BRW_RT_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER));
+ nir_ssa_def *skip_closest_hit = nir_test_mask(b, nir_load_ray_flags(b),
+ BRW_RT_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER);
nir_push_if(b, skip_closest_hit);
{
/* The shader that calls traceRay() is unable to access any ray hit
@@ -308,9 +307,8 @@ lower_ray_walk_intrinsics(nir_shader *shader,
case nir_intrinsic_accept_ray_intersection: {
b.cursor = nir_instr_remove(&intrin->instr);
- nir_ssa_def *terminate =
- nir_i2b(&b, nir_iand_imm(&b, nir_load_ray_flags(&b),
- BRW_RT_RAY_FLAG_TERMINATE_ON_FIRST_HIT));
+ nir_ssa_def *terminate = nir_test_mask(&b, nir_load_ray_flags(&b),
+ BRW_RT_RAY_FLAG_TERMINATE_ON_FIRST_HIT);
nir_push_if(&b, terminate);
{
build_terminate_ray(&b);
More information about the mesa-commit
mailing list