fixing compilation issue
This commit is contained in:
@@ -73,10 +73,11 @@ pub fn destroy(interface: *Interface, allocator: std.mem.Allocator) void {
|
||||
|
||||
pub fn execute(self: *Self, device: *ExecutionDevice) VkError!void {
|
||||
self.interface.submit() catch return;
|
||||
defer self.interface.finish() catch {};
|
||||
|
||||
for (self.commands.items) |command| {
|
||||
try command.vtable.execute(command.ptr, device);
|
||||
}
|
||||
try self.interface.finish();
|
||||
}
|
||||
|
||||
pub fn begin(interface: *Interface, _: *const vk.CommandBufferBeginInfo) VkError!void {
|
||||
@@ -282,7 +283,7 @@ pub fn copyImageToBuffer(interface: *Interface, src: *base.Image, src_layout: vk
|
||||
|
||||
pub fn execute(impl: *const Impl, _: *ExecutionDevice) VkError!void {
|
||||
for (impl.regions[0..]) |region| {
|
||||
try impl.dst.copyToBuffer(impl.dst, region);
|
||||
try impl.src.copyToBuffer(impl.dst, region);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -83,7 +83,7 @@ pub fn copyToBuffer(self: *const Self, dst: *SoftBuffer, region: vk.BufferImageC
|
||||
);
|
||||
}
|
||||
|
||||
pub fn copyFromBuffer(self: *const Self, src: *SoftBuffer, region: vk.BufferImageCopy) VkError!void {
|
||||
pub fn copyFromBuffer(self: *const Self, src: *const SoftBuffer, region: vk.BufferImageCopy) VkError!void {
|
||||
const src_size = src.interface.size - region.buffer_offset;
|
||||
const src_memory = if (src.interface.memory) |memory| memory else return VkError.InvalidDeviceMemoryDrv;
|
||||
const src_map: []u8 = @as([*]u8, @ptrCast(try src_memory.map(region.buffer_offset, src_size)))[0..src_size];
|
||||
@@ -99,7 +99,7 @@ pub fn copyFromBuffer(self: *const Self, src: *SoftBuffer, region: vk.BufferImag
|
||||
}
|
||||
|
||||
pub fn copy(
|
||||
self: *Self,
|
||||
self: *const Self,
|
||||
src_memory: ?[]const u8,
|
||||
dst_memory: ?[]u8,
|
||||
row_len: usize,
|
||||
|
||||
@@ -104,7 +104,12 @@ fn taskRunner(self: *Self, info: Interface.SubmitInfo, p_fence: ?*base.Fence, ru
|
||||
|
||||
for (info.command_buffers.items) |command_buffer| {
|
||||
const soft_command_buffer: *SoftCommandBuffer = @alignCast(@fieldParentPtr("interface", command_buffer));
|
||||
soft_command_buffer.execute(&execution_device) catch |err| base.errors.errorLoggerContext(err, "the software execution device");
|
||||
soft_command_buffer.execute(&execution_device) catch |err| {
|
||||
base.errors.errorLoggerContext(err, "the software execution device");
|
||||
if (@errorReturnTrace()) |trace| {
|
||||
std.debug.dumpStackTrace(trace.*);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (p_fence) |fence| {
|
||||
|
||||
@@ -114,6 +114,7 @@ pub inline fn submit(self: *Self) VkError!void {
|
||||
if (self.begin_info) |begin_info| {
|
||||
if (!begin_info.flags.simultaneous_use_bit) {
|
||||
self.transitionState(.Pending, &.{.Executable}) catch return VkError.ValidationFailed;
|
||||
return;
|
||||
}
|
||||
}
|
||||
self.transitionState(.Pending, &.{ .Pending, .Executable }) catch return VkError.ValidationFailed;
|
||||
@@ -123,6 +124,7 @@ pub inline fn finish(self: *Self) VkError!void {
|
||||
if (self.begin_info) |begin_info| {
|
||||
if (!begin_info.flags.one_time_submit_bit) {
|
||||
self.transitionState(.Invalid, &.{.Pending}) catch return VkError.ValidationFailed;
|
||||
return;
|
||||
}
|
||||
}
|
||||
self.transitionState(.Executable, &.{.Pending}) catch return VkError.ValidationFailed;
|
||||
|
||||
Reference in New Issue
Block a user