Skip to content

infinite for loops due to iTime can hang and panic. #35

@Vipitis

Description

@Vipitis

connection: gfx-rs/wgpu#5926

I seem to run into this quite a bit recently. Some for loop is eventually dependant on some uniform (often iTime) and therefore might be an infinite loop. Infinite loops with hard coded values do get compiled away and are not an issue it seems.

since this behaviour isn't going to be changed in wgpu-core, and the uncaptured error isn't captured in wgpu-py this will panic with a "device is lost", after essentially some timeout.
If we want to mimic the behaviour on the website, this should somehow just work. Maybe by skipping the 0th frame or something, if it starts to hang.

I tried to help the compiler by wrapping the uniforms in max(), min() or maybe abs() (since negative numbers in that examples are a problem) - but nothing seems to help.

Using this issue to track changes to the behaviour in the upstream deps and maybe finding a solution someday.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions