Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgrendererinterface.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSGRENDERERINTERFACE_H
6#define QSGRENDERERINTERFACE_H
7
8#include <QtQuick/qsgnode.h>
9
11
12class QQuickWindow;
13
14class Q_QUICK_EXPORT QSGRendererInterface
15{
16public:
17 enum GraphicsApi {
18 Unknown,
19 Software,
20 OpenVG,
21 OpenGL,
22 Direct3D11,
23 Vulkan,
24 Metal,
25 Null,
26 Direct3D12,
27
28 OpenGLRhi = OpenGL,
29 Direct3D11Rhi = Direct3D11,
30 VulkanRhi = Vulkan,
31 MetalRhi = Metal,
32 NullRhi = Null
33 };
34
35 enum Resource {
36 DeviceResource,
37 CommandQueueResource,
38 CommandListResource,
39 PainterResource,
40 RhiResource,
41 RhiSwapchainResource,
42 RhiRedirectCommandBuffer,
43 RhiRedirectRenderTarget,
44 PhysicalDeviceResource,
45 OpenGLContextResource,
46 DeviceContextResource,
47 CommandEncoderResource,
48 VulkanInstanceResource,
49 RenderPassResource,
50 RedirectPaintDevice,
51 GraphicsQueueFamilyIndexResource,
52 GraphicsQueueIndexResource,
53 };
54
55 enum ShaderType {
56 UnknownShadingLanguage,
57 GLSL,
58 HLSL,
59 RhiShader
60 };
61
62 enum ShaderCompilationType {
63 RuntimeCompilation = 0x01,
64 OfflineCompilation = 0x02
65 };
66 Q_DECLARE_FLAGS(ShaderCompilationTypes, ShaderCompilationType)
67
68 enum ShaderSourceType {
69 ShaderSourceString = 0x01,
70 ShaderSourceFile = 0x02,
71 ShaderByteCode = 0x04
72 };
73 Q_DECLARE_FLAGS(ShaderSourceTypes, ShaderSourceType)
74
75 enum RenderMode {
76 RenderMode2D,
77 RenderMode2DNoDepthBuffer,
78 RenderMode3D
79 };
80
81 virtual ~QSGRendererInterface();
82
83 virtual GraphicsApi graphicsApi() const = 0;
84
85 virtual void *getResource(QQuickWindow *window, Resource resource) const;
86 virtual void *getResource(QQuickWindow *window, const char *resource) const;
87
88 virtual ShaderType shaderType() const = 0;
89 virtual ShaderCompilationTypes shaderCompilationType() const = 0;
90 virtual ShaderSourceTypes shaderSourceType() const = 0;
91
92 static bool isApiRhiBased(GraphicsApi api);
93};
94
95Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRendererInterface::ShaderCompilationTypes)
96Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRendererInterface::ShaderSourceTypes)
97
98QT_END_NAMESPACE
99
100#endif
QObject * parent
Definition qobject.h:74
\inmodule QtCore
Definition qobject.h:106
QSGContext * create(const QString &key) const override
QSGRenderLoop * createWindowManager() override
Flags flags(const QString &key) const override
QStringList keys() const override
QSurfaceFormat defaultSurfaceFormat() const override
QSGNinePatchNode * createNinePatchNode() override
QSGRenderContext * createRenderContext() override
QSGGlyphNode * createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode, int renderTypeQuality) override
QSGLayer * createLayer(QSGRenderContext *renderContext) override
QSGInternalImageNode * createInternalImageNode(QSGRenderContext *renderContext) override
QSGImageNode * createImageNode() override
QSGInternalRectangleNode * createInternalRectangleNode() override
QSGRectangleNode * createRectangleNode() override
QSGPainterNode * createPainterNode(QQuickPaintedItem *item) override
QSGRendererInterface * rendererInterface(QSGRenderContext *renderContext) override
Returns a pointer to the (presumably) global renderer interface.
QOpenVGContext * vgContext()
ShaderSourceTypes shaderSourceType() const override
void renderNextFrame(QSGRenderer *renderer) override
int maxTextureSize() const override
static const int INIT_PARAMS_MAGIC
ShaderType shaderType() const override
GraphicsApi graphicsApi() const override
Returns the graphics API that is in use by the Qt Quick scenegraph.
void initialize(const QSGRenderContext::InitParams *params) override
ShaderCompilationTypes shaderCompilationType() const override
QSGRenderer * createRenderer(QSGRendererInterface::RenderMode renderMode=QSGRendererInterface::RenderMode2D) override
QSGTexture * createTexture(const QImage &image, uint flags) const override
QSGOpenVGFontGlyphCache * glyphCache(const QRawFont &rawFont)
An interface providing access to some of the graphics API specific internals of the scenegraph.
Combined button and popup list for selecting options.