mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 21:00:16 +01:00
intel/nir: reuse rt helper
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970>
This commit is contained in:
parent
57f1e95102
commit
649cdc617f
1 changed files with 4 additions and 13 deletions
|
|
@ -183,20 +183,11 @@ lower_rt_intrinsics_impl(nir_function_impl *impl,
|
|||
sysval = hit_in.t;
|
||||
break;
|
||||
|
||||
case nir_intrinsic_load_primitive_id: {
|
||||
/* It's in dw[3] for procedural and dw[2] for quad
|
||||
*
|
||||
* TODO: We really need some helpers here.
|
||||
*/
|
||||
nir_ssa_def *offset =
|
||||
nir_bcsel(b, build_leaf_is_procedural(b, &hit_in),
|
||||
nir_iadd_imm(b, nir_ishl_imm(b, hit_in.prim_leaf_index, 2), 12),
|
||||
nir_imm_int(b, 8));
|
||||
sysval = nir_load_global(b, nir_iadd(b, hit_in.prim_leaf_ptr,
|
||||
nir_u2u64(b, offset)),
|
||||
4, /* align */ 1, 32);
|
||||
case nir_intrinsic_load_primitive_id:
|
||||
sysval = brw_nir_rt_load_primitive_id_from_hit(b,
|
||||
build_leaf_is_procedural(b, &hit_in),
|
||||
&hit_in);
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_intrinsic_load_instance_id: {
|
||||
struct brw_nir_rt_bvh_instance_leaf_defs leaf;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue