Examples: Vulkan: Added shader sources/references in the .cpp source.
diff --git a/examples/example_glfw_vulkan/glsl_shader.frag b/examples/example_glfw_vulkan/glsl_shader.frag
index 313a888..ce7e6f7 100644
--- a/examples/example_glfw_vulkan/glsl_shader.frag
+++ b/examples/example_glfw_vulkan/glsl_shader.frag
@@ -3,7 +3,7 @@
layout(set=0, binding=0) uniform sampler2D sTexture;
-layout(location = 0) in struct{
+layout(location = 0) in struct {
vec4 Color;
vec2 UV;
} In;
diff --git a/examples/example_glfw_vulkan/glsl_shader.vert b/examples/example_glfw_vulkan/glsl_shader.vert
index 20b2908..9425365 100644
--- a/examples/example_glfw_vulkan/glsl_shader.vert
+++ b/examples/example_glfw_vulkan/glsl_shader.vert
@@ -3,16 +3,16 @@
layout(location = 1) in vec2 aUV;
layout(location = 2) in vec4 aColor;
-layout(push_constant) uniform uPushConstant{
+layout(push_constant) uniform uPushConstant {
vec2 uScale;
vec2 uTranslate;
} pc;
-out gl_PerVertex{
+out gl_PerVertex {
vec4 gl_Position;
};
-layout(location = 0) out struct{
+layout(location = 0) out struct {
vec4 Color;
vec2 UV;
} Out;
@@ -21,5 +21,5 @@
{
Out.Color = aColor;
Out.UV = aUV;
- gl_Position = vec4(aPos*pc.uScale+pc.uTranslate, 0, 1);
+ gl_Position = vec4(aPos * pc.uScale + pc.uTranslate, 0, 1);
}
diff --git a/examples/imgui_impl_vulkan.cpp b/examples/imgui_impl_vulkan.cpp
index 3aafb55..962ce84 100644
--- a/examples/imgui_impl_vulkan.cpp
+++ b/examples/imgui_impl_vulkan.cpp
@@ -76,6 +76,23 @@
// glsl_shader.vert, compiled with:
// # glslangValidator -V -x -o glsl_shader.vert.u32 glsl_shader.vert
+/*
+#version 450 core
+layout(location = 0) in vec2 aPos;
+layout(location = 1) in vec2 aUV;
+layout(location = 2) in vec4 aColor;
+layout(push_constant) uniform uPushConstant { vec2 uScale; vec2 uTranslate; } pc;
+
+out gl_PerVertex { vec4 gl_Position; };
+layout(location = 0) out struct { vec4 Color; vec2 UV; } Out;
+
+void main()
+{
+ Out.Color = aColor;
+ Out.UV = aUV;
+ gl_Position = vec4(aPos * pc.uScale + pc.uTranslate, 0, 1);
+}
+*/
static uint32_t __glsl_shader_vert_spv[] =
{
0x07230203,0x00010000,0x00080001,0x0000002e,0x00000000,0x00020011,0x00000001,0x0006000b,
@@ -123,6 +140,16 @@
// glsl_shader.frag, compiled with:
// # glslangValidator -V -x -o glsl_shader.frag.u32 glsl_shader.frag
+/*
+#version 450 core
+layout(location = 0) out vec4 fColor;
+layout(set=0, binding=0) uniform sampler2D sTexture;
+layout(location = 0) in struct { vec4 Color; vec2 UV; } In;
+void main()
+{
+ fColor = In.Color * texture(sTexture, In.UV.st);
+}
+*/
static uint32_t __glsl_shader_frag_spv[] =
{
0x07230203,0x00010000,0x00080001,0x0000001e,0x00000000,0x00020011,0x00000001,0x0006000b,