From 7376ecbb3f4aa200eeeb659b59af88c6ee1ba00e Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Mon, 8 Jun 2026 18:18:05 +0200 Subject: [PATCH] removing test --- build.zig.zon | 4 ++-- src/vulkan/Device.zig | 15 +-------------- src/vulkan/lib_vulkan.zig | 10 ---------- src/vulkan/utils.zig | 4 ++-- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 5a9449f..a22c7f1 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -26,8 +26,8 @@ .hash = "N-V-__8AAF9uOh0I4P_99za7N822J3JwsDaqONrFVrcEQo59", }, .SPIRV_Interpreter = .{ - .url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#9270d83464afc32c8ea3dd89931056421046df5b", - .hash = "SPIRV_Interpreter-0.0.1-ajmpn_V1BgDlmfIb9PHyP2cij9m63vE-Nx0o4mFsEd9L", + .url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#11be3ea41dd5b48d4547732c4ea156381def3802", + .hash = "SPIRV_Interpreter-0.0.1-ajmpnwN2BgC6Wg-dhBksmlzTkV6anEx_dFsZRmsXR7ZQ", .lazy = true, }, //.SPIRV_Interpreter = .{ diff --git a/src/vulkan/Device.zig b/src/vulkan/Device.zig index d43cdc4..6c5f042 100644 --- a/src/vulkan/Device.zig +++ b/src/vulkan/Device.zig @@ -41,7 +41,6 @@ instance: *Instance, physical_device: *const PhysicalDevice, queues: std.AutoArrayHashMapUnmanaged(u32, std.ArrayList(*Dispatchable(Queue))), host_allocator: VulkanAllocator, -khr_swapchain_enabled: bool, dispatch_table: *const DispatchTable, vtable: *const VTable, @@ -75,29 +74,17 @@ pub const DispatchTable = struct { destroy: *const fn (*Self, std.mem.Allocator) VkError!void, }; -pub fn init(allocator: std.mem.Allocator, instance: *Instance, physical_device: *const PhysicalDevice, info: *const vk.DeviceCreateInfo) VkError!Self { +pub fn init(allocator: std.mem.Allocator, instance: *Instance, physical_device: *const PhysicalDevice, _: *const vk.DeviceCreateInfo) VkError!Self { return .{ .instance = instance, .physical_device = physical_device, .queues = .empty, .host_allocator = VulkanAllocator.from(allocator).cloneWithScope(.object), - .khr_swapchain_enabled = isExtensionEnabled(info, vk.extensions.khr_swapchain.name), .dispatch_table = undefined, .vtable = undefined, }; } -fn isExtensionEnabled(info: *const vk.DeviceCreateInfo, extension_name: []const u8) bool { - if (info.enabled_extension_count == 0) return false; - const names = info.pp_enabled_extension_names orelse return false; - for (0..info.enabled_extension_count) |i| { - if (std.mem.eql(u8, std.mem.span(names[i]), extension_name)) { - return true; - } - } - return false; -} - pub fn createQueues(self: *Self, allocator: std.mem.Allocator, info: *const vk.DeviceCreateInfo) VkError!void { if (info.queue_create_info_count == 0) { return; diff --git a/src/vulkan/lib_vulkan.zig b/src/vulkan/lib_vulkan.zig index 8bcbfce..1dc539c 100644 --- a/src/vulkan/lib_vulkan.zig +++ b/src/vulkan/lib_vulkan.zig @@ -64,14 +64,6 @@ inline fn notImplementedWarning() void { logger.fixme("function not yet implemented", .{}); } -fn isSwapchainDeviceFunction(name: []const u8) bool { - return std.mem.eql(u8, name, "vkAcquireNextImageKHR") or - std.mem.eql(u8, name, "vkCreateSwapchainKHR") or - std.mem.eql(u8, name, "vkDestroySwapchainKHR") or - std.mem.eql(u8, name, "vkGetSwapchainImagesKHR") or - std.mem.eql(u8, name, "vkQueuePresentKHR"); -} - fn wrapNonDispatchable(comptime T: type, allocator: std.mem.Allocator, object: *T, comptime VkT: type) VkError!VkT { const handle = NonDispatchable(T).wrap(allocator, object) catch |err| { object.destroy(allocator); @@ -1427,8 +1419,6 @@ pub export fn apeGetDeviceProcAddr(p_device: vk.Device, p_name: ?[*:0]const u8) const name = std.mem.span(p_name.?); if (p_device == .null_handle) return null; - const device = Dispatchable(Device).fromHandleObject(p_device) catch return null; - if (isSwapchainDeviceFunction(name) and !device.khr_swapchain_enabled) return null; if (device_pfn_map.get(name)) |pfn| return pfn; return null; diff --git a/src/vulkan/utils.zig b/src/vulkan/utils.zig index 1f51ad7..2d925a8 100644 --- a/src/vulkan/utils.zig +++ b/src/vulkan/utils.zig @@ -7,11 +7,11 @@ pub fn boundedName(name: [*:0]const u8, max_len: usize) ?[]const u8 { return bytes[0..len]; } -pub fn propertyName(comptime max_len: usize, name: *const [max_len]u8) []const u8 { +pub inline fn propertyName(comptime max_len: usize, name: *const [max_len]u8) []const u8 { return std.mem.sliceTo(name[0..], 0); } -pub fn extensionName(name: *const [vk.MAX_EXTENSION_NAME_SIZE]u8) []const u8 { +pub inline fn extensionName(name: *const [vk.MAX_EXTENSION_NAME_SIZE]u8) []const u8 { return propertyName(vk.MAX_EXTENSION_NAME_SIZE, name); }