diff --git a/src/canvas/canvas_buffer.rs b/src/canvas/canvas_buffer.rs index 1c0d50b6..5522ddb9 100644 --- a/src/canvas/canvas_buffer.rs +++ b/src/canvas/canvas_buffer.rs @@ -6,8 +6,8 @@ use vulkano::sampler::Sampler; use vulkano::descriptor::DescriptorSet; use vulkano::descriptor::descriptor_set::PersistentDescriptorSet; use vulkano::buffer::CpuAccessibleBuffer; -use crate::canvas::canvas_text::{CanvasTextCacheHandle, CanvasFontHandle}; use vulkano::pipeline::GraphicsPipelineAbstract; +use crate::canvas::canvas_text::CanvasFontHandle; #[derive(Clone)] pub struct CanvasTexture { @@ -53,7 +53,7 @@ impl CanvasImage { #[derive(Clone)] pub struct CanvasTextCache { - pub(crate) handle: Arc, + //pub(crate) handle: Arc, pub(crate) buffer: Arc>, pub(crate) size: (u32, u32), } diff --git a/src/canvas/canvas_state.rs b/src/canvas/canvas_state.rs index 4bb02ef0..e9585bfb 100644 --- a/src/canvas/canvas_state.rs +++ b/src/canvas/canvas_state.rs @@ -565,25 +565,25 @@ impl CanvasState { } // Text - let mut shader = self.text_buffers.get( - self.get_shader_handle(String::from("simple_text")) - .unwrap().clone().handle as usize - ).unwrap(); - - if !self.text_vertex_buffer.is_empty() { - for (text_handle, vertex_buffer) in self.text_vertex_buffer.clone() { - let handle = texture_handle.clone().handle as usize; - let descriptor_set = self.text_buffers.get(handle).clone().unwrap().clone() - .get_descriptor_set(shader.get_pipeline(), self.sampler.clone()); - - command_buffer = command_buffer.draw( - shader.get_pipeline().clone(), - // Multiple vertex buffers must have their definition in the pipeline! - &self.dynamic_state.clone(), vec![vertex_buffer], - vec![descriptor_set], (), - ).unwrap(); - } - } +// let mut shader = self.text_buffers.get( +// self.get_shader_handle(String::from("simple_text")) +// .unwrap().clone().handle as usize +// ).unwrap(); + +// if !self.text_vertex_buffer.is_empty() { +// for (text_handle, vertex_buffer) in self.text_vertex_buffer.clone() { +// let handle = text_handle.clone().handle as usize; +// let descriptor_set = self.text_buffers.get(handle).clone().unwrap().clone() +// .get_descriptor_set(shader.get_pipeline(), self.sampler.clone()); +// +// command_buffer = command_buffer.draw( +// shader.get_pipeline().clone(), +// // Multiple vertex buffers must have their definition in the pipeline! +// &self.dynamic_state.clone(), vec![vertex_buffer], +// vec![descriptor_set], (), +// ).unwrap(); +// } +// } command_buffer .end_render_pass() diff --git a/src/canvas/canvas_text.rs b/src/canvas/canvas_text.rs index de73f232..5c8fa65d 100644 --- a/src/canvas/canvas_text.rs +++ b/src/canvas/canvas_text.rs @@ -78,9 +78,9 @@ impl CanvasText { size: f32, color: [f32; 4], text: &str) { let glyphs: Vec = self.font.layout(text, Scale::uniform(size), point(x, y)).map(|x| x.standalone()).collect(); - for glyph in &glyphs { - self.cache.queue_glyph(0, glyph.clone()); - } +// for glyph in &glyphs { +// self.cache.queue_glyph(0, glyph.clone()); +// } // self.texts.push(TextData { // glyphs: glyphs.clone(), // color: color, diff --git a/src/main.rs b/src/main.rs index 0c11fcfb..6731f090 100644 --- a/src/main.rs +++ b/src/main.rs @@ -177,7 +177,7 @@ pub fn main() { drop(l); - +return; hprof::end_frame(); hprof::profiler().print_timing(); }