diff options
Diffstat (limited to 'wgpu/src/image')
-rw-r--r-- | wgpu/src/image/raster.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/wgpu/src/image/raster.rs b/wgpu/src/image/raster.rs index 3edec57e..4f69df8c 100644 --- a/wgpu/src/image/raster.rs +++ b/wgpu/src/image/raster.rs @@ -55,6 +55,21 @@ impl Cache { Memory::Invalid } } + image::Data::Pixels { + width, + height, + pixels, + } => { + if let Some(image) = ::image::ImageBuffer::from_vec( + *width, + *height, + pixels.to_vec(), + ) { + Memory::Host(image) + } else { + Memory::Invalid + } + } }; self.insert(handle, memory); |