nir: add intrinsics for ray queries
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/13718>
This commit is contained in:

committed by
Marge Bot

parent
0800ec2c77
commit
0d6f050b46
@@ -5318,6 +5318,27 @@ nir_addition_might_overflow(nir_shader *shader, struct hash_table *range_ht,
|
||||
nir_ssa_scalar ssa, unsigned const_val,
|
||||
const nir_unsigned_upper_bound_config *config);
|
||||
|
||||
typedef enum {
|
||||
nir_ray_query_value_intersection_type,
|
||||
nir_ray_query_value_intersection_t,
|
||||
nir_ray_query_value_intersection_instance_custom_index,
|
||||
nir_ray_query_value_intersection_instance_id,
|
||||
nir_ray_query_value_intersection_instance_sbt_index,
|
||||
nir_ray_query_value_intersection_geometry_index,
|
||||
nir_ray_query_value_intersection_primitive_index,
|
||||
nir_ray_query_value_intersection_barycentrics,
|
||||
nir_ray_query_value_intersection_front_face,
|
||||
nir_ray_query_value_intersection_object_ray_direction,
|
||||
nir_ray_query_value_intersection_object_ray_origin,
|
||||
nir_ray_query_value_intersection_object_to_world,
|
||||
nir_ray_query_value_intersection_world_to_object,
|
||||
nir_ray_query_value_intersection_candidate_aabb_opaque,
|
||||
nir_ray_query_value_tmin,
|
||||
nir_ray_query_value_flags,
|
||||
nir_ray_query_value_world_ray_direction,
|
||||
nir_ray_query_value_world_ray_origin,
|
||||
} nir_ray_query_value;
|
||||
|
||||
#include "nir_inline_helpers.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -492,6 +492,28 @@ intrinsic("terminate_ray")
|
||||
# src[] = { sbt_index, payload }
|
||||
intrinsic("execute_callable", src_comp=[1, -1])
|
||||
|
||||
# Initialize a ray query
|
||||
#
|
||||
# 0. Ray Query
|
||||
# 1. Acceleration Structure
|
||||
# 2. Ray Flags
|
||||
# 3. Cull Mask
|
||||
# 4. Ray Origin
|
||||
# 5. Ray Tmin
|
||||
# 6. Ray Direction
|
||||
# 7. Ray Tmax
|
||||
intrinsic("rq_initialize", src_comp=[-1, -1, 1, 1, 3, 1, 3, 1])
|
||||
# src[] = { query }
|
||||
intrinsic("rq_terminate", src_comp=[-1])
|
||||
# src[] = { query }
|
||||
intrinsic("rq_proceed", src_comp=[-1], dest_comp=1)
|
||||
# src[] = { query, hit }
|
||||
intrinsic("rq_generate_intersection", src_comp=[-1, 1])
|
||||
# src[] = { query }
|
||||
intrinsic("rq_confirm_intersection", src_comp=[-1])
|
||||
# src[] = { query, committed } BASE=nir_ray_query_value
|
||||
intrinsic("rq_load", src_comp=[-1, 1], dest_comp=0, indices=[BASE,COLUMN])
|
||||
|
||||
# Driver independent raytracing helpers
|
||||
|
||||
# rt_resume is a helper that that be the first instruction accesing the
|
||||
|
Reference in New Issue
Block a user