1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
pub use crate::backend::RayTracingPipeline;
use crate::{buffer::StridedBufferRange, shader::Shader, PipelineLayout};
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct RayTracingPipelineInfo {
pub shaders: Vec<Shader>,
pub groups: Vec<RayTracingShaderGroupInfo>,
pub max_recursion_depth: u32,
pub layout: PipelineLayout,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
pub enum RayTracingShaderGroupInfo {
Raygen {
raygen: u32,
},
Miss {
miss: u32,
},
Triangles {
any_hit: Option<u32>,
closest_hit: Option<u32>,
},
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ShaderBindingTableInfo<'a> {
pub raygen: Option<u32>,
pub miss: &'a [u32],
pub hit: &'a [u32],
pub callable: &'a [u32],
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ShaderBindingTable {
pub raygen: Option<StridedBufferRange>,
pub miss: Option<StridedBufferRange>,
pub hit: Option<StridedBufferRange>,
pub callable: Option<StridedBufferRange>,
}