Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load KTX2 cubemap #9552

Closed
afpatmin opened this issue Aug 23, 2023 · 1 comment · Fixed by #9555
Closed

Unable to load KTX2 cubemap #9552

afpatmin opened this issue Aug 23, 2023 · 1 comment · Fixed by #9555
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior

Comments

@afpatmin
Copy link

Bevy version

0.11.2

[Optional] Relevant system information

Cargo: 1.71.1
OS: Windows 11
AdapterInfo { name: "NVIDIA GeForce RTX 2080", vendor: 4318, device: 7810, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "536.67", backend: Vulkan }

What you did

Tried to load a ktx2 cubemap texture

What went wrong

The image didn't load and panic in texture loading thread

Additional information

Console output:
thread 'IO Task Pool (0)' panicked at 'range end index 524288 out of range for slice of length 393216', [...]\bevy_render-0.11.2\src\texture\ktx2.rs:262:53

space.zip

@afpatmin afpatmin added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Aug 23, 2023
@afpatmin
Copy link
Author

afpatmin commented Aug 23, 2023

The ktx file was generated using the following command:
toktx --cubemap --t2 space right.png left.png top.png bottom.png front.png back.png

The input .png files were 256x256 pixels

The example file Ryfjallet_cubemap_bc7.ktx2 works fine

@superdump superdump added A-Assets Load files from disk to use for things like images, models, and sounds and removed S-Needs-Triage This issue needs to be labelled labels Aug 24, 2023
github-merge-queue bot pushed a commit that referenced this issue Aug 24, 2023
# 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants