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 Vec1i extends Uniform {
private Supplier<Integer> intSupplier;
public Vec1i(Uniform.Info info) {
super(info);
}
protected void setupSupplier() {
if (this.info.intSupplier != null) {
this.intSupplier = this.info.intSupplier;
} else {
this.setSupplier(this.info.bufferSupplier);
}
}
public void setSupplier(Supplier<MappedBuffer> supplier) {
this.intSupplier = () -> ((MappedBuffer)supplier.get()).getInt(0);
}
void update(long ptr) {
int i = (Integer)this.intSupplier.get();
MemoryUtil.memPutInt(ptr + this.offset, i);
}
}
Download file