metal: do not use setPurgeableState on MTLTexture/Buffer

The Metal system automatically will free hardware resources when no
other references exist (I believe) and this causes a crash if you close
a window while a render is in-flight.
This commit is contained in:
Mitchell Hashimoto
2023-03-05 10:00:05 -08:00
parent 03f5addd34
commit b1a7baf394

View File

@ -1365,7 +1365,6 @@ fn initAtlasTexture(device: objc.Object, atlas: *const font.Atlas) !objc.Object
/// Deinitialize a metal resource (buffer, texture, etc.) and free the
/// memory associated with it.
fn deinitMTLResource(obj: objc.Object) void {
obj.msgSend(void, objc.sel("setPurgeableState:"), .{@enumToInt(MTLPurgeableState.empty)});
obj.msgSend(void, objc.sel("release"), .{});
}