diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:22 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:22 +0100 |
commit | d7d0f0277c437004ed476393542da39c84c5cf9f (patch) | |
tree | 65c369e00fc1416c74019fde4456b0bf90d3067c /stockton-render/src/draw/render.rs | |
parent | 10b3d4ac59e826b31d2114999e31893390acfb9c (diff) |
chore(render): update hal and fix some errors
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], ) { |