From c0996923c6aab39bb61ca6d3310149c66a73fac8 Mon Sep 17 00:00:00 2001 From: Malte Veerman Date: Fri, 17 Jan 2020 20:15:20 +0100 Subject: Batch image draw calls into one with multiple instances --- wgpu/src/image/raster.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'wgpu/src/image/raster.rs') diff --git a/wgpu/src/image/raster.rs b/wgpu/src/image/raster.rs index 387bd23a..bca2ebda 100644 --- a/wgpu/src/image/raster.rs +++ b/wgpu/src/image/raster.rs @@ -3,7 +3,6 @@ use iced_native::image; use std::{ collections::{HashMap, HashSet}, }; -use guillotiere::Size; use debug_stub_derive::*; #[derive(DebugStub)] @@ -72,17 +71,10 @@ impl Cache { encoder: &mut wgpu::CommandEncoder, atlas_array: &mut TextureArray, ) -> &Memory { - let _ = self.load(handle); - - let memory = self.map.get_mut(&handle.id()).unwrap(); + let memory = self.load(handle); if let Memory::Host(image) = memory { - let (width, height) = image.dimensions(); - let size = Size::new(width as i32, height as i32); - - let allocation = atlas_array.allocate(size); - - atlas_array.upload(image, &allocation, device, encoder); + let allocation = atlas_array.upload(image, device, encoder); *memory = Memory::Device(allocation); } -- cgit