MrcSnm / D-Metal-Binding

Bindings for the D language to Apple's Metal Graphics API
Boost Software License 1.0
6 stars 2 forks source link

A lot of the MTL API is missing alloc/init/release declarations. #8

Open LunaTheFoxgirl opened 8 months ago

LunaTheFoxgirl commented 8 months ago

A large part of the API has no way to release references to the classes created, this in my testing can result in some memory leaks. A lower class than Object should probably be added, which provides just an interface to retain, release, autorelease and retainCount

MrcSnm commented 8 months ago

https://github.com/MrcSnm/D-objective-c/blob/main/source/objc/runtime.d#L72

They are actually implemented. NSObject has those functions and as you can see, all of them are extending this class.

LunaTheFoxgirl commented 8 months ago

MTLRenderPassDescriptor does not, for example. https://github.com/MrcSnm/D-Metal-Binding/blob/main/source/metal/metal.d#L527-L530

or MTLDrawable https://github.com/MrcSnm/D-Metal-Binding/blob/main/source/metal/metal.d#L973-L978

MrcSnm commented 8 months ago

MTLRenderPassDescriptor does not, for example. https://github.com/MrcSnm/D-Metal-Binding/blob/main/source/metal/metal.d#L527-L530

or MTLDrawable https://github.com/MrcSnm/D-Metal-Binding/blob/main/source/metal/metal.d#L973-L978

On the interface, they do not actually contain the methods of the objective-c NSObject. But you can always cast your object to this class since everything extends from NSObject. But yeah on the descriptors that should be fixed