dont compile chunk age declarations if theyre unused #26

Merged
embeddedt merged 1 commits from rdh/celeritas:stonecutter into stonecutter 2026-07-16 21:40:14 -04:00
Collaborator

removes a linking warning Output of vertex shader 'v_ChunkAgeMs' not read by fragment shader, and also avoids a bunch of MemoryStack.callocFloat allocations from this:

@Override
public void setSectionAges(long timestamp, long[] loadTimes) {
var uniform = this.uniformChunkAges;
if (uniform != null) {
try (MemoryStack stack = LWJGL.stackPush()) {
FloatBuffer buf = stack.callocFloat(loadTimes.length);
long ptr = LWJGL.memAddress(buf);
for (long loadTime : loadTimes) {
LWJGL.memPutFloat(ptr, (float) Math.min(MAX_CHUNK_AGE, (timestamp - loadTime) / (1000000L)));
ptr += 4;
}
uniform.set(buf);
}
}
}

removes a linking warning `Output of vertex shader 'v_ChunkAgeMs' not read by fragment shader`, and also avoids a bunch of `MemoryStack.callocFloat` allocations from this: https://git.taumc.org/embeddedt/celeritas/src/commit/fadd0c40fadd7d3d26278d5ab4b377a7c5cc7256/common/src/main/java/org/embeddedt/embeddium/impl/render/chunk/shader/DefaultChunkShaderInterface.java#L94-L109
rdh added 1 commit 2026-07-15 07:59:34 -04:00
embeddedt merged commit 0203a1fe96 into stonecutter 2026-07-16 21:40:14 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: embeddedt/celeritas#26