removing test
This commit is contained in:
+2
-2
@@ -26,8 +26,8 @@
|
|||||||
.hash = "N-V-__8AAF9uOh0I4P_99za7N822J3JwsDaqONrFVrcEQo59",
|
.hash = "N-V-__8AAF9uOh0I4P_99za7N822J3JwsDaqONrFVrcEQo59",
|
||||||
},
|
},
|
||||||
.SPIRV_Interpreter = .{
|
.SPIRV_Interpreter = .{
|
||||||
.url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#9270d83464afc32c8ea3dd89931056421046df5b",
|
.url = "git+https://git.kbz8.me/kbz_8/SPIRV-Interpreter#11be3ea41dd5b48d4547732c4ea156381def3802",
|
||||||
.hash = "SPIRV_Interpreter-0.0.1-ajmpn_V1BgDlmfIb9PHyP2cij9m63vE-Nx0o4mFsEd9L",
|
.hash = "SPIRV_Interpreter-0.0.1-ajmpnwN2BgC6Wg-dhBksmlzTkV6anEx_dFsZRmsXR7ZQ",
|
||||||
.lazy = true,
|
.lazy = true,
|
||||||
},
|
},
|
||||||
//.SPIRV_Interpreter = .{
|
//.SPIRV_Interpreter = .{
|
||||||
|
|||||||
+1
-14
@@ -41,7 +41,6 @@ instance: *Instance,
|
|||||||
physical_device: *const PhysicalDevice,
|
physical_device: *const PhysicalDevice,
|
||||||
queues: std.AutoArrayHashMapUnmanaged(u32, std.ArrayList(*Dispatchable(Queue))),
|
queues: std.AutoArrayHashMapUnmanaged(u32, std.ArrayList(*Dispatchable(Queue))),
|
||||||
host_allocator: VulkanAllocator,
|
host_allocator: VulkanAllocator,
|
||||||
khr_swapchain_enabled: bool,
|
|
||||||
|
|
||||||
dispatch_table: *const DispatchTable,
|
dispatch_table: *const DispatchTable,
|
||||||
vtable: *const VTable,
|
vtable: *const VTable,
|
||||||
@@ -75,29 +74,17 @@ pub const DispatchTable = struct {
|
|||||||
destroy: *const fn (*Self, std.mem.Allocator) VkError!void,
|
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 .{
|
return .{
|
||||||
.instance = instance,
|
.instance = instance,
|
||||||
.physical_device = physical_device,
|
.physical_device = physical_device,
|
||||||
.queues = .empty,
|
.queues = .empty,
|
||||||
.host_allocator = VulkanAllocator.from(allocator).cloneWithScope(.object),
|
.host_allocator = VulkanAllocator.from(allocator).cloneWithScope(.object),
|
||||||
.khr_swapchain_enabled = isExtensionEnabled(info, vk.extensions.khr_swapchain.name),
|
|
||||||
.dispatch_table = undefined,
|
.dispatch_table = undefined,
|
||||||
.vtable = 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 {
|
pub fn createQueues(self: *Self, allocator: std.mem.Allocator, info: *const vk.DeviceCreateInfo) VkError!void {
|
||||||
if (info.queue_create_info_count == 0) {
|
if (info.queue_create_info_count == 0) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -64,14 +64,6 @@ inline fn notImplementedWarning() void {
|
|||||||
logger.fixme("function not yet implemented", .{});
|
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 {
|
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| {
|
const handle = NonDispatchable(T).wrap(allocator, object) catch |err| {
|
||||||
object.destroy(allocator);
|
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.?);
|
const name = std.mem.span(p_name.?);
|
||||||
|
|
||||||
if (p_device == .null_handle) return null;
|
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;
|
if (device_pfn_map.get(name)) |pfn| return pfn;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ pub fn boundedName(name: [*:0]const u8, max_len: usize) ?[]const u8 {
|
|||||||
return bytes[0..len];
|
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);
|
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);
|
return propertyName(vk.MAX_EXTENSION_NAME_SIZE, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user