Skip to content

Handle graphics context loss for PixiJS (buildings/structure icons dissapear or never appear) #2147

@VariableVince

Description

@VariableVince

Fix for eg. 'buildings and boats vanish': https://discord.com/channels/1284581928254701718/1414525013402587199/1414525013402587199

Since PR #1667, context loss is handled for Canvas. No context restore has been implemented for the PixiJS layer though. There is a function called something like handleContextLoss for this in PixiJS which was at first (confusingly) only for testing purposes, but since somewhere in 2023 it actually handles context loss like the name suggests. This should prevent some cases where structures or icons go missing from the screen.

PR 1667 notes about this "This PR represents a partial fix for the context loss issue. Specifically, the StructureIconsLayer remains in a broken state after context restoration. This layer is rendered using Pixi.js, which has its own specific process for handling renderer recovery. Due to my lack of experience with the Pixi.js API, I was unable to implement the fix for this layer. This would be an excellent follow-up contribution for someone familiar with Pixi."

See also discussion mostly about Canvas 2D here, with a mention of PixiJS:
https://discord.com/channels/1359946986937258015/1383112688082620509/1400649645809602571

Other relevant bug reports, some with screenshots also from the console:
https://discord.com/channels/1284581928254701718/1439606494910873671/1439606494910873671

https://discord.com/channels/1284581928254701718/1431724493402800158

https://discord.com/channels/1284581928254701718/1414774471784534026

https://discord.com/channels/1284581928254701718/1414525013402587199

https://discord.com/channels/1284581928254701718/1396795776256184422

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions