finally a name
This commit is contained in:
@@ -12,13 +12,8 @@ pub const Interface = base.Instance;
|
||||
|
||||
interface: Interface,
|
||||
|
||||
export fn __vkImplCreateInstance(allocator: *const std.mem.Allocator, infos: *const vk.InstanceCreateInfo) ?*Interface {
|
||||
return realVkImplInstanceInit(allocator.*, infos) catch return null;
|
||||
}
|
||||
|
||||
// Pure Zig implementation to leverage `errdefer` and avoid memory leaks or complex resources handling
|
||||
fn realVkImplInstanceInit(allocator: std.mem.Allocator, infos: *const vk.InstanceCreateInfo) !?*Interface {
|
||||
const self = try allocator.create(Self);
|
||||
pub fn create(allocator: std.mem.Allocator, infos: *const vk.InstanceCreateInfo) VkError!*Interface {
|
||||
const self = allocator.create(Self) catch return VkError.OutOfHostMemory;
|
||||
errdefer allocator.destroy(self);
|
||||
|
||||
self.interface = try base.Instance.init(allocator, infos);
|
||||
|
||||
@@ -2,8 +2,8 @@ const std = @import("std");
|
||||
const vk = @import("vulkan");
|
||||
const base = @import("base");
|
||||
|
||||
pub const Instance = @import("Instance.zig");
|
||||
const Device = @import("Device.zig");
|
||||
const Instance = @import("Instance.zig");
|
||||
const PhysicalDevice = @import("PhysicalDevice.zig");
|
||||
|
||||
pub const DRIVER_LOGS_ENV_NAME = base.DRIVER_LOGS_ENV_NAME;
|
||||
@@ -17,5 +17,4 @@ pub const std_options = base.std_options;
|
||||
|
||||
comptime {
|
||||
_ = base;
|
||||
_ = Instance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user