Skip to content

Some machine doesn't like singleton implementation #168

@ntut-rick

Description

@ntut-rick

Problem

On macOS, some programs will experience significant performance hits when items on screen gets too many. According to this answer on Stack Overflow, using singletons with OpenGL uniform buffers prevents macOS's OpenGL to Metal wrapper to perform parallelization optimizations. For whatever reason this doesn't seem to happen on Windows or Linux OpenGL driver implementations (or Intel / AMD / Nvidia)

Fixing history

Other Info

There are other resources such as Program and VertexArray that are still singletons. However, the difference is they are not updated every frame like UniformBuffer I don't know if changing those to normal class members will incur a performance penalty or not as I haven't properly configured profiling on a macOS machine. I'll leave them as is.

Originally posted by @NOOBDY in #162 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🆕 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions