compiles and renders textures again

master
mitchellhansen 5 years ago
parent d1051a0ca3
commit 438f96eb32

@ -16,7 +16,6 @@ Main Systems:
[[VKProcessor:DynamicVertex|DynamicVertex]] =========== [[VKProcessor:DynamicVertex|DynamicVertex]] ===========
[[VKProcessor:CompuState|CompuState]] [[~/source/Trac3r-rust/doc/sfml_rust/compute/compu_state/struct.CompuState.html|===========]] [[VKProcessor:CompuState|CompuState]] [[~/source/Trac3r-rust/doc/sfml_rust/compute/compu_state/struct.CompuState.html|===========]]
-------------------- --------------------
====== Warming Up ====== ====== Warming Up ======
@ -26,31 +25,27 @@ Currently I'm getting my bearings again on this project.
=== canvas === === canvas ===
I made a maybe(?) good change to the heirarchy of the canvas. Hiding the construction of handles from anything outside. I made a maybe(?) good change to the heirarchy of the canvas. Hiding the construction of handles from anything outside.
Currently, canvas is separated out to the state container itself and one API class for users to interact with, in addition to a set of 'managed' objects Currently, canvas is separated out to
* A state container: CanvasState
Buffers and Handles are at one level, shared with text which is unrelated. * An Interface class CanvasFrame
Why do I hold the shader handles (CompiledShaderHandle) * `Managed` objects. Aka, everything that CanvasState holds
In Shader lie the shader compilers, pipelines, and supporting data. CanvasText is just laying around until I use it...
Shader pipeline objects exists in one level of managed
Handle and Buffer objects exists in the base managed level
**Current Question:** == Do I commit to the all handles in handles.rs? ==
Where do I put the CompiledShaderHandles?
I need to put them where I create them. The actual shader doesn't. FYI The shader API is actually pretty badass
load_shader::<GenericShader, ColorVertex2D>("shadername", a, b);
=== canvas frame === --------------------
The current workflow:
enum of vertex types
sprite holds vertex::type1
poly holds vertex::type2
canvasframe holds <enumType> So right now it looks like I am having some trouble in the drawing of the CanvasFrame I've crafted.
canvasState.run takes canvasFrame<enumType> It is seriously just a Vector of VertexTypes. Which should be fine
canvasState.draw_commands_test(command_buffer, framebuffers, image_num, canvas_frame);
@ -128,3 +123,4 @@ fn any_content<T>(value : T) where T : IntoContent {
null)

@ -16,6 +16,12 @@ Vk Processors is a do_all class for interaction with the render window, vulkan s
[[./vkprocessor.drawio]] [[./vkprocessor.drawio]]
-------------------- --------------------
===== Data ===== ===== Data =====

@ -9,7 +9,7 @@ Creation-Date: 2020-02-04T19:34:27-08:00
===== Details ===== ===== Details =====
The Canvas needs to package certain buffers along with their metadata. These take the form of **Canvas Buffers**. The Canvas needs to package certain buffers along with their metadata. These take the form of **Canvas Buffers**.
All buffers will have a coupled handle type stored in the [[/src/canvas/mod.rs|canvas/mod.rs]] and a reference to that handle All buffers will have a coupled handle type stored in [[/src/canvas/managed/handles.rs|handles.rs]] and a reference to that handle
===== CanvasImage ===== ===== CanvasImage =====

File diff suppressed because one or more lines are too long

@ -3,7 +3,6 @@
// These come in from the vertex definition // These come in from the vertex definition
layout(location = 0) in vec3 v_position; layout(location = 0) in vec3 v_position;
layout(location = 1) in vec4 color; layout(location = 1) in vec4 color;
layout(location = 2) in vec2 ti_position;
// These are made up in the shader themselves // These are made up in the shader themselves
layout(location = 0) out vec4 out_color; layout(location = 0) out vec4 out_color;

@ -3,8 +3,7 @@
// These come in from the vertex definition // These come in from the vertex definition
layout(location = 0) in vec3 v_position; layout(location = 0) in vec3 v_position;
layout(location = 1) in vec4 color; layout(location = 1) in vec2 ti_position;
layout(location = 2) in vec2 ti_position;
// These are made up in the shader themselves // These are made up in the shader themselves
layout(location = 0) out vec2 img_coords; layout(location = 0) out vec2 img_coords;

