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

@@ -20,7 +20,7 @@ use crate::canvas::managed::shader::generic_shader::GenericShader;
use crate::canvas::managed::shader::text_shader::TextShader;
use crate::canvas::managed::handles::{CanvasTextureHandle, CompiledShaderHandle, CanvasFontHandle, CanvasImageHandle};
use crate::compute::managed::handles::{CompuKernelHandle, CompuBufferHandle};
use crate::util::vertex::VertexTypes;
use crate::util::vertex::{VertexTypes, ColorVertex2D, TextVertex3D, TextureVertex2D, ImageVertex2D};
/// VKProcessor holds the vulkan instance information, the swapchain,
@@ -168,10 +168,10 @@ impl<'a> VkProcessor<'a> {
/// A hardcoded list of shaders which can be preloaded from this function
pub fn preload_shaders(&mut self) {
self.canvas_state.load_shader::<GenericShader>(String::from("color-passthrough"), self.physical.clone(), self.capabilities.clone());
self.canvas_state.load_shader::<GenericShader>(String::from("simple_texture"), self.physical.clone(), self.capabilities.clone());
self.canvas_state.load_shader::<GenericShader>(String::from("simple_image"), self.physical.clone(), self.capabilities.clone());
self.canvas_state.load_shader::<TextShader>(String::from("simple_text"), self.physical.clone(), self.capabilities.clone());
self.canvas_state.load_shader::<GenericShader, ColorVertex2D>(String::from("color-passthrough"), self.physical.clone(), self.capabilities.clone());
self.canvas_state.load_shader::<GenericShader, TextureVertex2D>(String::from("simple_texture"), self.physical.clone(), self.capabilities.clone());
self.canvas_state.load_shader::<GenericShader, ImageVertex2D>(String::from("simple_image"), self.physical.clone(), self.capabilities.clone());
self.canvas_state.load_shader::<TextShader, TextVertex3D>(String::from("simple_text"), self.physical.clone(), self.capabilities.clone());
}
/// A hardcoded list of shaders which can be proloaded from this function