2 #include <Gfx/Graph/RenderState.hpp>
4 #include <score/tools/Debug.hpp>
6 #include <ossia/detail/hash_map.hpp>
11 #include <QtGui/private/qshader_p.h>
14 #include <score_plugin_gfx_export.h>
41 SCORE_ASSERT(vec.size() == 2);
48 SCORE_ASSERT(vec.size() == 2);
49 fragment = std::move(vec[0]);
50 vertex = std::move(vec[1]);
63 const std::string_view language{};
66 static const inline std::array<MemberSpec, 2> specification{
67 MemberSpec{QObject::tr(
"Fragment"), &ShaderSource::fragment,
"GLSL"},
68 MemberSpec{QObject::tr(
"Vertex"), &ShaderSource::vertex,
"GLSL"},
71 friend QDebug& operator<<(QDebug& d,
const ShaderSource& sp)
73 return (d << sp.vertex << sp.fragment);
75 friend bool operator==(
const ShaderSource& lhs,
const ShaderSource& rhs) noexcept
77 return lhs.vertex == rhs.vertex && lhs.fragment == rhs.fragment;
79 friend bool operator!=(
const ShaderSource& lhs,
const ShaderSource& rhs) noexcept
85 operator==(
const std::vector<QString>& lhs,
const ShaderSource& rhs) noexcept
87 SCORE_ASSERT(lhs.size() == 2);
88 return lhs[0] == rhs.*(ShaderSource::specification[0].pointer)
89 && lhs[1] == rhs.*(ShaderSource::specification[1].pointer);
92 operator!=(
const std::vector<QString>& lhs,
const ShaderSource& rhs) noexcept
98 ShaderSource programFromFragmentShaderPath(
const QString& fsFilename, QByteArray fsData);
104 struct hash<
Gfx::ShaderSource>
108 constexpr
const QtPrivate::QHashCombine combine;
110 seed = combine(seed, program.vertex);
111 seed = combine(seed, program.fragment);
121 isf::descriptor descriptor;
127 std::pair<std::optional<ProcessedProgram>, QString>
131 ossia::hash_map<ShaderSource, ProcessedProgram> programs;
Binds the rendering pipeline to ossia processes.
Definition: CameraDevice.cpp:28
GraphicsApi
Available graphics APIs to use.
Definition: RenderState.hpp:17
Definition: ShaderProgram.hpp:120
Definition: ShaderProgram.hpp:125
Definition: ShaderProgram.hpp:60
Definition: ShaderProgram.hpp:27