mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 17:10:11 +01:00
hasvk: Implement lower_base_workgroup_id
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
This commit is contained in:
parent
3c09571f67
commit
19ad2629d0
1 changed files with 17 additions and 0 deletions
|
|
@ -1106,6 +1106,21 @@ lower_load_constant(nir_builder *b, nir_intrinsic_instr *intrin,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
lower_base_workgroup_id(nir_builder *b, nir_intrinsic_instr *intrin,
|
||||
struct apply_pipeline_layout_state *state)
|
||||
{
|
||||
b->cursor = nir_instr_remove(&intrin->instr);
|
||||
|
||||
nir_ssa_def *base_workgroup_id =
|
||||
nir_load_push_constant(b, 3, 32, nir_imm_int(b, 0),
|
||||
.base = offsetof(struct anv_push_constants, cs.base_work_group_id),
|
||||
.range = 3 * sizeof(uint32_t));
|
||||
nir_ssa_def_rewrite_uses(&intrin->dest.ssa, base_workgroup_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
lower_tex_deref(nir_builder *b, nir_tex_instr *tex,
|
||||
nir_tex_src_type deref_src_type,
|
||||
|
|
@ -1377,6 +1392,8 @@ apply_pipeline_layout(nir_builder *b, nir_instr *instr, void *_state)
|
|||
return lower_image_intrinsic(b, intrin, state);
|
||||
case nir_intrinsic_load_constant:
|
||||
return lower_load_constant(b, intrin, state);
|
||||
case nir_intrinsic_load_base_workgroup_id:
|
||||
return lower_base_workgroup_id(b, intrin, state);
|
||||
case nir_intrinsic_load_ray_query_global_intel:
|
||||
return lower_ray_query_globals(b, intrin, state);
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue