Minor refactors
This commit is contained in:
14
src/Game.zig
14
src/Game.zig
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user