-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fixed incorrect behaviour of headless_renderer depending on image dimensions #13388
Fixed incorrect behaviour of headless_renderer depending on image dimensions #13388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix seems fine, but I think it would be helpful to include the context about why we're doing this in the source itself.
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
423118e
to
7bff4ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work.
If I ask for an image of 1080x1080:
thread '<unnamed>' panicked at examples/app/headless_renderer.rs:517:49:
range end index 4320 out of range for slice of length 2560
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `headless_renderer::update`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
Co-authored-by: François Mockers <francois.mockers@vleue.com>
Looks like problem of 1080x1080 was in last row, which somehow is reminder of division by aligned_row_bytes. I cut off remaining rows, this reinsurance works well alone, but i will keep them both. Literaly buffer has length 5529600, aligned row has length 4352, it turns out 1270 full rows (not 1080!) and 2560 bytes in partial row |
@mockersf May I ask you for review? |
Objective
headless_renderer
example #13384 .Solution
Testing