mirror of
https://github.com/bevyengine/bevy
synced 2025-01-07 18:58:58 +00:00
91a393a9e2
# 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> |
||
---|---|---|
.. | ||
basis.rs | ||
compressed_image_saver.rs | ||
dds.rs | ||
exr_texture_loader.rs | ||
fallback_image.rs | ||
hdr_texture_loader.rs | ||
image.rs | ||
image_loader.rs | ||
image_texture_conversion.rs | ||
ktx2.rs | ||
mod.rs | ||
texture_attachment.rs | ||
texture_cache.rs |