Skip to content

Improve safety of bevy_mikktspace #7372

@LaylBongers

Description

@LaylBongers

What problem does this solve or what need does it fill?

I'm the original author of the port of the mikktspace library to generated Rust code. While this originally solved its purpose of making the crate easier to compile to WASM targets without the need for a C compiler, the auto-generated code with heavy manual fixes was always meant to be replaced eventually. See:

//! Everything in this module is pending to be refactored, turned into idiomatic-rust, and moved to
//! other modules.

What solution would you like?

I do not think that unsafety is necessary for the majority of this algorithm, its maintainability can be improved without a bit hit on performance by starting to port more sections of it to idiomatic rust, with appropriate benchmarks and tests to validate the process.

What alternative(s) have you considered?

Re-implementing from scratch isn't particularly useful as it's a small enough surface area where a gradual port would work better. The original crate does still exist too and improvements could be made there, I couldn't quite find the reason for the fork, was this just to make it easier to maintain?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-Code-QualityA section of code that is hard to understand or changeC-DependenciesA change to the crates that Bevy depends onP-UnsoundA bug that results in undefined compiler behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions