working on wsi
This commit is contained in:
@@ -20,13 +20,13 @@ pub fn NonDispatchable(comptime T: type) type {
|
||||
return self;
|
||||
}
|
||||
|
||||
pub inline fn intrusiveDestroy(self: *Self, allocator: std.mem.Allocator) void {
|
||||
pub fn intrusiveDestroy(self: *Self, allocator: std.mem.Allocator) void {
|
||||
self.object.destroy(allocator);
|
||||
allocator.destroy(self);
|
||||
std.log.debug("Destroyed non dispatchable handle of type '{s}' at 0x{X}", .{ @typeName(T), @intFromPtr(self) });
|
||||
}
|
||||
|
||||
pub inline fn destroy(self: *Self, allocator: std.mem.Allocator) void {
|
||||
pub fn destroy(self: *Self, allocator: std.mem.Allocator) void {
|
||||
allocator.destroy(self);
|
||||
std.log.debug("Destroyed non dispatchable handle of type '{s}' at 0x{X}", .{ @typeName(T), @intFromPtr(self) });
|
||||
}
|
||||
@@ -39,7 +39,11 @@ pub fn NonDispatchable(comptime T: type) type {
|
||||
return @enumFromInt(@intFromPtr(self));
|
||||
}
|
||||
|
||||
pub inline fn fromHandle(vk_handle: anytype) VkError!*Self {
|
||||
pub fn fromObject(object: *T) *Self {
|
||||
return @alignCast(@constCast(@fieldParentPtr("object", &object)));
|
||||
}
|
||||
|
||||
pub fn fromHandle(vk_handle: anytype) VkError!*Self {
|
||||
const handle = @intFromEnum(vk_handle);
|
||||
if (handle == 0) {
|
||||
return VkError.InvalidHandleDrv;
|
||||
|
||||
Reference in New Issue
Block a user