30 using ProgramType = isf::parser::ShaderType;
37 : type{isf::parser::ShaderType::ISF}
45 SCORE_ASSERT(vec.size() == 2);
46 type = isf::parser::ShaderType::ISF;
50 ShaderSource(ProgramType tp,
const QString& vert,
const QString& frag)
57 ShaderSource(ProgramType tp,
const std::vector<QString>& vec)
59 SCORE_ASSERT(vec.size() == 2);
67 SCORE_ASSERT(vec.size() == 2);
69 fragment = std::move(vec[0]);
70 vertex = std::move(vec[1]);
84 const std::string_view language{};
87 static const inline std::array<MemberSpec, 2> specification{
88 MemberSpec{QObject::tr(
"Fragment"), &ShaderSource::fragment,
"GLSL"},
89 MemberSpec{QObject::tr(
"Vertex"), &ShaderSource::vertex,
"GLSL"},
92 friend QDebug& operator<<(QDebug& d,
const ShaderSource& sp)
94 return (d << sp.vertex << sp.fragment);
96 friend bool operator==(
const ShaderSource& lhs,
const ShaderSource& rhs)
noexcept
102 return lhs.type == rhs.type && lhs.vertex == rhs.vertex
103 && lhs.fragment == rhs.fragment;
105 friend bool operator!=(
const ShaderSource& lhs,
const ShaderSource& rhs)
noexcept
107 return !(lhs == rhs);
111 operator==(
const std::vector<QString>& lhs,
const ShaderSource& rhs)
noexcept
113 SCORE_ASSERT(lhs.size() == 2);
114 return lhs[0] == rhs.*(ShaderSource::specification[0].pointer)
115 && lhs[1] == rhs.*(ShaderSource::specification[1].pointer);
118 operator!=(
const std::vector<QString>& lhs,
const ShaderSource& rhs)
noexcept
120 return !(lhs == rhs);
129programFromVSAVertexShaderPath(
const QString& vertexFilename, QByteArray vertexData);
139preprocessShaderIncludes(QByteArray source,
const QString& originPath = {})
noexcept;