adding Descriptors fundamental implementation
This commit is contained in:
@@ -8,7 +8,7 @@ const Self = @This();
|
||||
pub const ObjectType: vk.ObjectType = .descriptor_set_layout;
|
||||
|
||||
owner: *Device,
|
||||
bindings: []const vk.DescriptorSetLayoutBinding,
|
||||
bindings: ?[]const vk.DescriptorSetLayoutBinding,
|
||||
|
||||
vtable: *const VTable,
|
||||
|
||||
@@ -17,9 +17,15 @@ pub const VTable = struct {
|
||||
};
|
||||
|
||||
pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.DescriptorSetLayoutCreateInfo) VkError!Self {
|
||||
const bindings = if (info.p_bindings) |bindings|
|
||||
allocator.dupe(vk.DescriptorSetLayoutBinding, bindings[0..info.binding_count]) catch return VkError.OutOfHostMemory
|
||||
else
|
||||
null;
|
||||
|
||||
return .{
|
||||
.owner = device,
|
||||
.bindings = allocator.dupe(info.bindings[0..info.binding_count]) catch return VkError.OutOfHostMemory,
|
||||
.bindings = bindings,
|
||||
.vtable = undefined,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user