Switched vertex type to be chosen at the shader load

This commit is contained in:
2020-02-13 23:37:41 -08:00
parent fcfa40e335
commit d1051a0ca3
9 changed files with 39 additions and 40 deletions

View File

@@ -9,6 +9,7 @@ use vulkano::device::Device;
use shade_runner::Entry;
use shaderc::ShaderKind;
use crate::canvas::managed::handles::CompiledShaderHandle;
use vulkano::pipeline::vertex::Vertex;
/*
@@ -100,15 +101,15 @@ pub trait CompiledGraphicsPipelineResources {
pub trait CompiledGraphicsPipeline {
fn new(filename: String,
fn new<V>(filename: String,
device: Arc<Device>,
handle: Arc<CompiledShaderHandle>,
render_pass: Arc<dyn RenderPassAbstract + Send + Sync>) -> Self where Self: Sized;
render_pass: Arc<dyn RenderPassAbstract + Send + Sync>) -> Self where Self: Sized, V: Vertex,;
fn get_name(&self) -> String;
fn get_handle(&self) -> Arc<CompiledShaderHandle>;
fn get_pipeline(&self) -> Arc<dyn GraphicsPipelineAbstract + Sync + Send>;
fn get_renderpass(&self) -> Arc<dyn RenderPassAbstract + Send + Sync>;
fn recompile(self, render_pass: Arc<dyn RenderPassAbstract + Send + Sync>)
fn recompile<V: Vertex>(self, render_pass: Arc<dyn RenderPassAbstract + Send + Sync>)
-> Self where Self: Sized;
}