Added checking if our extensions are supported and make Renderer.destroy() not return an error

Signed-off-by: luccie-cmd <luccie@sideros.org>
This commit is contained in:
luccie-cmd 2025-03-16 23:02:01 +01:00 committed by Lorenzo Torres
parent fee8a08bdf
commit 48796a0fa3
4 changed files with 59 additions and 12 deletions

View file

@ -19,7 +19,7 @@ vertex_buffer: vk.Buffer,
index_buffer: vk.Buffer,
pub fn create(allocator: Allocator, w: window.Window) !Renderer {
const instance = try vk.Instance.create();
const instance = try vk.Instance.create(allocator);
const surface = try vk.Surface.create(instance, w);
@ -61,8 +61,8 @@ pub fn create(allocator: Allocator, w: window.Window) !Renderer {
};
}
pub fn destroy(self: Renderer) !void {
try self.device.waitIdle();
pub fn destroy(self: Renderer) void {
self.device.waitIdle();
self.index_buffer.destroy(self.device.handle);
self.vertex_buffer.destroy(self.device.handle);
self.graphics_pipeline.destroy(self.device);