Skip to content

PLAT-12035: stop Tr2InteriorScene re-creating shadow maps on every li… - #128

Open
JohnGreenFC wants to merge 2 commits into
mainfrom
PLAT-12035-interior-scene-shadow-map-recreation
Open

JohnGreenFC wants to merge 2 commits into
mainfrom
PLAT-12035-interior-scene-shadow-map-recreation

Conversation

@JohnGreenFC

Copy link
Copy Markdown

Summary

Tr2InteriorScene rebuilt every spotlight shadow map and the shared depth stencil on each light add/remove, lights-list load, and shadowSize/shadowCount change. Loading an interior scene with four lights created and discarded the 1024x1024 targets many times before the first frame.

  • Mark the shadow maps dirty instead and rebuild lazily in RenderShadows.
  • SetupShadowMaps keeps targets that are valid and the right size, trims or appends to the wanted count, and only recreates the depth stencil when its size changes.

Linked issue (optional)

Refs PLAT-12035 (from the Tracy review in PLAT-8958).

Testing

Windows, DX12, trinitydev flavor.

  • Probe scene replaying the NPE light setup sequence: shadow map setup went from 19.65 ms to 0.01 ms per sequence.
  • EVE Online client, eight AIR NPE conversation popups under Tracy: Tr2RenderTarget::Create per popup went from 98 to 18 and ~32 ms to ~5 ms, with no 1024x1024 ShadowMap churn. Shadows render unchanged.

AI assistance

Used for testing and validation

Checklist

  • Read CONTRIBUTING.md.
    • Commits follow the commit-message style described there.
    • No tests added; covered by the probe and client measurements above.
    • No API or documented behaviour change.

…ght change

Adding or removing a light, loading the lights list, or setting shadowSize or
shadowCount each rebuilt every spotlight shadow map and the shared depth stencil
immediately. Loading an interior scene with four lights created and discarded
the 1024x1024 targets many times before the first frame.

Mark the shadow maps dirty instead and rebuild them lazily in RenderShadows.
SetupShadowMaps now keeps existing targets that are valid and the right size,
trims or appends to reach the wanted count, and only recreates the depth
stencil when its size changes.
Copilot AI balanced review requested due to automatic review settings October 19, 2026 14:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JohnGreenFC
JohnGreenFC marked this pull request as ready for review October 19, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants