mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 18:38:11 +02:00
ac/nir: add helper ac_nir_load_arg_upper_bound
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32782>
This commit is contained in:
parent
cfeaa45dc6
commit
1d9fbe5387
2 changed files with 22 additions and 5 deletions
|
|
@ -47,6 +47,22 @@ ac_nir_load_arg_at_offset(nir_builder *b, const struct ac_shader_args *ac_args,
|
|||
return nir_load_vector_arg_amd(b, num_components, .base = arg_index);
|
||||
}
|
||||
|
||||
nir_def *
|
||||
ac_nir_load_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg)
|
||||
{
|
||||
return ac_nir_load_arg_at_offset(b, ac_args, arg, 0);
|
||||
}
|
||||
|
||||
nir_def *
|
||||
ac_nir_load_arg_upper_bound(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg,
|
||||
unsigned upper_bound)
|
||||
{
|
||||
nir_def *value = ac_nir_load_arg_at_offset(b, ac_args, arg, 0);
|
||||
nir_intrinsic_set_arg_upper_bound_u32_amd(nir_instr_as_intrinsic(value->parent_instr),
|
||||
upper_bound);
|
||||
return value;
|
||||
}
|
||||
|
||||
void
|
||||
ac_nir_store_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg,
|
||||
nir_def *val)
|
||||
|
|
|
|||
|
|
@ -61,11 +61,12 @@ nir_def *
|
|||
ac_nir_load_arg_at_offset(nir_builder *b, const struct ac_shader_args *ac_args,
|
||||
struct ac_arg arg, unsigned relative_index);
|
||||
|
||||
static inline nir_def *
|
||||
ac_nir_load_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg)
|
||||
{
|
||||
return ac_nir_load_arg_at_offset(b, ac_args, arg, 0);
|
||||
}
|
||||
nir_def *
|
||||
ac_nir_load_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg);
|
||||
|
||||
nir_def *
|
||||
ac_nir_load_arg_upper_bound(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg,
|
||||
unsigned upper_bound);
|
||||
|
||||
void ac_nir_store_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg,
|
||||
nir_def *val);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue