Don't schedule draw calls when there are no chunks to draw.

should fix #1614
This commit is contained in:
IntegratedQuantum 2025-06-08 11:53:26 +02:00
parent 9f0289551d
commit a8767938f0

View File

@ -234,6 +234,7 @@ pub fn drawChunksIndirect(chunkIds: *const [main.settings.highestSupportedLod +
}
fn drawChunksOfLod(chunkIDs: []const u32, projMatrix: Mat4f, ambient: Vec3f, playerPos: Vec3d, transparent: bool) void {
if(chunkIDs.len == 0) return;
const drawCallsEstimate: u31 = @intCast(if(transparent) chunkIDs.len else chunkIDs.len*8);
var chunkIDAllocation: main.graphics.SubAllocation = .{.start = 0, .len = 0};
chunkIDBuffer.uploadData(chunkIDs, &chunkIDAllocation);