mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 04:18:28 +00:00
Add Pipelines
This commit is contained in:
parent
d2a4d60b52
commit
ccd9b7d472
@ -3,6 +3,11 @@ use super::{
|
|||||||
shaders::{Shaders, Vertex},
|
shaders::{Shaders, Vertex},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub struct Pipelines {
|
||||||
|
pub vertices: Pipeline,
|
||||||
|
pub triangles: Pipeline,
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Pipeline {
|
pub struct Pipeline {
|
||||||
render_pipeline: wgpu::RenderPipeline,
|
render_pipeline: wgpu::RenderPipeline,
|
||||||
bind_group: wgpu::BindGroup,
|
bind_group: wgpu::BindGroup,
|
||||||
|
@ -9,7 +9,7 @@ use crate::geometry::Operation;
|
|||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
geometry::Geometry,
|
geometry::Geometry,
|
||||||
pipelines::Pipeline,
|
pipelines::{Pipeline, Pipelines},
|
||||||
shaders::{Shaders, Uniforms},
|
shaders::{Shaders, Uniforms},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,8 +17,7 @@ pub struct Renderer {
|
|||||||
pub surface: wgpu::Surface<'static>,
|
pub surface: wgpu::Surface<'static>,
|
||||||
pub device: wgpu::Device,
|
pub device: wgpu::Device,
|
||||||
pub queue: wgpu::Queue,
|
pub queue: wgpu::Queue,
|
||||||
pub vertices_pipeline: Pipeline,
|
pub pipelines: Pipelines,
|
||||||
pub triangles_pipeline: Pipeline,
|
|
||||||
pub depth_view: wgpu::TextureView,
|
pub depth_view: wgpu::TextureView,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,8 +93,10 @@ impl Renderer {
|
|||||||
surface,
|
surface,
|
||||||
device,
|
device,
|
||||||
queue,
|
queue,
|
||||||
vertices_pipeline,
|
pipelines: Pipelines {
|
||||||
triangles_pipeline,
|
vertices: vertices_pipeline,
|
||||||
|
triangles: triangles_pipeline,
|
||||||
|
},
|
||||||
depth_view,
|
depth_view,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -140,13 +141,13 @@ impl Renderer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
self.vertices_pipeline.draw(
|
self.pipelines.vertices.draw(
|
||||||
&mut encoder,
|
&mut encoder,
|
||||||
&color_view,
|
&color_view,
|
||||||
&self.depth_view,
|
&self.depth_view,
|
||||||
&vertices,
|
&vertices,
|
||||||
);
|
);
|
||||||
self.triangles_pipeline.draw(
|
self.pipelines.triangles.draw(
|
||||||
&mut encoder,
|
&mut encoder,
|
||||||
&color_view,
|
&color_view,
|
||||||
&self.depth_view,
|
&self.depth_view,
|
||||||
|
Loading…
Reference in New Issue
Block a user