Engine apps manage every rendering resource themselves

Aperta
#32 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with the engine backends' Renderer and presentation target, the RenderContext they expose each frame, and Application::resize, then read the bloom example where bloom_half is sampled twice in one frame. Read PR #31 for the current per-sampler Texture and update_from pattern. This is a design decision about what the engine owns, so the work is agreeing on the ownership model with the maintainer before any code changes. Done means a decision is recorded and the chosen API is implemented consistently.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Apps built on engine own and manage nearly every rendering resource themselves. The engine backends own only the Renderer and the presentation target, and expose them through RenderContext each frame. Everything else is a field on the app struct and is handled by hand:

  • offscreen RenderTargets, which the app also has to resize in Application::resize;
  • pipelines and models;
  • the storage for sampling a render target as a texture. Reusing it across frames means holding one Texture per place a target is sampled and calling update_from on it each frame (PR #31). A target sampled twice in one frame, as bloom_half is in the bloom example, needs two.

Multipass apps therefore carry a lot of bookkeeping that the engine could do, and resource handling is split inconsistently between engine-owned (presentation target) and app-owned (everything else).

Expected

Decide how much the engine owns, and make it consistent. One candidate for render-target textures: a private pool owned by each backend and reached through the context, so apps store nothing:

impl RenderContext<'_> {
    /// A texture of the target's current pixels, in storage reused from earlier frames.
    pub fn render_target_texture(&mut self, target: &RenderTarget) -> Texture { … }
}

let scene = Arc::new(
    context
        .render_target_texture(&self.scene_target)
        .sampler(WrapMode::Clamp, FilterMode::Linear),
);

The pool would hand out any buffer of the right length that no live sampler still shares, so it grows to the peak number of simultaneously live snapshots. The same question applies to offscreen render targets (engine-owned, resized automatically) and possibly pipelines.

Lingua principale
Rust
Stelle
1
Fork
1
Merge medio
6h 52m
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di costott/cpu_rasteriser

Tutte le issue di costott/cpu_rasteriser

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.