Vulkan-Hpp
shaders.hpp File Reference
#include <string>
#include <vector>
#include <vulkan/vulkan.hpp>

Go to the source code of this file.

Namespaces

 vk
 
 vk::su
 

Functions

vk::ShaderModule vk::su::createShaderModule (vk::Device const &device, vk::ShaderStageFlagBits shaderStage, std::string const &shaderText)
 
bool vk::su::GLSLtoSPV (const vk::ShaderStageFlagBits shaderType, std::string const &glslShader, std::vector< unsigned int > &spvShader)
 

Variables

const std::string vertexShaderText_PC_C
 
const std::string vertexShaderText_PT_T
 
const std::string fragmentShaderText_C_C
 
const std::string fragmentShaderText_T_C
 

Variable Documentation

◆ fragmentShaderText_C_C

const std::string fragmentShaderText_C_C
Initial value:
= R"(
#version 400
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout (location = 0) in vec4 color;
layout (location = 0) out vec4 outColor;
void main()
{
outColor = color;
}
)"

Definition at line 79 of file shaders.hpp.

◆ fragmentShaderText_T_C

const std::string fragmentShaderText_T_C
Initial value:
= R"(
#version 400
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout (binding = 1) uniform sampler2D tex;
layout (location = 0) in vec2 inTexCoord;
layout (location = 0) out vec4 outColor;
void main()
{
outColor = texture(tex, inTexCoord);
}
)"

Definition at line 96 of file shaders.hpp.

◆ vertexShaderText_PC_C

const std::string vertexShaderText_PC_C
Initial value:
= R"(
#version 400
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout (std140, binding = 0) uniform buffer
{
mat4 mvp;
} uniformBuffer;
layout (location = 0) in vec4 pos;
layout (location = 1) in vec4 inColor;
layout (location = 0) out vec4 outColor;
void main()
{
outColor = inColor;
gl_Position = uniformBuffer.mvp * pos;
}
)"

Definition at line 31 of file shaders.hpp.

◆ vertexShaderText_PT_T

const std::string vertexShaderText_PT_T
Initial value:
= R"(
#version 400
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
layout (std140, binding = 0) uniform buffer
{
mat4 mvp;
} uniformBuffer;
layout (location = 0) in vec4 pos;
layout (location = 1) in vec2 inTexCoord;
layout (location = 0) out vec2 outTexCoord;
void main()
{
outTexCoord = inTexCoord;
gl_Position = uniformBuffer.mvp * pos;
}
)"

Definition at line 55 of file shaders.hpp.