Open
Description
Looking at MTLInstanceAccelerationStructureDescriptor, I see setInstanceCount
being safe but setInstanceDescriptorType
being unsafe
. That doesn't make sense.
Metadata
Metadata
Assignees
Projects
Relationships
Development
No branches or pull requests
Activity
madsmtm commentedon Dec 22, 2024
Yeah, the simple reason is that
setInstanceCount
is explicitly marked as safe, whilesetInstanceDescriptorType
just... Isn't (yet, PRs adding it welcome).The issue is fundamental, it's unsound for us to mark something as safe without a human in the loop (this is FFI to a C-like language, and C can do anything, regardless of the signature of the function).
That said, Objective-C is more constrained, and usually doesn't do crazy things, so I do have a few thoughts and ideas for automatically marking certain things as safe in certain cases - just haven't gone down that route yet, my priorities have been on making the bindings correct before making them convenient ;)
kvark commentedon Dec 23, 2024
Got it, yeah. It's unfortunate if we have to go and inspect every method for safety. Compromises the idea of auto-generated bindings to start with.
Please feel free to close if this is already tracked.
madsmtm commentedon Dec 23, 2024
I thought I'd written it down somewhere, but no, the ideas for doing some of it automatically have only existed in my head... So I'll keep this issue open, and track it here.
objc2-metal
gfx-rs/wgpu#5641objc2-metal
instead ofmetal
gfx-rs/metal-rs#339