2
* Copyright © 2020 Intel Corporation
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
* copy of this software and associated documentation files (the "Software"),
6
* to deal in the Software without restriction, including without limitation
7
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
* and/or sell copies of the Software, and to permit persons to whom the
9
* Software is furnished to do so, subject to the following conditions:
11
* The above copyright notice and this permission notice (including the next
12
* paragraph) shall be included in all copies or substantial portions of the
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
34
void brw_nir_lower_raygen(nir_shader *nir);
35
void brw_nir_lower_any_hit(nir_shader *nir,
36
const struct intel_device_info *devinfo);
37
void brw_nir_lower_closest_hit(nir_shader *nir);
38
void brw_nir_lower_miss(nir_shader *nir);
39
void brw_nir_lower_callable(nir_shader *nir);
40
void brw_nir_lower_combined_intersection_any_hit(nir_shader *intersection,
41
const nir_shader *any_hit,
42
const struct intel_device_info *devinfo);
44
/* We reserve the first 16B of the stack for callee data pointers */
45
#define BRW_BTD_STACK_RESUME_BSR_ADDR_OFFSET 0
46
#define BRW_BTD_STACK_CALL_DATA_PTR_OFFSET 8
47
#define BRW_BTD_STACK_CALLEE_DATA_SIZE 16
49
/* We require the stack to be 8B aligned at the start of a shader */
50
#define BRW_BTD_STACK_ALIGN 8
52
bool brw_nir_lower_ray_queries(nir_shader *shader,
53
const struct intel_device_info *devinfo);
55
void brw_nir_lower_shader_returns(nir_shader *shader);
57
bool brw_nir_lower_shader_calls(nir_shader *shader);
59
void brw_nir_lower_rt_intrinsics(nir_shader *shader,
60
const struct intel_device_info *devinfo);
61
void brw_nir_lower_intersection_shader(nir_shader *intersection,
62
const nir_shader *any_hit,
63
const struct intel_device_info *devinfo);
66
brw_nir_create_raygen_trampoline(const struct brw_compiler *compiler,
69
brw_nir_create_trivial_return_shader(const struct brw_compiler *compiler,
76
#endif /* BRW_NIR_RT_H */