bevyengine / bevyengine/bevy

Consider removing `RetainedViewEntity`

Open
#25,257 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Code-Quality S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

`RetainedViewEntity` is used as a stable identifier across frames

https://github.com/bevyengine/bevy/blob/25368b78ce5e9b15dc770cdf2af4595602cc8a7b/crates/bevy_render/src/view/mod.rs#L268-L278

Since https://github.com/bevyengine/bevy/issues/18722 is fixed, the render entity across frames should be stable now. We can try replacing `RetainedViewEntity` with `Entity` and use faster `EntityHasher`.

Also `ViewKeyCache` may be converted from a Hashmap to a Component.

Contributor guide

Open the contributing guide

Research direction

Start in crates/bevy_render/src/view/mod.rs at RetainedViewEntity and trace its usages, then inspect ViewKeyCache and EntityHasher. Compare the assumptions behind issue #18722 with current render behavior; done means safely replacing the retained identifier and evaluating the cache conversion without breaking cross-frame view tracking.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.