From 9d720593e9f4829e2bb81534ef54545a61b3df00 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:21 +0100 Subject: refactor(render): give some functions less arguments --- stockton-render/src/draw/target.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'stockton-render/src/draw/target.rs') diff --git a/stockton-render/src/draw/target.rs b/stockton-render/src/draw/target.rs index 5e0ade0..1260c49 100644 --- a/stockton-render/src/draw/target.rs +++ b/stockton-render/src/draw/target.rs @@ -20,6 +20,8 @@ use crate::types::*; use core::{iter::once, mem::ManuallyDrop}; use arrayvec::ArrayVec; +use draw::buffer::ModifiableBuffer; +use draw::draw_buffers::DrawBuffers; use hal::{ format::{ChannelType, Format, Swizzle}, image::{Extent, Usage as ImgUsage, ViewKind}, @@ -258,8 +260,7 @@ impl TargetChain { pub fn prep_next_target<'a>( &'a mut self, device: &mut Device, - vert_buffer: &Buffer, - index_buffer: &Buffer, + draw_buffers: &mut DrawBuffers, renderpass: &RenderPass, pipeline: &GraphicsPipeline, pipeline_layout: &PipelineLayout, @@ -313,10 +314,11 @@ impl TargetChain { // Get references to our buffers let (vbufs, ibuf) = { - let vbufref: &::Buffer = vert_buffer; + let vbufref: &::Buffer = + draw_buffers.vertex_buffer.get_buffer(); let vbufs: ArrayVec<[_; 1]> = [(vbufref, SubRange::WHOLE)].into(); - let ibuf = index_buffer; + let ibuf = draw_buffers.index_buffer.get_buffer(); (vbufs, ibuf) }; -- cgit v1.2.3