Load textures

This commit is contained in:
Przemysław Gasiǹski 2024-08-05 17:54:40 +02:00
parent de68ccac0d
commit c0591ecb24
8 changed files with 462 additions and 56 deletions

View file

@ -11,6 +11,7 @@ const Model = @import("vulkan_renderer.zig").Model;
const Self = @This();
ubo_model: Model,
tex_id: u32,
vertex_count: u32,
vertex_buffer: vk.Buffer,
@ -34,6 +35,7 @@ pub fn new(
transfer_command_pool: vk.CommandPool,
vertices: []const Vertex,
indices: []const u32,
tex_id: u32,
allocator: std.mem.Allocator,
) !Self {
var self: Self = undefined;
@ -50,6 +52,7 @@ pub fn new(
try self.createIndexBuffer(transfer_queue, transfer_command_pool, indices);
self.ubo_model = .{ .model = zm.identity() };
self.tex_id = tex_id;
return self;
}
@ -122,7 +125,6 @@ fn createVertexBuffer(
staging_buffer,
self.vertex_buffer,
buffer_size,
self.allocator,
);
}
@ -178,6 +180,5 @@ fn createIndexBuffer(
staging_buffer,
self.index_buffer,
buffer_size,
self.allocator,
);
}