diff options
Diffstat (limited to 'stockton-render/src/draw/render.rs')
-rw-r--r-- | stockton-render/src/draw/render.rs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/stockton-render/src/draw/render.rs b/stockton-render/src/draw/render.rs index b2e9f97..2cbdef4 100644 --- a/stockton-render/src/draw/render.rs +++ b/stockton-render/src/draw/render.rs @@ -1,10 +1,11 @@ use crate::draw::draw_buffers::INITIAL_INDEX_SIZE; use crate::draw::draw_buffers::INITIAL_VERT_SIZE; use crate::draw::UvPoint; -use arrayvec::ArrayVec; use faces::FaceType; -use hal::prelude::*; -use std::convert::TryInto; +use std::{ + convert::TryInto, + iter::{empty, once}, +}; use stockton_levels::prelude::*; use stockton_types::Vector2; @@ -16,16 +17,14 @@ use super::texture::TextureRepo; fn draw_or_queue( current_chunk: usize, tex_repo: &mut TextureRepo, - cmd_buffer: &mut CommandBuffer, - pipeline_layout: &PipelineLayout, + cmd_buffer: &mut CommandBufferT, + pipeline_layout: &PipelineLayoutT, chunk_start: u32, curr_idx_idx: u32, ) { if let Some(ds) = tex_repo.attempt_get_descriptor_set(current_chunk) { - let mut descriptor_sets: ArrayVec<[_; 1]> = ArrayVec::new(); - descriptor_sets.push(ds); unsafe { - cmd_buffer.bind_graphics_descriptor_sets(pipeline_layout, 0, descriptor_sets, &[]); + cmd_buffer.bind_graphics_descriptor_sets(pipeline_layout, 0, once(ds), empty()); cmd_buffer.draw_indexed(chunk_start * 3..(curr_idx_idx * 3) + 1, 0, 0..1); } } else { @@ -34,10 +33,10 @@ fn draw_or_queue( } pub fn do_render<M: MinBspFeatures<VulkanSystem>>( - cmd_buffer: &mut CommandBuffer, + cmd_buffer: &mut CommandBufferT, draw_buffers: &mut DrawBuffers<UvPoint>, tex_repo: &mut TextureRepo, - pipeline_layout: &PipelineLayout, + pipeline_layout: &PipelineLayoutT, file: &M, faces: &[u32], ) { |