Skip to content

Commit

Permalink
ktx2: Fix Rgb8 -> Rgba8Unorm conversion (#9555)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
superdump committed Aug 24, 2023
1 parent 228e7aa commit b88ff15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_render/src/texture/ktx2.rs
Expand Up @@ -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]);
}
}
}
Expand Down

0 comments on commit b88ff15

Please sign in to comment.