Demo application that renders a triangle using Vulkan on the Pixel 3A.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

triangle.vert 420B

123456789101112131415161718192021
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. layout(location = 0) out vec3 fragColor;
  4. vec2 positions[3] = vec2[](
  5. vec2(0.0, -0.5),
  6. vec2(0.5, 0.5),
  7. vec2(-0.5, 0.5)
  8. );
  9. vec3 colors[3] = vec3[](
  10. vec3(1.0, 0.0, 0.0),
  11. vec3(0.0, 1.0, 0.0),
  12. vec3(0.0, 0.0, 1.0)
  13. );
  14. void main() {
  15. gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
  16. fragColor = colors[gl_VertexIndex];
  17. }