Skip to content

[Impeller] TextureMTL::SetContents is unsynchronized and unsafe for updating existing texture. #144498

@jonahwilliams

Description

@jonahwilliams

See https://developer.apple.com/documentation/metal/mtltexture/1515679-replaceregion

This method runs on the CPU and immediately copies the pixel data into the texture. It doesn’t synchronize against any GPU accesses to the texture. Ensure all operations that write or render to the texture complete before reading the texture’s contents, using one of the following methods:

Instead if we need to synchronize we can use a blit pass: https://developer.apple.com/documentation/metal/mtlblitcommandencoder/1400752-copyfrombuffer?language=objc

We could keep using setContents to populate the initial texture data, but any subsequent updates will need to use a blitpass to be safe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requeststeam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions