Vulkan triangle!

Switched to Vulkan 1.1 GLSL dialect
Added vulkan test shader
Implemented test render thread function
This commit is contained in:
2021-08-12 23:29:45 -07:00
parent 1114210039
commit 09b9841c03
7 changed files with 87 additions and 5 deletions

View File

@@ -3,3 +3,5 @@ add_standard_asset(simple_blit.frag)
add_standard_asset(simple_blit.vert)
add_standard_asset(sprite.frag)
add_standard_asset(sprite.vert)
add_standard_asset(vulkan_test.vert)
add_standard_asset(vulkan_test.frag)

View File

@@ -0,0 +1,12 @@
#version 450
// Temporary test shader for vulkan bringup...
// See https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Shader_modules
layout(location = 0) in vec3 fragColor;
layout(location = 0) out vec4 outColor;
void main() {
outColor = vec4(fragColor, 1.0);
}

View File

@@ -0,0 +1,23 @@
#version 450
// Temporary test shader for vulkan bringup...
// See https://vulkan-tutorial.com/Drawing_a_triangle/Graphics_pipeline_basics/Shader_modules
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];
}