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