improving architecture, adding logical device creation and destruction
This commit is contained in:
@@ -1,15 +1,28 @@
|
||||
const std = @import("std");
|
||||
const vk = @import("vulkan");
|
||||
const base = @import("base");
|
||||
|
||||
const VkError = @import("error_set.zig").VkError;
|
||||
const PhysicalDevice = @import("PhysicalDevice.zig");
|
||||
|
||||
const Self = @This();
|
||||
pub const ObjectType: vk.ObjectType = .device;
|
||||
|
||||
physical_device: *const PhysicalDevice,
|
||||
dispatch_table: DispatchTable,
|
||||
driver_data: ?*anyopaque,
|
||||
dispatch_table: *const DispatchTable,
|
||||
|
||||
pub const DispatchTable = struct {};
|
||||
pub const DispatchTable = struct {
|
||||
destroy: *const fn (*Self, std.mem.Allocator) VkError!void,
|
||||
};
|
||||
|
||||
pub fn createImplDevice(physical_device: *base.PhysicalDevice, infos: vk.DeviceCreateInfo, allocator: std.mem.Allocator) !*anyopaque {
|
||||
pub fn init(allocator: std.mem.Allocator, physical_device: *const PhysicalDevice, infos: *const vk.DeviceCreateInfo) VkError!Self {
|
||||
_ = allocator;
|
||||
_ = infos;
|
||||
return .{
|
||||
.physical_device = physical_device,
|
||||
.dispatch_table = undefined,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn destroy(self: *Self, allocator: std.mem.Allocator) VkError!void {
|
||||
try self.dispatch_table.destroy(self, allocator);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user