VertexPassTextureCoord may be reused.
This commit is contained in:
parent
28b72295ab
commit
6fa01d0a1e
2 changed files with 6 additions and 7 deletions
|
|
@ -41,15 +41,14 @@ void main() {
|
|||
)";
|
||||
}
|
||||
|
||||
ShaderPart VertexPassTextureCoord() {
|
||||
ShaderPart VertexPassTextureCoord(char prefix) {
|
||||
const auto name = prefix + QString("_texcoord");
|
||||
return {
|
||||
.header = R"(
|
||||
attribute vec2 texcoord;
|
||||
varying vec2 v_texcoord;
|
||||
)",
|
||||
attribute vec2 )" + name + R"(In;
|
||||
varying vec2 )" + name + ";\n",
|
||||
.body = R"(
|
||||
v_texcoord = texcoord;
|
||||
)",
|
||||
)" + name + " = " + name + "In;\n",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ struct ShaderPart {
|
|||
[[nodiscard]] QString VertexShader(const std::vector<ShaderPart> &parts);
|
||||
[[nodiscard]] QString FragmentShader(const std::vector<ShaderPart> &parts);
|
||||
|
||||
[[nodiscard]] ShaderPart VertexPassTextureCoord();
|
||||
[[nodiscard]] ShaderPart VertexPassTextureCoord(char prefix = 'v');
|
||||
[[nodiscard]] ShaderPart FragmentSampleARGB32Texture();
|
||||
[[nodiscard]] ShaderPart FragmentSampleYUV420Texture();
|
||||
[[nodiscard]] ShaderPart VertexViewportTransform();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue