| 1 | // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QT3DRENDER_QSHADERPROGRAM_P_H |
| 5 | #define QT3DRENDER_QSHADERPROGRAM_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 for the convenience |
| 12 | // of other Qt classes. 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 <Qt3DCore/private/qnode_p.h> |
| 19 | #include <Qt3DRender/qshaderprogram.h> |
| 20 | #include <Qt3DRender/private/qt3drender_global_p.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | namespace Qt3DRender { |
| 25 | |
| 26 | class Q_3DRENDERSHARED_PRIVATE_EXPORT QShaderProgramPrivate : public Qt3DCore::QNodePrivate |
| 27 | { |
| 28 | public: |
| 29 | QShaderProgramPrivate(); |
| 30 | |
| 31 | Q_DECLARE_PUBLIC(QShaderProgram) |
| 32 | QByteArray m_vertexShaderCode; |
| 33 | QByteArray m_tessControlShaderCode; |
| 34 | QByteArray m_tessEvalShaderCode; |
| 35 | QByteArray m_geometryShaderCode; |
| 36 | QByteArray m_fragmentShaderCode; |
| 37 | QByteArray m_computeShaderCode; |
| 38 | QString m_log; |
| 39 | QShaderProgram::Status m_status; |
| 40 | QShaderProgram::Format m_format; |
| 41 | |
| 42 | void setLog(const QString &log); |
| 43 | void setStatus(QShaderProgram::Status status); |
| 44 | |
| 45 | static QByteArray deincludify(const QByteArray &contents, const QString &filePath); |
| 46 | static QByteArray deincludify(const QString &filePath); |
| 47 | static QByteArray resolveAutoBindingIndices(const QByteArray &content, |
| 48 | int ¤tBinding, |
| 49 | int ¤tInputLocation, |
| 50 | int ¤tOutputLocation); |
| 51 | static QByteArray resolveAutoBindingIndices(const QByteArray &content); |
| 52 | }; |
| 53 | |
| 54 | } // namespace Qt3DRender |
| 55 | |
| 56 | QT_END_NAMESPACE |
| 57 | |
| 58 | #endif // QT3DRENDER_QSHADERPROGRAM_P_H |
| 59 | |