#version 450

layout(location = 0) in vec3 iPos;

layout(set = 0, binding = 3) readonly buffer uChunkOffsets {
    vec2 offsets[];
};

layout(location = 0) out vec3 oPos;
layout(location = 1) out int oChunkID;

void main() {
    vec2 offset = offsets[gl_InstanceIndex];
    oChunkID = gl_InstanceIndex;

    oPos = iPos + vec3(offset.x, 0, offset.y);
    gl_Position = vec4(oPos, 1.0);
}
