Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qssgrendercontextcore.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QSSG_RENDER_CONTEXT_CORE_H
6#define QSSG_RENDER_CONTEXT_CORE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is part of the QtQuick3D API, with limited compatibility guarantees.
13// Usage of this API may make your code source and binary incompatible with
14// future versions of Qt.
15//
16
17#include <QtQuick3DRuntimeRender/qtquick3druntimerenderexports.h>
18
19#include <QtCore/QPair>
20#include <QtCore/QSize>
21#include <memory>
22
24
25class QSSGRhiContext;
27class QSSGRenderer;
29class QSSGShaderCache;
32class QSSGRendererInterface;
35
36class QQuickWindow;
37class QRhi;
38
39class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderContextInterface
40{
41 Q_DISABLE_COPY(QSSGRenderContextInterface)
42public:
43 // The commonly used version (from QQuick3DSceneRenderer). There is one
44 // rendercontext per QQuickWindow (and so scenegraph render thread).
45 explicit QSSGRenderContextInterface(QRhi *rhi);
46
47 // This overload must only be used in special cases, e.g. by the genshaders tool.
48 QSSGRenderContextInterface(std::unique_ptr<QSSGBufferManager> bufferManager,
49 std::unique_ptr<QSSGRenderer> renderer,
50 std::shared_ptr<QSSGShaderLibraryManager> shaderLibraryManager,
51 std::unique_ptr<QSSGShaderCache> shaderCache,
52 std::unique_ptr<QSSGCustomMaterialSystem> customMaterialSystem,
53 std::unique_ptr<QSSGProgramGenerator> shaderProgramGenerator,
54 std::unique_ptr<QSSGRhiContext> ctx,
55 std::unique_ptr<QSSGDebugDrawSystem> debugDrawSystem = nullptr);
56
58
59 const std::unique_ptr<QSSGRenderer> &renderer() const;
60 const std::unique_ptr<QSSGBufferManager> &bufferManager() const;
61 const std::unique_ptr<QSSGRhiContext> &rhiContext() const;
62 const std::unique_ptr<QSSGShaderCache> &shaderCache() const;
63 const std::shared_ptr<QSSGShaderLibraryManager> &shaderLibraryManager() const;
64 const std::unique_ptr<QSSGCustomMaterialSystem> &customMaterialSystem() const;
65 const std::unique_ptr<QSSGProgramGenerator> &shaderProgramGenerator() const;
66 const std::unique_ptr<QSSGDebugDrawSystem> &debugDrawSystem() const;
67
68private:
71 friend class QSSGLayerRenderData;
72 friend class QSSGRenderer;
73
74 QRhi *rhi() const; // Internal convenience function
75 void init();
76 void releaseCachedResources();
77
78 // The memory used for the per frame allocator is released as the first step in BeginFrame.
79 // This is useful for short lived objects and datastructures.
80 // NOTE: Only used internally and not replaceable for now.
81 const std::unique_ptr<QSSGPerFrameAllocator> &perFrameAllocator() const;
82
83 std::unique_ptr<QSSGRhiContext> m_rhiContext;
84 std::unique_ptr<QSSGShaderCache> m_shaderCache;
85 std::unique_ptr<QSSGBufferManager> m_bufferManager;
86 std::unique_ptr<QSSGRenderer> m_renderer;
87 std::shared_ptr<QSSGShaderLibraryManager> m_shaderLibraryManager;
88 std::unique_ptr<QSSGCustomMaterialSystem> m_customMaterialSystem;
89 std::unique_ptr<QSSGProgramGenerator> m_shaderProgramGenerator;
90 std::unique_ptr<QSSGDebugDrawSystem> m_debugDrawSystem;
91 std::unique_ptr<QSSGPerFrameAllocator> m_perFrameAllocator;
92};
94
95#endif
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
\inmodule QtQuick3D
EGLContext ctx
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QSvgRenderer * renderer
[0]