Skip to content

newLibraryWithData_error but without requiring dispatch2 #819

@jimblandy

Description

@jimblandy

In gfx-rs/wgpu#8886 we ran into a situation where we had to introduce a dependency on dispatch2 solely because we wanted to use MTLDevice::newLibraryWithData_error, which takes a DispatchData argument. Since DispatchData is just a block of bytes, this seemed a bit silly; a more Rustic API would just take &[u8].

Would it make sense to offer an additional Rust function in MTLDevice that accepted the library data as a &[u8] and passed it through to the Objective C MTLDevice.newLibraryWithData:error: method somehow, without requiring the dispatch2 feature to be enabled, and without adding dispatch2 to the crate's dependencies?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-dispatch2Affects the `dispatch2` crateA-frameworkAffects the framework crates and the translator for themquestionThere is no such thing as a dumb one!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions