still working on getiting these shaders to a usable API

This commit is contained in:
2019-09-28 21:30:28 -07:00
parent 1a247e482a
commit 77d30591e6
15 changed files with 264 additions and 271 deletions

View File

@@ -18,6 +18,8 @@ use crate::compute::compu_buffer::{CompuBuffers, CompuBufferHandle};
use std::time::Duration;
use vulkano::pipeline::depth_stencil::{DynamicStencilValue, StencilFaceFlags};
use crate::canvas::shader::common::CompiledGraphicsPipelineHandle;
use crate::canvas::shader::generic_shader::GenericShader;
use crate::canvas::shader::text_shader::TextShader;
/// VKProcessor holds the vulkan instance information, the swapchain, and the compute and canvas states
///
@@ -155,9 +157,10 @@ impl<'a> VkProcessor<'a> {
/// A hardcoded list of shaders which can be proloaded from this function
pub fn preload_shaders(&mut self) {
self.canvas.load_shader(String::from("color-passthrough"), self.physical.clone(), self.capabilities.clone());
self.canvas.load_shader(String::from("simple_texture"), self.physical.clone(), self.capabilities.clone());
self.canvas.load_shader(String::from("simple_image"), self.physical.clone(), self.capabilities.clone());
self.canvas.load_shader::<GenericShader>(String::from("color-passthrough"), self.physical.clone(), self.capabilities.clone());
self.canvas.load_shader::<GenericShader>(String::from("simple_texture"), self.physical.clone(), self.capabilities.clone());
self.canvas.load_shader::<GenericShader>(String::from("simple_image"), self.physical.clone(), self.capabilities.clone());
self.canvas.load_shader::<TextShader>(String::from("simple_text"), self.physical.clone(), self.capabilities.clone());
}
/// O(n) Lookup for the matching texture string
@@ -256,6 +259,7 @@ impl<'a> VkProcessor<'a> {
drop(g);
let g = hprof::enter("Push draw commands to command buffer");
// Add the draw commands
let mut command_buffer = self.canvas.draw_commands(command_buffer, framebuffers, image_num);