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
4#ifndef QSGRENDERERINTERFACE_H
5#define QSGRENDERERINTERFACE_H
6
7#include <QtQuick/qsgnode.h>
8
10
11class QQuickWindow;
12
13class Q_QUICK_EXPORT QSGRendererInterface
14{
15public:
16 enum GraphicsApi {
17 Unknown,
18 Software,
19 OpenVG,
20 OpenGL,
21 Direct3D11,
22 Vulkan,
23 Metal,
24 Null,
25 Direct3D12,
26
27 OpenGLRhi = OpenGL,
28 Direct3D11Rhi = Direct3D11,
29 VulkanRhi = Vulkan,
30 MetalRhi = Metal,
31 NullRhi = Null
32 };
33
34 enum Resource {
35 DeviceResource,
36 CommandQueueResource,
37 CommandListResource,
38 PainterResource,
39 RhiResource,
40 RhiSwapchainResource,
41 RhiRedirectCommandBuffer,
42 RhiRedirectRenderTarget,
43 PhysicalDeviceResource,
44 OpenGLContextResource,
45 DeviceContextResource,
46 CommandEncoderResource,
47 VulkanInstanceResource,
48 RenderPassResource,
49 RedirectPaintDevice,
50 GraphicsQueueFamilyIndexResource,
51 GraphicsQueueIndexResource,
52 };
53
54 enum ShaderType {
55 UnknownShadingLanguage,
56 GLSL,
57 HLSL,
58 RhiShader
59 };
60
61 enum ShaderCompilationType {
62 RuntimeCompilation = 0x01,
63 OfflineCompilation = 0x02
64 };
65 Q_DECLARE_FLAGS(ShaderCompilationTypes, ShaderCompilationType)
66
67 enum ShaderSourceType {
68 ShaderSourceString = 0x01,
69 ShaderSourceFile = 0x02,
70 ShaderByteCode = 0x04
71 };
72 Q_DECLARE_FLAGS(ShaderSourceTypes, ShaderSourceType)
73
74 enum RenderMode {
75 RenderMode2D,
76 RenderMode2DNoDepthBuffer,
77 RenderMode3D
78 };
79
80 virtual ~QSGRendererInterface();
81
82 virtual GraphicsApi graphicsApi() const = 0;
83
84 virtual void *getResource(QQuickWindow *window, Resource resource) const;
85 virtual void *getResource(QQuickWindow *window, const char *resource) const;
86
87 virtual ShaderType shaderType() const = 0;
88 virtual ShaderCompilationTypes shaderCompilationType() const = 0;
89 virtual ShaderSourceTypes shaderSourceType() const = 0;
90
91 static bool isApiRhiBased(GraphicsApi api);
92};
93
94Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRendererInterface::ShaderCompilationTypes)
95Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRendererInterface::ShaderSourceTypes)
96
97QT_END_NAMESPACE
98
99#endif
QObject * parent
Definition qobject.h:73
\inmodule QtCore
Definition qobject.h:105
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.