1 | // Copyright (C) 2019 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QSSGRENDERSHADERMETADATA_P_H |
5 | #define QSSGRENDERSHADERMETADATA_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtCore/qbytearray.h> |
19 | #include <QtCore/qvector.h> |
20 | #include <QtQuick3DRuntimeRender/private/qssgrendershadercodegenerator_p.h> |
21 | |
22 | namespace QSSGRenderShaderMetadata { |
23 | |
24 | struct Uniform |
25 | { |
26 | enum Condition { |
27 | None, |
28 | Regular, |
29 | Negated |
30 | }; |
31 | |
32 | QByteArray type; |
33 | Condition condition = Condition::None; |
34 | QByteArray name; |
35 | QByteArray conditionName; |
36 | |
37 | static Condition conditionFromString(const QString &condition); |
38 | }; |
39 | |
40 | struct InputOutput |
41 | { |
42 | QByteArray type; |
43 | QSSGShaderGeneratorStage stage = QSSGShaderGeneratorStage::Vertex; |
44 | QByteArray name; |
45 | |
46 | static QSSGShaderGeneratorStage stageFromString(const QString &stage); |
47 | }; |
48 | |
49 | struct ShaderMetaData |
50 | { |
51 | QVector<Uniform> uniforms; |
52 | QVector<InputOutput> inputs; |
53 | QVector<InputOutput> outputs; |
54 | }; |
55 | |
56 | ShaderMetaData getShaderMetaData(const QByteArray &data); |
57 | |
58 | } // namespace |
59 | |
60 | #endif // QSSGRENDERSHADERMETADATA_H |
61 |