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
22QT_BEGIN_NAMESPACE
23
24namespace QSSGRenderShaderMetadata {
25
26struct Uniform
27{
28 enum Condition {
29 None,
30 Regular,
31 Negated
32 };
33
34 QByteArray type;
35 Condition condition = Condition::None;
36 QByteArray name;
37 QByteArray conditionName;
38 bool multiview = false;
39
40 static Condition conditionFromString(const QString &condition);
41};
42
43struct InputOutput
44{
45 QByteArray type;
46 QSSGShaderGeneratorStage stage = QSSGShaderGeneratorStage::Vertex;
47 QByteArray name;
48 bool flat = false;
49
50 static QSSGShaderGeneratorStage stageFromString(const QString &stage);
51};
52
53struct ShaderMetaData
54{
55 QVector<Uniform> uniforms;
56 QVector<InputOutput> inputs;
57 QVector<InputOutput> outputs;
58};
59
60ShaderMetaData getShaderMetaData(const QByteArray &data);
61
62QT_END_NAMESPACE
63
64} // namespace
65
66#endif // QSSGRENDERSHADERMETADATA_H
67

source code of qtquick3d/src/runtimerender/qssgrendershadermetadata_p.h