mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 18:08:26 +00:00
Prepare for adding more shaders
This commit is contained in:
parent
33a3185710
commit
762f40a3b8
@ -17,6 +17,16 @@ impl Shaders<TrianglesVertex> {
|
||||
let shader_module =
|
||||
device.create_shader_module(wgpu::include_wgsl!("triangles.wgsl"));
|
||||
|
||||
Self::new(device, config, shader_module)
|
||||
}
|
||||
}
|
||||
|
||||
impl<V> Shaders<V> {
|
||||
pub fn new(
|
||||
device: &wgpu::Device,
|
||||
config: &wgpu::SurfaceConfiguration,
|
||||
shader_module: wgpu::ShaderModule,
|
||||
) -> Self {
|
||||
let bind_group_layout =
|
||||
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
|
||||
label: None,
|
||||
@ -45,9 +55,7 @@ impl Shaders<TrianglesVertex> {
|
||||
_vertex: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<V> Shaders<V> {
|
||||
pub fn vertex_state(&self) -> wgpu::VertexState
|
||||
where
|
||||
V: Vertex,
|
||||
|
Loading…
Reference in New Issue
Block a user