mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 03:06:55 -04:00
Don't schedule draw calls when there are no chunks to draw.
should fix #1614
This commit is contained in:
parent
9f0289551d
commit
a8767938f0
@ -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 {
|
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);
|
const drawCallsEstimate: u31 = @intCast(if(transparent) chunkIDs.len else chunkIDs.len*8);
|
||||||
var chunkIDAllocation: main.graphics.SubAllocation = .{.start = 0, .len = 0};
|
var chunkIDAllocation: main.graphics.SubAllocation = .{.start = 0, .len = 0};
|
||||||
chunkIDBuffer.uploadData(chunkIDs, &chunkIDAllocation);
|
chunkIDBuffer.uploadData(chunkIDs, &chunkIDAllocation);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user