image-regions-v2 branch: layer cache invalidation and sort key

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Start in engine/render/r_main.cpp, reading IsDirty, ProcessCommands, MakeShapeSortKey, EmitSprite and DispatchGroup around the cited lines on branch feat/image-regions-v2 at commit 1b51acd. Trace how texture completion, viewport and texture IDs, screen size, and sampler setup affect cached layer replay. Done when the four reported cache invalidation, sort key, resize, and texture setup issues are addressed and the affected rendering behavior is verified.

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

Descrizione

This is about the WIP branch feat/image-regions-v2 on your fork (at 1b51acd), since issues are turned off there. I read through it and these are the places where I think changes are needed.

Pending textures keep a layer dirty forever. usedIncompleteTextures is only ever set to true (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2373-L2375) and ProcessCommands doesn't reset it (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L748-L758). When an async texture finishes, the command bytes stay the same (same pointer), so the layer isn't reassembled either, and IsDirty() always returns false (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L193-L197). I think that means elision stays off once a layer has drawn a loading texture, and region UVs stay based on the placeholder size, since EmitSprite clamps the size to 1 (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2466-L2468). A texture generation counter that IsDirty() checks would cover both.

Sort key arguments are swapped. MakeShapeSortKey takes (effectTag, effectUser, viewportId, texId) (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2263), but both callers pass texMemo, vpMemo (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2601 and https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2634). With the viewport bits masked out, shapes are sorted by viewport instead of texture.

Screen size isn't in the cache key. screenSize is latched in ProcessCommands (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L751) and used for glViewport, u_screenSize and the scissor flip (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2677-L2680, https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2711-L2713). A layer whose commands stay the same across a resize would replay with the old size.

Cache hits still pay the full texture setup. DispatchGroup sets every sampler uniform and rebinds every unit for each batch (https://github.com/zao/PathOfBuilding-SimpleGraphic/blob/1b51acd62a6beac96bdf5c26c3e02e484b68d255/engine/render/r_main.cpp#L2718-L2730). Setting the uniforms once after linking and binding only the used units would make a replay much cheaper.

Lingua principale
C++
Stelle
23
Fork
69
Merge medio
2h 50m
PR unite (30g)
1

Preparare l'ambiente

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 PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic

Tutte le issue di PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.