fixing crashes
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
const std = @import("std");
|
||||
const vk = @import("vulkan");
|
||||
|
||||
const NonDispatchable = @import("NonDispatchable.zig");
|
||||
|
||||
const VkError = @import("error_set.zig").VkError;
|
||||
const NonDispatchable = @import("NonDispatchable.zig").NonDispatchable;
|
||||
|
||||
const Device = @import("Device.zig");
|
||||
const Buffer = @import("Buffer.zig");
|
||||
|
||||
const Self = @This();
|
||||
pub const ObjectType: vk.ObjectType = .buffer_view;
|
||||
|
||||
owner: *Device,
|
||||
buffer: *Buffer,
|
||||
format: vk.Format,
|
||||
offset: vk.DeviceSize,
|
||||
range: vk.DeviceSize,
|
||||
|
||||
vtable: *const VTable,
|
||||
|
||||
@@ -20,10 +24,13 @@ pub const VTable = struct {
|
||||
|
||||
pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.BufferViewCreateInfo) VkError!Self {
|
||||
_ = allocator;
|
||||
_ = info;
|
||||
return .{
|
||||
.owner = device,
|
||||
.buffer = try NonDispatchable(Buffer).fromHandleObject(info.buffer),
|
||||
.vtable = undefined,
|
||||
.format = info.format,
|
||||
.offset = info.offset,
|
||||
.range = info.range,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ const VkError = @import("error_set.zig").VkError;
|
||||
const NonDispatchable = @import("NonDispatchable.zig").NonDispatchable;
|
||||
|
||||
const Device = @import("Device.zig");
|
||||
|
||||
const DeviceMemory = @import("DeviceMemory.zig");
|
||||
const Image = @import("Image.zig");
|
||||
|
||||
const Self = @This();
|
||||
|
||||
@@ -64,7 +64,7 @@ pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.Rende
|
||||
else
|
||||
null,
|
||||
.depth_stencil_attachments = if (subpass_info.p_depth_stencil_attachment) |subpass_attachment|
|
||||
subpass_attachment.*
|
||||
if (subpass_attachment.attachment != vk.ATTACHMENT_UNUSED) subpass_attachment.* else null
|
||||
else
|
||||
null,
|
||||
.preserve_attachments = if (subpass_info.p_preserve_attachments) |subpass_attachments|
|
||||
|
||||
Reference in New Issue
Block a user