texture: Avoid clone image
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 9m15s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 9m15s
This commit is contained in:
parent
29a4da5666
commit
a0fce9c08e
1 changed files with 7 additions and 2 deletions
|
@ -54,7 +54,7 @@ impl Texture {
|
|||
let image_data = image.to_rgba8();
|
||||
let image_dimensions = image_data.dimensions();
|
||||
|
||||
let upload_buffer = Buffer::from_iter(
|
||||
let upload_buffer = Buffer::new_slice::<u8>(
|
||||
memory_allocator.clone(),
|
||||
BufferCreateInfo {
|
||||
usage: BufferUsage::TRANSFER_SRC,
|
||||
|
@ -65,9 +65,14 @@ impl Texture {
|
|||
| MemoryTypeFilter::HOST_SEQUENTIAL_WRITE,
|
||||
..Default::default()
|
||||
},
|
||||
image_data.to_vec(),
|
||||
image_data.len() as u64,
|
||||
)?;
|
||||
|
||||
{
|
||||
let buffer_data = &mut *upload_buffer.write()?;
|
||||
buffer_data.copy_from_slice(image_data.as_bytes());
|
||||
}
|
||||
|
||||
let image = Image::new(
|
||||
memory_allocator.clone(),
|
||||
ImageCreateInfo {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue