Preallocate texture VRAM, move files around

This commit is contained in:
2026-05-22 23:38:16 +02:00
parent fd311b97e7
commit c971443b02
12 changed files with 237 additions and 85 deletions

View File

@@ -12,19 +12,19 @@ const vm = @import("vecmath");
const worldgen = @import("worldgen.zig");
const Blocks = @import("assets/Blocks.zig");
const Chunk = @import("assets/Chunk.zig");
const Chunk = @import("Chunk.zig");
const Chunks = @import("Chunks.zig");
const CommandBuffer = @import("engine/CommandBuffer.zig");
const Engine = @import("engine/Engine.zig");
const Gui = @import("Gui.zig");
const Iterator2 = math.Iterator2;
const Materials = @import("assets/Materials.zig");
const Materials = @import("engine/Materials.zig");
const Player = @import("Player.zig");
const Skybox = @import("engine/Skybox.zig");
const StagingBuffer = @import("engine/StagingBuffer.zig");
const Swapchain = @import("engine/Swapchain.zig");
const Texture = @import("engine/Texture.zig");
const Textures = @import("assets/Textures.zig");
const Textures = @import("engine/Textures.zig");
global_descriptor_set_layout: vk.DescriptorSetLayout,
per_batch_descriptor_set_layout: vk.DescriptorSetLayout,
@@ -989,24 +989,24 @@ fn render(self: *Game) !void {
});
command_buffer.setViewport(0, .{
.x = 0,
.y = 0,
.width = @floatFromInt(extent.width),
.height = @floatFromInt(extent.height),
.min_depth = 0,
.max_depth = 1,
.x = 0,
.y = 0,
.width = @floatFromInt(extent.width),
.height = @floatFromInt(extent.height),
.min_depth = 0,
.max_depth = 1,
});
command_buffer.setScissor(0, .{
.offset = .{ .x = 0, .y = 0 },
.extent = extent,
.offset = .{ .x = 0, .y = 0 },
.extent = extent,
});
// --- RENDER 3D SCENE ---
command_buffer.bindPipeline(.graphics, self.pipeline);
try command_buffer.bindVertexBuffer(0, .{
.buffer = self.vertex_buffer.buffer,
.offset = 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);