Add pipeline loader
This commit is contained in:
parent
8b982ba089
commit
6099a3e27f
5 changed files with 179 additions and 53 deletions
|
@ -1,4 +1,7 @@
|
|||
use std::{error::Error, sync::Arc};
|
||||
use std::{
|
||||
error::Error,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
use vulkano::{
|
||||
command_buffer::{AutoCommandBufferBuilder, PrimaryAutoCommandBuffer},
|
||||
|
@ -33,16 +36,14 @@ use crate::core::render::{
|
|||
resources::texture::Texture,
|
||||
};
|
||||
|
||||
pub struct SimplePipeline {
|
||||
pipeline: Arc<GraphicsPipeline>,
|
||||
}
|
||||
pub struct SimplePipeline;
|
||||
|
||||
impl SimplePipeline {
|
||||
pub fn new(
|
||||
device: &Arc<Device>,
|
||||
swapchain_format: Format,
|
||||
depth_format: Format,
|
||||
) -> Result<Self, Box<dyn Error>> {
|
||||
) -> Result<Arc<GraphicsPipeline>, Box<dyn Error>> {
|
||||
let vs = shaders::vs::load(device.clone())?
|
||||
.entry_point("main")
|
||||
.ok_or("Failed find main entry point of vertex shader".to_string())?;
|
||||
|
@ -111,11 +112,7 @@ impl SimplePipeline {
|
|||
},
|
||||
)?;
|
||||
|
||||
Ok(Self { pipeline })
|
||||
}
|
||||
|
||||
pub fn pipeline(&self) -> &Arc<GraphicsPipeline> {
|
||||
&self.pipeline
|
||||
Ok(pipeline)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue