Add samples ImmutableSampler, InitTexture, InputAttachment (#315)
+ slightly adjust some other samples.
This commit is contained in:
committed by
Markus Tavenrath
parent
d4ddb0a2cd
commit
d965a74cc0
@@ -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);
|
||||
}
|
||||
)";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user