Skip to content

Misuse of Metal API in rendering preperation #20048

Open
@Kees-van-Beilen

Description

@Kees-van-Beilen

Summary

On MacOS (and iOS) roughly every frame the render pipeline allocates a new temporary buffer, it also reinterprets the currently used texture buffers. This is bad practise as when using the Metal framework MTLBuffers should persist as long as possible and not just a single frame. Also whilst the texture reinterpretations aren't costly at all they do make a small obj-c allocation every frame for every texture.

This might (but probably not directly) be related to the high cpu usage found in #10261

Additionally:

Bevy version

Tested on:

  • 0d23d71 bevy 0.11.3
  • 6178ce9
  • cb64a4a bevy 0.17-dev (current main)
    All of these have the same bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorC-PerformanceA change motivated by improving speed, memory usage or compile timesO-MacOSSpecific to the MacOS (Apple) desktop operating system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions