Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
// This file is part of Desktop App Toolkit,
|
|
// a set of libraries for developing nice desktop applications.
|
|
//
|
|
// For license and copyright information please follow this link:
|
|
// https://github.com/desktop-app/legal/blob/master/LEGAL
|
|
//
|
|
#pragma once
|
|
|
|
#include <QtCore/QString>
|
|
#include <QOpenGLShader>
|
|
|
|
class OpenGLShaderProgram;
|
|
|
|
namespace Ui::GL {
|
|
|
|
struct ShaderPart {
|
|
QString header;
|
|
QString body;
|
|
};
|
|
|
|
[[nodiscard]] QString VertexShader(const std::vector<ShaderPart> &parts);
|
|
[[nodiscard]] QString FragmentShader(const std::vector<ShaderPart> &parts);
|
|
|
|
[[nodiscard]] ShaderPart VertexPassTextureCoord(char prefix = 'v');
|
|
[[nodiscard]] ShaderPart FragmentSampleARGB32Texture();
|
|
[[nodiscard]] ShaderPart FragmentSampleYUV420Texture();
|
|
[[nodiscard]] ShaderPart FragmentSampleNV12Texture();
|
|
[[nodiscard]] ShaderPart FragmentGlobalOpacity();
|
|
[[nodiscard]] ShaderPart VertexViewportTransform();
|
|
[[nodiscard]] ShaderPart FragmentRoundCorners();
|
|
[[nodiscard]] ShaderPart FragmentStaticColor();
|
|
|
|
not_null<QOpenGLShader*> MakeShader(
|
|
not_null<QOpenGLShaderProgram*> program,
|
|
QOpenGLShader::ShaderType type,
|
|
const QString &source);
|
|
|
|
struct Program {
|
|
not_null<QOpenGLShader*> vertex;
|
|
not_null<QOpenGLShader*> fragment;
|
|
};
|
|
|
|
Program LinkProgram(
|
|
not_null<QOpenGLShaderProgram*> program,
|
|
std::variant<QString, not_null<QOpenGLShader*>> vertex,
|
|
std::variant<QString, not_null<QOpenGLShader*>> fragment);
|
|
|
|
} // namespace Ui::GL
|