Add samples ImmutableSampler, InitTexture, InputAttachment (#315)

+ slightly adjust some other samples.
This commit is contained in:
Andreas Süßenbach
2019-04-09 15:19:18 +02:00
committed by Markus Tavenrath
parent d4ddb0a2cd
commit d965a74cc0
18 changed files with 800 additions and 212 deletions

View File

@@ -52,6 +52,31 @@ void main()
}
)";
// vertex shader with (P)osition and (T)exCoord in and (T)exCoord out
const std::string vertexShaderText_PT_T = 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;
}
)";
// fragment shader with (C)olor in and (C)olor out
const std::string fragmentShaderText_C_C = R"(
#version 400
@@ -69,3 +94,22 @@ void main()
}
)";
// fragment shader with (T)exCoord in and (C)olor out
const std::string fragmentShaderText_T_C = 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);
}
)";