adding debug logs levels, implementing some physical device functions
This commit is contained in:
@@ -11,13 +11,16 @@ pub const ObjectType: vk.ObjectType = .physical_device;
|
||||
|
||||
props: vk.PhysicalDeviceProperties,
|
||||
mem_props: vk.PhysicalDeviceMemoryProperties,
|
||||
format_props: vk.FormatProperties,
|
||||
features: vk.PhysicalDeviceFeatures,
|
||||
queue_family_props: std.ArrayList(vk.QueueFamilyProperties),
|
||||
instance: *const Instance,
|
||||
dispatch_table: *const DispatchTable,
|
||||
|
||||
pub const DispatchTable = struct {
|
||||
createDevice: *const fn (*Self, std.mem.Allocator, *const vk.DeviceCreateInfo) VkError!*Device,
|
||||
getFormatProperties: *const fn (*Self, vk.Format) VkError!vk.FormatProperties,
|
||||
getImageFormatProperties: *const fn (*Self, vk.Format, vk.ImageType, vk.ImageTiling, vk.ImageUsageFlags, vk.ImageCreateFlags) VkError!vk.ImageFormatProperties,
|
||||
getSparseImageFormatProperties: *const fn (*Self, vk.Format, vk.ImageType, vk.SampleCountFlags, vk.ImageTiling, vk.ImageUsageFlags, vk.ImageCreateFlags) VkError!vk.SparseImageFormatProperties,
|
||||
release: *const fn (*Self, std.mem.Allocator) VkError!void,
|
||||
};
|
||||
|
||||
@@ -41,7 +44,7 @@ pub fn init(allocator: std.mem.Allocator, instance: *const Instance) VkError!Sel
|
||||
.memory_heap_count = 0,
|
||||
.memory_heaps = undefined,
|
||||
},
|
||||
.format_props = .{},
|
||||
.queue_family_props = .empty,
|
||||
.features = .{},
|
||||
.instance = instance,
|
||||
.dispatch_table = undefined,
|
||||
@@ -52,6 +55,33 @@ pub fn createDevice(self: *Self, allocator: std.mem.Allocator, infos: *const vk.
|
||||
return try self.dispatch_table.createDevice(self, allocator, infos);
|
||||
}
|
||||
|
||||
pub fn getFormatProperties(self: *Self, format: vk.Format) VkError!vk.FormatProperties {
|
||||
return try self.dispatch_table.getFormatProperties(self, format);
|
||||
}
|
||||
|
||||
pub fn getImageFormatProperties(
|
||||
self: *Self,
|
||||
format: vk.Format,
|
||||
image_type: vk.ImageType,
|
||||
tiling: vk.ImageTiling,
|
||||
usage: vk.ImageUsageFlags,
|
||||
flags: vk.ImageCreateFlags,
|
||||
) VkError!vk.ImageFormatProperties {
|
||||
return try self.dispatch_table.getImageFormatProperties(self, format, image_type, tiling, usage, flags);
|
||||
}
|
||||
|
||||
pub fn getSparseImageFormatProperties(
|
||||
self: *Self,
|
||||
format: vk.Format,
|
||||
image_type: vk.ImageType,
|
||||
samples: vk.SampleCountFlags,
|
||||
tiling: vk.ImageTiling,
|
||||
usage: vk.ImageUsageFlags,
|
||||
flags: vk.ImageCreateFlags,
|
||||
) VkError!vk.SparseImageFormatProperties {
|
||||
return try self.dispatch_table.getSparseImageFormatProperties(self, format, image_type, samples, tiling, usage, flags);
|
||||
}
|
||||
|
||||
pub fn releasePhysicalDevice(self: *Self, allocator: std.mem.Allocator) VkError!void {
|
||||
try self.dispatch_table.release(self, allocator);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user