#version 450
#extension GL_ARB_separate_shader_objects : enable

layout(binding = 0) uniform UniformBufferObject {
    mat4 model;
    mat4 view;
    mat4 proj;
} ubo;

layout(location = 0) in vec3 inPosition;
layout(location = 2) in vec3 inColour;
layout(location = 3) in vec2 inTexCoord;
layout(location = 4) in uint inTexIndex;
layout(location = 5) in vec3 extraColour;
layout(location = 6) in uint extraFlags;
layout(location = 7) in uint tileIndex;

layout(location = 0) out vec3 fragColour;
layout(location = 1) out vec2 fragTexCoord;
layout(location = 2) out uint fragTexIndex;
layout(location = 3) out vec3 fragExtraColour;
layout(location = 4) out uint fragExtraFlags;
layout(location = 5) out uint fragTileIndex;

out gl_PerVertex {
    vec4 gl_Position;
};

void main() {
    gl_Position = vec4(inPosition.x, inPosition.z, inPosition.y, 1);
    fragColour = inColour;
    fragTexCoord = inTexCoord;
    fragTexIndex = inTexIndex;
    fragExtraColour = extraColour;
    fragExtraFlags = extraFlags;
    fragTileIndex = tileIndex;
}