VulkanShader_1.21.10-0.0.4-alpha.jar
Download file
package net.vulkanmod.vulkan.shader.layout;
import java.util.function.Supplier;
import net.vulkanmod.vulkan.util.MappedBuffer;
import org.lwjgl.system.MemoryUtil;
public class Vec1f extends Uniform {
private Supplier<Float> floatSupplier;
public Vec1f(Uniform.Info info) {
super(info);
}
protected void setupSupplier() {
if (this.info.floatSupplier != null) {
this.floatSupplier = this.info.floatSupplier;
} else {
this.setSupplier(this.info.bufferSupplier);
}
}
public void setSupplier(Supplier<MappedBuffer> supplier) {
this.floatSupplier = () -> ((MappedBuffer)supplier.get()).getFloat(0);
}
void update(long ptr) {
float f = (Float)this.floatSupplier.get();
MemoryUtil.memPutFloat(ptr + this.offset, f);
}
}
Download file