slam-viewer 0.1.2

Simple wgpu based SLAM map viewer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub struct StaticShaderModule {
    pub glsl_source: &'static str,
    pub shader_type: glsl_to_spirv::ShaderType,
    pub entry_point: Option<&'static str>,
}

impl StaticShaderModule {
    pub fn build(&self, device: &wgpu::Device) -> wgpu::ShaderModule {
        let spirv = glsl_to_spirv::compile(self.glsl_source, self.shader_type.clone()).unwrap();
        let data = wgpu::read_spirv(spirv).unwrap();
        device.create_shader_module(&data)
    }

    pub fn entry_point(&self) -> &str {
        self.entry_point.unwrap_or("main")
    }
}