Minor refactors

This commit is contained in:
2026-05-22 23:34:25 +02:00
parent ad80fb4fd9
commit fd311b97e7
6 changed files with 145 additions and 118 deletions

View File

@@ -899,7 +899,7 @@ fn render(self: *Game) !void {
try command_buffer.beginCommandBuffer();
{
const swapchain_image = &swapchain.swapchain_images[swapchain.image_index.?];
const swapchain_image = swapchain.getCurrentSwapchainImage();
command_buffer.pipelineBarrier(.{
.src_stage_mask = .{ .color_attachment_output_bit = true },
@@ -988,31 +988,25 @@ fn render(self: *Game) !void {
},
});
command_buffer.setViewport(0, &.{
.{
command_buffer.setViewport(0, .{
.x = 0,
.y = 0,
.width = @floatFromInt(extent.width),
.height = @floatFromInt(extent.height),
.min_depth = 0,
.max_depth = 1,
},
});
command_buffer.setScissor(0, &.{
.{
command_buffer.setScissor(0, .{
.offset = .{ .x = 0, .y = 0 },
.extent = extent,
},
});
// --- RENDER 3D SCENE ---
command_buffer.bindPipeline(.graphics, self.pipeline);
try command_buffer.bindVertexBuffers(0, &.{
.{
try command_buffer.bindVertexBuffer(0, .{
.buffer = self.vertex_buffer.buffer,
.offset = 0,
},
});
command_buffer.bindIndexBuffer(self.index_buffer.buffer, 0, .uint16);
command_buffer.bindDescriptorSet(.graphics, self.pipeline_layout, 0, self.global_descriptor_set, null);