11/*========================== begin_copyright_notice ============================
22
3- Copyright (C) 2017-2021 Intel Corporation
3+ Copyright (C) 2017-2023 Intel Corporation
44
55SPDX-License-Identifier: MIT
66
@@ -2589,6 +2589,7 @@ void __attribute__((overloadable)) work_group_named_barrier(local NamedBarrier_t
25892589void __attribute__((overloadable )) work_group_named_barrier (local NamedBarrier_t * barrier , cl_mem_fence_flags flags , memory_scope scope );
25902590#endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0
25912591
2592+ #if defined(cl_intel_pvc_rt_validation )
25922593
25932594struct rtglobals_t ;
25942595typedef __global struct rtglobals_t * rtglobals_t ;
@@ -2608,149 +2609,4 @@ void intel_rt_sync(rtfence_t fence);
26082609
26092610global void * intel_get_implicit_dispatch_globals ();
26102611
2611- // ----------- Raytracing production API code -----------
2612-
2613- // --- Opaque types ---
2614- typedef private struct intel_ray_query_opaque_t * intel_ray_query_t ;
2615- typedef global struct intel_raytracing_acceleration_structure_opaque_t * intel_raytracing_acceleration_structure_t ;
2616-
2617- // --- Enum and struct definitions ---
2618-
2619- typedef enum // intel_ray_flags_t
2620- {
2621- intel_ray_flags_none = 0x00 ,
2622- intel_ray_flags_force_opaque =
2623- 0x01 , // forces geometry to be opaque (no anyhit shader invokation)
2624- intel_ray_flags_force_non_opaque =
2625- 0x02 , // forces geometry to be non-opqaue (invoke anyhit shader)
2626- intel_ray_flags_accept_first_hit_and_end_search =
2627- 0x04 , // terminates traversal on the first hit found (shadow rays)
2628- intel_ray_flags_skip_closest_hit_shader =
2629- 0x08 , // skip execution of the closest hit shader
2630- intel_ray_flags_cull_back_facing_triangles =
2631- 0x10 , // back facing triangles to not produce a hit
2632- intel_ray_flags_cull_front_facing_triangles =
2633- 0x20 , // front facing triangles do not produce a hit
2634- intel_ray_flags_cull_opaque = 0x40 , // opaque geometry does not produce a hit
2635- intel_ray_flags_cull_non_opaque = 0x80 , // non-opaque geometry does not produce a hit
2636- intel_ray_flags_skip_triangles = 0x100 , // treat all triangle intersections as misses.
2637- intel_ray_flags_skip_procedural_primitives =
2638- 0x200 , // skip execution of intersection shaders
2639- } intel_ray_flags_t ;
2640-
2641- typedef enum intel_hit_type_t
2642- {
2643- intel_hit_type_committed_hit = 0 ,
2644- intel_hit_type_potential_hit = 1 ,
2645- } intel_hit_type_t ;
2646-
2647- typedef enum
2648- {
2649- intel_raytracing_ext_flag_ray_query = 1 << 0 , // true if ray queries are supported
2650- } intel_raytracing_ext_flag_t ;
2651-
2652- typedef struct // intel_float2
2653- {
2654- float x , y ;
2655- } intel_float2 ;
2656-
2657- typedef struct // intel_float3
2658- {
2659- float x , y , z ;
2660- } intel_float3 ;
2661-
2662- typedef struct // intel_float4x3
2663- {
2664- intel_float3 vx , vy , vz , p ;
2665- } intel_float4x3 ;
2666-
2667- typedef struct // intel_ray_desc_t
2668- {
2669- intel_float3 origin ;
2670- intel_float3 direction ;
2671- float tmin ;
2672- float tmax ;
2673- uint mask ;
2674- intel_ray_flags_t flags ;
2675- } intel_ray_desc_t ;
2676-
2677- // if traversal returns one can test if a triangle or procedural is hit
2678- typedef enum // intel_candidate_type_t
2679- {
2680- intel_candidate_type_triangle ,
2681- intel_candidate_type_procedural
2682- } intel_candidate_type_t ;
2683-
2684- // --- API functions ---
2685-
2686- // check supported ray tracing features
2687- intel_raytracing_ext_flag_t intel_get_raytracing_ext_flag ();
2688-
2689- // initialize a ray query
2690- intel_ray_query_t intel_ray_query_init (
2691- intel_ray_desc_t ray , intel_raytracing_acceleration_structure_t accel );
2692-
2693- // setup for instance traversal using a transformed ray and bottom-level AS
2694- void intel_ray_query_forward_ray (
2695- intel_ray_query_t query ,
2696- intel_ray_desc_t ray ,
2697- intel_raytracing_acceleration_structure_t accel );
2698-
2699- // commit the potential hit
2700- void intel_ray_query_commit_potential_hit (intel_ray_query_t query );
2701-
2702- // commit the potential hit and override hit distance and UVs
2703- void intel_ray_query_commit_potential_hit_override (
2704- intel_ray_query_t query , float override_hit_distance , intel_float2 override_uv );
2705-
2706- // start traversal of a ray query
2707- void intel_ray_query_start_traversal (intel_ray_query_t query );
2708-
2709- // Synchronize ray_query execution. If a ray was traversed,
2710- // this must be called prior to accessing the ray query.
2711- void intel_ray_query_sync (intel_ray_query_t query );
2712-
2713- // Signal that a ray query will not be used further. This is the moral
2714- // equivalent of a delete. This function does an implicit sync.
2715- void intel_ray_query_abandon (intel_ray_query_t query );
2716-
2717- // read hit information during shader execution
2718- uint intel_get_hit_bvh_level (intel_ray_query_t query , intel_hit_type_t hit_type );
2719- float intel_get_hit_distance (intel_ray_query_t query , intel_hit_type_t hit_type );
2720- intel_float2 intel_get_hit_barycentrics (intel_ray_query_t query , intel_hit_type_t hit_type );
2721- bool intel_get_hit_front_face (intel_ray_query_t query , intel_hit_type_t hit_type );
2722- uint intel_get_hit_geometry_id (intel_ray_query_t query , intel_hit_type_t hit_type );
2723- uint intel_get_hit_primitive_id (intel_ray_query_t query , intel_hit_type_t hit_type );
2724- uint intel_get_hit_triangle_primitive_id (
2725- intel_ray_query_t query ,
2726- intel_hit_type_t hit_type ); // fast path for triangles
2727- uint intel_get_hit_procedural_primitive_id (
2728- intel_ray_query_t query ,
2729- intel_hit_type_t hit_type ); // fast path for procedurals
2730- uint intel_get_hit_instance_id (intel_ray_query_t query , intel_hit_type_t hit_type );
2731- uint intel_get_hit_instance_user_id (intel_ray_query_t query , intel_hit_type_t hit_type );
2732- intel_float4x3 intel_get_hit_world_to_object (intel_ray_query_t query , intel_hit_type_t hit_type );
2733- intel_float4x3 intel_get_hit_object_to_world (intel_ray_query_t query , intel_hit_type_t hit_type );
2734-
2735- intel_candidate_type_t intel_get_hit_candidate (intel_ray_query_t query , intel_hit_type_t hit_type );
2736-
2737- // fetch triangle vertices for a hit
2738- void intel_get_hit_triangle_vertices (
2739- intel_ray_query_t query , intel_float3 vertices_out [3 ], intel_hit_type_t hit_type );
2740-
2741- // Read ray-data. This is used to read transformed rays produced by HW
2742- // instancing pipeline during any-hit or intersection shader execution.
2743- intel_float3 intel_get_ray_origin (intel_ray_query_t query , uint bvh_level );
2744- intel_float3 intel_get_ray_direction (intel_ray_query_t query , uint bvh_level );
2745- float intel_get_ray_tmin (intel_ray_query_t query , uint bvh_level );
2746- intel_ray_flags_t intel_get_ray_flags (intel_ray_query_t query , uint bvh_level );
2747- int intel_get_ray_mask (intel_ray_query_t query , uint bvh_level );
2748-
2749- // Test whether traversal has terminated. If false, the ray has reached
2750- // a procedural leaf or a non-opaque triangle leaf, and requires shader
2751- // processing.
2752- bool intel_is_traversal_done (intel_ray_query_t query );
2753-
2754- // if traversal is done one can test for the presence of a committed hit to
2755- // either invoke miss or closest hit shader
2756- bool intel_has_committed_hit (intel_ray_query_t query );
2612+ #endif // defined(cl_intel_pvc_rt_validation)
0 commit comments