@ -4,8 +4,7 @@
// These come in from the vertex definition // These come in from the vertex definition
// TODO : Need to add texture coordinate attribute so I can single VBO all these sumbitches // TODO : Need to add texture coordinate attribute so I can single VBO all these sumbitches
layout(location = 0) in vec3 v_position; layout(location = 0) in vec3 v_position;
layout(location = 1) in vec4 color; layout(location = 1) in vec2 ti_position;
layout(location = 2) in vec2 ti_position;
// These are made up in the shader themselves // These are made up in the shader themselves
layout(location = 0) out vec2 tex_coords; layout(location = 0) out vec2 tex_coords;

@ -30,10 +30,10 @@ use vulkano::pipeline::vertex::{VertexDefinition, Vertex};
use crate::canvas::managed::shader::dynamic_vertex::RuntimeVertexDef; use crate::canvas::managed::shader::dynamic_vertex::RuntimeVertexDef;
use crate::canvas::managed::handles::{CanvasTextureHandle, CanvasImageHandle, CanvasFontHandle, CompiledShaderHandle, Handle, DrawableHandle}; use crate::canvas::managed::handles::{CanvasTextureHandle, CanvasImageHandle, CanvasFontHandle, CompiledShaderHandle, Handle, DrawableHandle};
use crate::canvas::managed::gpu_buffers::{CanvasImage, CanvasTexture, CanvasFont}; use crate::canvas::managed::gpu_buffers::{CanvasImage, CanvasTexture, CanvasFont};
use crate::canvas::managed::shader::shader_common::CompiledGraphicsPipeline; use crate::canvas::managed::shader::shader_common::CompiledShader;
use crate::canvas::managed::shader::generic_shader::GenericShader; use crate::canvas::managed::shader::generic_shader::GenericShader;
use crate::VertexTypes; use crate::VertexTypes;
use crate::util::vertex::{TextVertex3D, TextureVertex2D, ImageVertex2D, ColorVertex2D, CanvasFrameAllocation}; use crate::util::vertex::{TextVertex3D, TextureVertex3D, ImageVertex3D, ColorVertex3D, CanvasFrameAllocation};
use shade_runner::Input; use shade_runner::Input;
@ -52,7 +52,7 @@ pub struct CanvasState {
font_buffers: Vec<Arc<CanvasFont>>, font_buffers: Vec<Arc<CanvasFont>>,
/// Compiled Graphics pipelines have a handle which self describe their position in this vector /// Compiled Graphics pipelines have a handle which self describe their position in this vector
shader_buffers: Vec<Arc<Box<dyn CompiledGraphicsPipeline>>>, shader_buffers: Vec<Arc<Box<dyn CompiledShader>>>,
/// Looks like we gotta hold onto the queue for managing textures /// Looks like we gotta hold onto the queue for managing textures
queue: Arc<Queue>, queue: Arc<Queue>,
@ -260,13 +260,13 @@ impl CanvasState {
filename: String, filename: String,
physical: PhysicalDevice, physical: PhysicalDevice,
capabilities: Capabilities) -> Option<Arc<CompiledShaderHandle>> capabilities: Capabilities) -> Option<Arc<CompiledShaderHandle>>
where T: CompiledGraphicsPipeline, V: Vertex { where T: CompiledShader, V: Vertex {
let handle = Arc::new(CompiledShaderHandle { let handle = Arc::new(CompiledShaderHandle {
handle: self.shader_buffers.len() as u32 handle: self.shader_buffers.len() as u32
}); });
let shader: Box<dyn CompiledGraphicsPipeline> = Box::new(T::new::<V>( let shader: Box<dyn CompiledShader> = Box::new(T::new::<V>(
filename.clone(), filename.clone(),
self.device.clone(), self.device.clone(),
handle.clone(), handle.clone(),
@ -390,9 +390,9 @@ impl CanvasState {
/// Consume and allocate the canvas frame data to the GPU /// Consume and allocate the canvas frame data to the GPU
pub fn allocate(&mut self, canvas_frame: CanvasFrame) -> CanvasFrameAllocation { pub fn allocate(&mut self, canvas_frame: CanvasFrame) -> CanvasFrameAllocation {
let mut colored_vertex_buffer: Vec<ColorVertex2D> = Vec::default(); let mut colored_vertex_buffer: Vec<ColorVertex3D> = Vec::default();
let mut textured_vertex_buffer: HashMap<Arc<CanvasTextureHandle>, Vec<TextureVertex2D>> = HashMap::new(); let mut textured_vertex_buffer: HashMap<Arc<CanvasTextureHandle>, Vec<TextureVertex3D>> = HashMap::new();
let mut image_vertex_buffer: HashMap<Arc<CanvasImageHandle>, Vec<ImageVertex2D>> = HashMap::new(); let mut image_vertex_buffer: HashMap<Arc<CanvasImageHandle>, Vec<ImageVertex3D>> = HashMap::new();
let mut text_instances: HashMap<Arc<CanvasFontHandle>, Vec<TextVertex3D>> = HashMap::new(); let mut text_instances: HashMap<Arc<CanvasFontHandle>, Vec<TextVertex3D>> = HashMap::new();
for value in canvas_frame.map { for value in canvas_frame.map {
@ -477,7 +477,7 @@ impl CanvasState {
// This looks a little weird as colored_vertex_buffer is a vec of GPU allocated vecs. // This looks a little weird as colored_vertex_buffer is a vec of GPU allocated vecs.
// But we can pass in multiple vertex buffers // But we can pass in multiple vertex buffers
if allocated_buffers.colored_vertex_buffer.is_empty() { if !allocated_buffers.colored_vertex_buffer.is_empty() {
command_buffer = command_buffer.draw( command_buffer = command_buffer.draw(
shader.get_pipeline().clone(), shader.get_pipeline().clone(),
&self.dynamic_state.clone(), &self.dynamic_state.clone(),
@ -529,10 +529,10 @@ impl CanvasState {
} }
// Text // Text
let mut shader = self.shader_buffers.get( // let mut shader = self.shader_buffers.get(
self.get_shader_handle(String::from("simple_text")) // self.get_shader_handle(String::from("simple_text"))
.unwrap().clone().get_handle() as usize // .unwrap().clone().get_handle() as usize
).unwrap(); // ).unwrap();
// //
// if !self.text_instances.is_empty() { // if !self.text_instances.is_empty() {

@ -3,15 +3,12 @@ pub trait Handle {
fn get_handle(&self) -> u32; fn get_handle(&self) -> u32;
} }
pub enum DrawableHandle { pub enum DrawableHandle {
Texture(CanvasTextureHandle), Texture(CanvasTextureHandle),
Image(CanvasImageHandle), Image(CanvasImageHandle),
Font(CanvasFontHandle), Font(CanvasFontHandle),
} }
/// Typed wrapper for a u32 handle /// Typed wrapper for a u32 handle
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct CanvasFontHandle { pub struct CanvasFontHandle {

@ -14,11 +14,11 @@ use vulkano::pipeline::vertex::{SingleBufferDefinition, VertexDefinition, Vertex
use shade_runner as sr; use shade_runner as sr;
use vulkano::memory::pool::PotentialDedicatedAllocation::Generic; use vulkano::memory::pool::PotentialDedicatedAllocation::Generic;
use vulkano::SafeDeref; use vulkano::SafeDeref;
use crate::canvas::managed::shader::shader_common::{ShaderType, CompiledGraphicsPipelineResources, CompiledGraphicsPipeline}; use crate::canvas::managed::shader::shader_common::{ShaderType, CompiledShaderResources, CompiledShader};
use crate::canvas::managed::handles::CompiledShaderHandle; use crate::canvas::managed::handles::CompiledShaderHandle;
use crate::canvas::managed::shader::dynamic_vertex::RuntimeVertexDef; use crate::canvas::managed::shader::dynamic_vertex::RuntimeVertexDef;
use crate::canvas::managed::ShaderSpecializationConstants; use crate::canvas::managed::ShaderSpecializationConstants;
use crate::util::vertex::{VertexTypes, ColorVertex2D}; use crate::util::vertex::{VertexTypes, ColorVertex3D};
/// CanvasShader holds the pipeline and render pass for the input shader source /// CanvasShader holds the pipeline and render pass for the input shader source
#[derive(Clone)] #[derive(Clone)]
@ -37,10 +37,10 @@ impl GenericShader {
} }
/// Gives CanvasShader the resource functions /// Gives CanvasShader the resource functions
impl CompiledGraphicsPipelineResources for GenericShader {} impl CompiledShaderResources for GenericShader {}
/// Convenience interface so we don't have to juggle shader types /// Convenience interface so we don't have to juggle shader types
impl CompiledGraphicsPipeline for GenericShader { impl CompiledShader for GenericShader {
/// This will explode when the shader does not want to compile /// This will explode when the shader does not want to compile
fn new<V: Vertex>(filename: String, fn new<V: Vertex>(filename: String,

@ -29,7 +29,7 @@ This best works I think if I allow users to
/// Inheriting this gives private functions to grab resources /// Inheriting this gives private functions to grab resources
pub trait CompiledGraphicsPipelineResources { pub trait CompiledShaderResources {
fn get_path(filename: String, shader_type: ShaderType) -> PathBuf { fn get_path(filename: String, shader_type: ShaderType) -> PathBuf {
let project_root = let project_root =
@ -100,7 +100,7 @@ pub trait CompiledGraphicsPipelineResources {
pub trait CompiledGraphicsPipeline { pub trait CompiledShader {
fn new<V>(filename: String, fn new<V>(filename: String,
device: Arc<Device>, device: Arc<Device>,
handle: Arc<CompiledShaderHandle>, handle: Arc<CompiledShaderHandle>,

@ -11,12 +11,12 @@ use std::marker::PhantomData;
use vulkano::pipeline::depth_stencil::{DepthStencil, Compare, DepthBounds, Stencil, StencilOp}; use vulkano::pipeline::depth_stencil::{DepthStencil, Compare, DepthBounds, Stencil, StencilOp};
use vulkano::pipeline::vertex::{SingleBufferDefinition, OneVertexOneInstanceDefinition, Vertex}; use vulkano::pipeline::vertex::{SingleBufferDefinition, OneVertexOneInstanceDefinition, Vertex};
use shade_runner as sr; use shade_runner as sr;
use crate::canvas::managed::shader::shader_common::{ShaderType, CompiledGraphicsPipelineResources, CompiledGraphicsPipeline}; use crate::canvas::managed::shader::shader_common::{ShaderType, CompiledShaderResources, CompiledShader};
use crate::canvas::managed::handles::CompiledShaderHandle; use crate::canvas::managed::handles::CompiledShaderHandle;
use crate::canvas::managed::shader::generic_shader::GenericShader; use crate::canvas::managed::shader::generic_shader::GenericShader;
use crate::canvas::managed::shader::dynamic_vertex::RuntimeVertexDef; use crate::canvas::managed::shader::dynamic_vertex::RuntimeVertexDef;
use crate::canvas::managed::ShaderSpecializationConstants; use crate::canvas::managed::ShaderSpecializationConstants;
use crate::util::vertex::ColorVertex2D; use crate::util::vertex::ColorVertex3D;
/// CanvasShader holds the pipeline and render pass for the input shader source /// CanvasShader holds the pipeline and render pass for the input shader source
@ -34,10 +34,10 @@ pub struct TextShader {
impl TextShader {} impl TextShader {}
/// Gives CanvasShader the resource functions /// Gives CanvasShader the resource functions
impl CompiledGraphicsPipelineResources for TextShader {} impl CompiledShaderResources for TextShader {}
/// Convenience interface so we don't have to juggle shader types /// Convenience interface so we don't have to juggle shader types
impl CompiledGraphicsPipeline for TextShader { impl CompiledShader for TextShader {
/// This will explode when the shader does not want to compile /// This will explode when the shader does not want to compile
fn new<V: Vertex>(filename: String, fn new<V: Vertex>(filename: String,

@ -27,8 +27,9 @@ use crate::compute::compu_frame::CompuFrame;
use crate::canvas::canvas_frame::{CanvasFrame, Drawable}; use crate::canvas::canvas_frame::{CanvasFrame, Drawable};
use crate::compute::managed::compu_sprite::CompuSprite; use crate::compute::managed::compu_sprite::CompuSprite;
use std::sync::Arc; use std::sync::Arc;
use crate::canvas::managed::handles::{CanvasTextureHandle, Handle}; use crate::canvas::managed::handles::{CanvasTextureHandle, Handle, CanvasFontHandle};
use crate::util::vertex::{VertexTypes, TextureVertex2D}; use crate::util::vertex::{VertexTypes, TextureVertex3D};
use crate::compute::managed::handles::{CompuBufferHandle, CompuKernelHandle};
pub mod util; pub mod util;
@ -89,13 +90,11 @@ pub fn main() {
processor.preload_fonts(); processor.preload_fonts();
} }
let q2 = hprof::enter("Game Objects"); let q2 = hprof::enter("Game Objects");
let mut timer = Timer::new(); let mut timer = Timer::new();
let mut frame_future = Box::new(sync::now(processor.device.clone())) as Box<dyn GpuFuture>; let mut frame_future : Box<dyn GpuFuture> =
Box::new(sync::now(processor.device.clone())) as Box<dyn GpuFuture>;
let step_size: f32 = 0.005; let step_size: f32 = 0.005;
let mut elapsed_time: f32; let mut elapsed_time: f32;
@ -104,26 +103,31 @@ pub fn main() {
let mut current_time: f32 = timer.elap_time(); let mut current_time: f32 = timer.elap_time();
let image_data = load_raw(String::from("funky-bird.jpg")); let image_data = load_raw(String::from("funky-bird.jpg"));
let image_dimensions_f = ((image_data.1).0 as f32, (image_data.1).1 as f32); let image_dimensions_f : (f32, f32) = ((image_data.1).0 as f32, (image_data.1).1 as f32);
let image_dimensions_u = image_data.1; let image_dimensions_u : (u32, u32) = image_data.1;
let compu_sprite1 = CompuSprite::new((0.0, -0.5), (0.4, 0.4), 0, image_dimensions_f, let compu_sprite1 : CompuSprite =
// This swap image needs to match the size of the compute CompuSprite::new((0.0, -0.5), (0.4, 0.4), 0, image_dimensions_f,
processor.new_swap_image(image_dimensions_u)); // Swap image to render the result to. Must match dimensions
processor.new_swap_image(image_dimensions_u));
let compute_buffer = processor.new_compute_buffer(image_data.0, image_data.1, 4);
let compute_buffer : Arc<CompuBufferHandle> =
let compute_kernel = processor.get_kernel_handle(String::from("simple-edge.compute")) processor.new_compute_buffer(image_data.0, image_data.1, 4);
let compute_kernel : Arc<CompuKernelHandle> =
processor.get_kernel_handle(String::from("simple-edge.compute"))
.expect("Can't find that kernel"); .expect("Can't find that kernel");
let funky_handle = processor.get_texture_handle(String::from("funky-bird.jpg")).unwrap(); // Get the handles for the assets
let sfml_handle = processor.get_texture_handle(String::from("sfml.png")).unwrap(); let funky_handle : Arc<CanvasTextureHandle> =
let font_handle = processor.get_font_handle(String::from("sansation.ttf")).unwrap(); processor.get_texture_handle(String::from("funky-bird.jpg")).unwrap();
let sfml_handle : Arc<CanvasTextureHandle> =
processor.get_texture_handle(String::from("sfml.png")).unwrap();
let font_handle : Arc<CanvasFontHandle> =
processor.get_font_handle(String::from("sansation.ttf")).unwrap();
let funky_sprite = Sprite::new((0.0, -0.5), (0.5, 0.5), 0, funky_handle.clone()); let funky_sprite = Sprite::new((0.0, -0.5), (0.5, 0.5), 0, funky_handle.clone());
let sfml_sprite = Sprite::new((0.0, -0.5), (0.5, 0.5), 1, sfml_handle.clone()); let sfml_sprite = Sprite::new((0.0, -0.5), (0.5, 0.5), 1, sfml_handle.clone());
//let text_sprite = Text::new((-0.1,-0.1), (10.0, 10.0), font_handle.clone()); //let text_sprite = Text::new((-0.1,-0.1), (10.0, 10.0), font_handle.clone());
//let test_polygon = Poly::new_with_color((-0.5, -0.5), (0.5, 0.5), 1, (1.0,0.0,0.0,0.0)); //let test_polygon = Poly::new_with_color((-0.5, -0.5), (0.5, 0.5), 1, (1.0,0.0,0.0,0.0));
drop(q2); drop(q2);

@ -2,7 +2,7 @@ use std::sync::Arc;
use crate::canvas::*; use crate::canvas::*;
use crate::canvas::managed::handles::{CanvasFontHandle, CanvasImageHandle, CanvasTextureHandle, Handle}; use crate::canvas::managed::handles::{CanvasFontHandle, CanvasImageHandle, CanvasTextureHandle, Handle};
use crate::canvas::canvas_frame::{Drawable}; use crate::canvas::canvas_frame::{Drawable};
use crate::util::vertex::{VertexTypes, TextureVertex2D, Vertex3D}; use crate::util::vertex::{VertexTypes, TextureVertex3D, Vertex3D};
/// ///
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
@ -25,8 +25,29 @@ impl Sprite {
let normalized_depth = (depth as f32 / 255.0); let normalized_depth = (depth as f32 / 255.0);
let verts = vec![
TextureVertex3D{
v_position: [position.0, position.1, normalized_depth], // top left
ti_position: [-0.0, -0.0] },
TextureVertex3D{
v_position: [position.0, position.1 + size.1, normalized_depth], // bottom left
ti_position: [-0.0, 1.0] },
TextureVertex3D{
v_position: [position.0 + size.0, position.1 + size.1, normalized_depth], // bottom right
ti_position: [1.0, 1.0] },
TextureVertex3D{
v_position: [position.0, position.1, normalized_depth], // top left
ti_position: [-0.0, -0.0] },
TextureVertex3D{
v_position: [position.0 + size.0, position.1 + size.1, normalized_depth], // bottom right
ti_position: [1.0, 1.0] },
TextureVertex3D{
v_position: [position.0 + size.0, position.1, normalized_depth], // top right
ti_position: [1.0, -0.0] },
];
Sprite { Sprite {
verts: VertexTypes::TextureType(Vec::new(), texture_handle), verts: VertexTypes::TextureType(verts, texture_handle),
position: position, position: position,
size: size, size: size,
} }

@ -4,25 +4,25 @@ use vulkano::buffer::BufferAccess;
use std::collections::HashMap; use std::collections::HashMap;
#[derive(Default, Debug, Clone, Copy)] #[derive(Default, Debug, Clone, Copy)]
pub struct TextureVertex2D { pub struct TextureVertex3D {
pub v_position: [f32; 2], pub v_position: [f32; 3],
pub ti_position: [f32; 2], pub ti_position: [f32; 2],
} }
vulkano::impl_vertex!(TextureVertex2D, v_position, ti_position); vulkano::impl_vertex!(TextureVertex3D, v_position, ti_position);
#[derive(Default, Debug, Clone, Copy)] #[derive(Default, Debug, Clone, Copy)]
pub struct ColorVertex2D { pub struct ColorVertex3D {
pub v_position: [f32; 2], pub v_position: [f32; 3],
pub color: [f32; 4], pub color: [f32; 4],
} }
vulkano::impl_vertex!(ColorVertex2D, v_position, color); vulkano::impl_vertex!(ColorVertex3D, v_position, color);
#[derive(Default, Debug, Clone, Copy)] #[derive(Default, Debug, Clone, Copy)]
pub struct ImageVertex2D { pub struct ImageVertex3D {
pub v_position: [f32; 2], pub v_position: [f32; 3],
pub color: [f32; 4], pub ti_position: [f32; 2],
} }
vulkano::impl_vertex!(ImageVertex2D, v_position, color); vulkano::impl_vertex!(ImageVertex3D, v_position, ti_position);
#[derive(Default, Debug, Clone, Copy)] #[derive(Default, Debug, Clone, Copy)]
pub struct Vertex3D { pub struct Vertex3D {
@ -52,9 +52,9 @@ vulkano::impl_vertex!(GlyphInstance, screen_position, atlas_position, atlas_size
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum VertexTypes { pub enum VertexTypes {
TextureType(Vec<TextureVertex2D>, Arc<CanvasTextureHandle>), TextureType(Vec<TextureVertex3D>, Arc<CanvasTextureHandle>),
ImageType(Vec<ImageVertex2D>, Arc<CanvasImageHandle>), ImageType(Vec<ImageVertex3D>, Arc<CanvasImageHandle>),
ColorType(Vec<ColorVertex2D>), ColorType(Vec<ColorVertex3D>),
ThreeDType(Vec<Vertex3D>), ThreeDType(Vec<Vertex3D>),
} }

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

Loading…
Cancel
Save