Skip to content

[Migrated] For loops need more optimizations #123

@rust-gpu-bot

Description

@rust-gpu-bot

Issue automatically imported from old repo: EmbarkStudios/rust-gpu#739
Old labels: t: enhancement,a: codegen
Originally creatd by hrydgard on 2021-08-30T12:50:21Z


Due to how for loops over a range work in Rust, a lot of scaffolding code is generated that is then expected to be optimized away, but in rust-gpu, that doesn't happen enough yet. We had a case where I had to change a for i in 0..8 {} to a while i < 8 { ...; i++ } loop to work around SPIRV-Cross making a right mess out of it.

Filing this issue to have something to point to from the code comment, mainly, not expectations for a quick resolution as I know it's a thorny one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions