Skip to content

Dangerous use of statics #46

@petiaccja

Description

@petiaccja

ScreenSpaceAmbientOcclusion:28
static int temporalIndex = 0;

You do NOT ever ever ever ever ever ever ever ever ever use statics to store persistent class-scope read-write data, because it is ugly. Furthermore, it will crash as soon as two instances of the class exist, especially in a multithreaded environment. And no, thread_local is just as bad.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions