bevy icon indicating copy to clipboard operation
bevy copied to clipboard

DRY out `bevy_render` `Color` function bodies.

Open frewsxcv opened this issue 3 years ago • 4 comments
trafficstars

Just some general cleanup, reusing other functions

frewsxcv avatar Sep 09 '22 02:09 frewsxcv

Thanks for the cleanup :)

alice-i-cecile avatar Sep 09 '22 13:09 alice-i-cecile

could you inline the various as_*_f32 functions? I think the rgba linear is already, but not the hsla or rgba

mockersf avatar Sep 09 '22 17:09 mockersf

Any reason why we're inlining these functions in particular? It looks like most of the APIs in bevy are not currently marked as inlined.

frewsxcv avatar Sep 10 '22 22:09 frewsxcv

Any reason why we're inlining these functions in particular? It looks like most of the APIs in bevy are not currently marked as inlined.

Rule of thumb we've been following is "tiny methods that may be called in a hot loop". It won't matter for final release builds as they'll use Link Time Optimization, but this can help make the dev experience more reflective of final performance.

alice-i-cecile avatar Sep 12 '22 01:09 alice-i-cecile