![]() # Objective allow throttling of gpu uploads to prevent choppy framerate when many textures/meshes are loaded in. ## Solution - `RenderAsset`s can implement `byte_len()` which reports their size. implemented this for `Mesh` and `Image` - users can add a `RenderAssetBytesPerFrame` which specifies max bytes to attempt to upload in a frame - `render_assets::<A>` checks how many bytes have been written before attempting to upload assets. the limit is a soft cap: assets will be written until the total has exceeded the cap, to ensure some forward progress every frame notes: - this is a stopgap until we have multiple wgpu queues for proper streaming of data - requires #12606 issues - ~~fonts sometimes only partially upload. i have no clue why, needs to be fixed~~ fixed now. - choosing the #bytes is tricky as it should be hardware / framerate dependent - many features are not tested (env maps, light probes, etc) - they won't break unless `RenderAssetBytesPerFrame` is explicitly used though --------- Co-authored-by: IceSentry <IceSentry@users.noreply.github.com> Co-authored-by: François Mockers <francois.mockers@vleue.com> |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |