device_model.vert 648 Bytes
Newer Older
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
1 2 3 4 5 6 7 8 9 10
/*
 * gulkan
 * Copyright 2018 Collabora Ltd.
 * Author: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
 * SPDX-License-Identifier: MIT
 */

#version 460
#extension GL_ARB_separate_shader_objects : enable

11
layout (binding = 0) uniform Transformation {
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  mat4 mvp;
} ubo;

layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 uv;

layout (location = 0) out vec3 out_normal;
layout (location = 1) out vec2 out_uv;

out gl_PerVertex {
  vec4 gl_Position;
};

void main() {
  gl_Position = ubo.mvp * vec4 (position, 1.0);
  gl_Position.y = -gl_Position.y;
  out_uv = uv;
  out_normal = normal;
}