Commit 88a3cf8e authored by Rhys Perry's avatar Rhys Perry
Browse files

nir/gather_info: use nir_ssa_scalar_resolved



This lets us skip copies.

Signed-off-by: Rhys Perry's avatarRhys Perry <pendingchaos02@gmail.com>
parent 42fa25c3
Pipeline #734851 waiting for manual action with stages
......@@ -31,22 +31,20 @@ static bool
src_is_invocation_id(const nir_src *src)
{
assert(src->is_ssa);
if (src->ssa->parent_instr->type != nir_instr_type_intrinsic)
return false;
return nir_instr_as_intrinsic(src->ssa->parent_instr)->intrinsic ==
nir_intrinsic_load_invocation_id;
nir_ssa_scalar s = nir_ssa_scalar_resolved(src->ssa, 0);
return s.def->parent_instr->type == nir_instr_type_intrinsic &&
nir_instr_as_intrinsic(s.def->parent_instr)->intrinsic ==
nir_intrinsic_load_invocation_id;
}
static bool
src_is_local_invocation_index(const nir_src *src)
{
assert(src->is_ssa);
if (src->ssa->parent_instr->type != nir_instr_type_intrinsic)
return false;
return nir_instr_as_intrinsic(src->ssa->parent_instr)->intrinsic ==
nir_intrinsic_load_local_invocation_index;
nir_ssa_scalar s = nir_ssa_scalar_resolved(src->ssa, 0);
return s.def->parent_instr->type == nir_instr_type_intrinsic &&
nir_instr_as_intrinsic(s.def->parent_instr)->intrinsic ==
nir_intrinsic_load_local_invocation_index;
}
static void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment