Skip to content

Fix early return in image State::prepare skipping layer finalization#3292

Open
f-o-o-g-s wants to merge 1 commit intoiced-rs:masterfrom
f-o-o-g-s:fix/image-prepare-continue
Open

Fix early return in image State::prepare skipping layer finalization#3292
f-o-o-g-s wants to merge 1 commit intoiced-rs:masterfrom
f-o-o-g-s:fix/image-prepare-continue

Conversation

@f-o-o-g-s
Copy link

The sub-pixel bounds guards added in 0fe99b1 and 1463ec8 use return instead of continue inside the image loop in State::prepare. When any image in the batch has bounds smaller than 1px, return exits the whole function instead of just skipping that image. This means layer.push(), layer.prepare(), and the instance vec .clear() calls at the bottom never run, which leaves stale instances around and causes a wgpu buffer validation error on the next frame.

This changes both to continue so we just skip the sub-pixel image and let the rest of the function finish normally.

Fixes #3272

The sub-pixel bounds guards added in 0fe99b1 and 1463ec8 use
return instead of continue, so hitting one small image bails out
of the whole function and skips the layer.push, layer.prepare,
and .clear calls at the end. This leaves stale instances around
and causes a wgpu buffer validation error on the next frame.

Fixes iced-rs#3272
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wgpu image pipeline crash on window resize — possible return vs continue issue in image State::prepare

1 participant