ktx2: Fix Rgb8 -> Rgba8Unorm conversion (#9555)

# Objective

- Fixes #9552 

## Solution

- Only n_pixels bytes of data was being copied instead of 1 byte per
component, i.e. n_pixels * 4

---

## Changelog

- Fixed: loading of Rgb8 ktx2 files.
This commit is contained in:
Robert Swain 2023-08-24 02:35:52 +02:00 committed by GitHub
parent 228e7aa618
commit b88ff154f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,7 +139,7 @@ pub fn ktx2_buffer_to_image(
rgba[i * 4 + 2] = level_data[offset + 2];
offset += 3;
}
transcoded[level].extend_from_slice(&rgba[0..n_pixels]);
transcoded[level].extend_from_slice(&rgba[0..n_pixels * 4]);
}
}
}