working on device

This commit is contained in:
2025-11-03 17:38:31 +01:00
parent c2f1ebc033
commit 4e9fdac9b7
7 changed files with 88 additions and 11 deletions

View File

@@ -20,6 +20,20 @@ pub fn init(instance: *const base.Instance, allocator: std.mem.Allocator) !*disp
base_physical_device.props.device_id = root.DEVICE_ID;
base_physical_device.props.device_type = .cpu;
base_physical_device.mem_props.memory_type_count = 1;
base_physical_device.mem_props.memory_types[0] = .{
.heap_index = 0,
.property_flags = .{
.host_visible_bit = true,
.host_coherent_bit = true,
},
};
base_physical_device.mem_props.memory_heap_count = 1;
base_physical_device.mem_props.memory_heaps[0] = .{
.size = std.process.totalSystemMemory() catch 0,
.flags = .{}, // Host memory
};
const info = try cpuinfo.get(allocator);
defer info.deinit(allocator);

View File

@@ -3,6 +3,7 @@ const vk = @import("vulkan");
const base = @import("base");
const Instance = @import("Instance.zig");
const PhysicalDevice = @import("PhysicalDevice.zig");
pub const VULKAN_VERSION = vk.makeApiVersion(0, 1, 0, 0);
pub const DRIVER_VERSION = vk.makeApiVersion(0, 0, 0, 1);
@@ -11,4 +12,5 @@ pub const DEVICE_ID = 0x600DCAFE;
comptime {
_ = base;
_ = Instance;
_ = PhysicalDevice;
}