Skip to content
Snippets Groups Projects
  • Jeremy Whiting's avatar
    fae5ff63
    Add check-vulkan to draw a triangle using vulkan api. · fae5ff63
    Jeremy Whiting authored
    %multiarch%-check-vulkan uses vulkan to draw a simple triangle
    in a 200x200 window (next commit will not draw the window)
    and reports any issues found.
    Exit code is 0 on success.
    shader.frag and shader.vert are shader source files compiled
    into shaders/frag.spv and shaders/vert.spv respectively by using
    glslc such as:
    glslc shader.frag -o shaders/frag.spv
    glslc shader.vert -o shaders/vert.spv
    Binary shaders included in commit because glslc hasn't been
    packaged for scout runtime yet.
    Also add libvulkan-dev and libxcb1-dev to ci dependencies.
    fae5ff63
    History
    Add check-vulkan to draw a triangle using vulkan api.
    Jeremy Whiting authored
    %multiarch%-check-vulkan uses vulkan to draw a simple triangle
    in a 200x200 window (next commit will not draw the window)
    and reports any issues found.
    Exit code is 0 on success.
    shader.frag and shader.vert are shader source files compiled
    into shaders/frag.spv and shaders/vert.spv respectively by using
    glslc such as:
    glslc shader.frag -o shaders/frag.spv
    glslc shader.vert -o shaders/vert.spv
    Binary shaders included in commit because glslc hasn't been
    packaged for scout runtime yet.
    Also add libvulkan-dev and libxcb1-dev to ci dependencies.
shader.vert 421 B
#version 450
#extension GL_ARB_separate_shader_objects : enable

layout(location = 0) out vec3 fragColor;

vec2 positions[3] = vec2[](
    vec2(0.0, -0.5),
    vec2(0.5, 0.5),
    vec2(-0.5, 0.5)
);

vec3 colors[3] = vec3[](
    vec3(1.0, 0.0, 0.0),
    vec3(0.0, 1.0, 0.0),
    vec3(0.0, 0.0, 1.0)
);

void main() {
    gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
    fragColor = colors[gl_VertexIndex];
}