implementation of vkCmdFillBuffer and rework of logger

This commit is contained in:
2025-11-22 21:43:31 +01:00
parent 5df8677051
commit b586ff18e1
16 changed files with 325 additions and 82 deletions

View File

@@ -15,5 +15,20 @@ pub fn deinit(self: *Self) void {
pub fn dispatch(self: *Self, command: *const cmd.Command) void {
_ = self;
_ = command;
switch (command.*) {
.FillBuffer => |data| fillBuffer(&data),
else => {},
}
}
fn fillBuffer(data: *const cmd.CommandFillBuffer) void {
const memory = if (data.buffer.memory) |memory| memory else unreachable;
const raw_memory_map: [*]u32 = @ptrCast(@alignCast(memory.map(data.offset, data.size) catch unreachable));
var memory_map: []u32 = raw_memory_map[0..data.size];
for (0..@divExact(data.size, @sizeOf(u32))) |i| {
memory_map[i] = data.data;
}
memory.unmap();
}