1// Copyright (C) 2019 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_RENDER_SHADERIMAGE_P_H
5#define QT3DRENDER_RENDER_SHADERIMAGE_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 <Qt3DRender/private/backendnode_p.h>
19#include <Qt3DRender/qshaderimage.h>
20
21QT_BEGIN_NAMESPACE
22
23namespace Qt3DRender {
24
25namespace Render {
26
27class Q_AUTOTEST_EXPORT ShaderImage : public BackendNode
28{
29public:
30 ShaderImage();
31
32 void cleanup();
33 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
34
35 Qt3DCore::QNodeId textureId() const { return m_textureId; }
36 int mipLevel() const { return m_mipLevel; }
37 int layer() const { return m_layer; }
38 bool layered() const { return m_layered; }
39 QShaderImage::Access access() const { return m_access; }
40 QShaderImage::ImageFormat format() const { return m_format; }
41
42 // For Unit Test purposes only
43#ifdef QT_BUILD_INTERNAL
44 void setTextureId(Qt3DCore::QNodeId id) { m_textureId = id; }
45 void setMipLevel(int level) { m_mipLevel = level; }
46 void setLayer(int layer) { m_layer = layer; }
47 void setLayered(bool layered) { m_layered = layered; }
48 void setAccess(QShaderImage::Access access) { m_access = access; }
49 void setFormat(QShaderImage::ImageFormat format) { m_format = format; }
50#endif
51
52private:
53 Qt3DCore::QNodeId m_textureId;
54 int m_mipLevel;
55 int m_layer;
56 bool m_layered;
57 QShaderImage::Access m_access;
58 QShaderImage::ImageFormat m_format;
59};
60
61} // namespace Render
62
63} // namespace Qt3DRender
64
65QT_END_NAMESPACE
66
67#endif // QT3DRENDER_RENDER_SHADERIMAGE_P_H
68

source code of qt3d/src/render/materialsystem/shaderimage_p.h