[Fint] adding basic copy and blit commands
Test / build_and_test (push) Successful in 4m56s
Build / build (push) Successful in 7m20s

This commit is contained in:
2026-07-11 19:09:03 +02:00
parent d3cd6b18c8
commit 348e8ac66e
10 changed files with 497 additions and 156 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ pub inline fn destroy(self: *Self, allocator: std.mem.Allocator) void {
pub fn bindMemory(self: *Self, memory: *DeviceMemory, offset: vk.DeviceSize) VkError!void {
const image_size = try self.getTotalSize();
if (offset + image_size > memory.size or !self.allowed_memory_types.isSet(memory.memory_type_index)) {
if (offset > memory.size or image_size > memory.size - offset or !self.allowed_memory_types.isSet(memory.memory_type_index)) {
return VkError.ValidationFailed;
}
self.memory = memory;
@@ -72,7 +72,7 @@ pub fn bindMemory(self: *Self, memory: *DeviceMemory, offset: vk.DeviceSize) VkE
pub fn getMemoryRequirements(self: *Self, requirements: *vk.MemoryRequirements) VkError!void {
requirements.size = try self.getTotalSize();
requirements.memory_type_bits = 1;
requirements.memory_type_bits = self.allowed_memory_types.mask;
try self.vtable.getMemoryRequirements(self, requirements);
}
+1 -1
View File
@@ -30,7 +30,7 @@ pub fn init(device: *Device, allocator: std.mem.Allocator, info: *const vk.Image
const memory = try device.allocateMemory(allocator, &.{
.allocation_size = requirements.size,
.memory_type_index = requirements.memory_type_bits,
.memory_type_index = @ctz(requirements.memory_type_bits),
});
errdefer memory.destroy(allocator);