Skip to content

Turn off Metal retain_command_buffer_references flag #8747

@andyleiserson

Description

@andyleiserson

Metal has an option to retain (or not) strong references to the resources used in a command buffer. MTL4CommandBuffer never keeps strong references.

#7842 turned on the retain references flag to fix resource management problems. However, we expect that performance could be improved if we don't set it (and with Metal 4, it won't be an option). There are also some indications that retaining references can cause memory leaks (#8694, #8706). So it would be nice to turn it back off.

Before turning it back off, we need to ensure that our own mechanisms are sufficient to keep resources alive whenever needed. In particular, we do not think that encoding on commands on finish (#8220) was sufficient to avoid the problem in #7816 when not retaining references.

See #8706 (comment) and #7854 (comment) for some additional background.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions