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
qssgrendererimplshaders_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGRENDERERIMPLSHADERS_P_H
5#define QSSGRENDERERIMPLSHADERS_P_H
6
7#include <QtCore/qbytearray.h>
8
9#include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
10
11#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
12#include <QtQuick3DRuntimeRender/private/qssgrenderlayer_p.h>
13#include <QtQuick3DRuntimeRender/private/qssgrenderparticles_p.h>
14
15//
16// W A R N I N G
17// -------------
18//
19// This file is not part of the Qt API. It exists purely as an
20// implementation detail. This header file may change from version to
21// version without notice, or even be removed.
22//
23// We mean it.
24//
25
27
28class QSSGShaderCache;
29
30class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGBuiltInRhiShaderCache
31{
32public:
34 : m_shaderCache(shaderCache) {}
35
36 void releaseCachedResources();
37
39 Default,
40 Uv,
41 UvTangent
42 };
43
44 QSSGRhiShaderPipelinePtr getRhiCubemapShadowBlurXShader();
45 QSSGRhiShaderPipelinePtr getRhiCubemapShadowBlurYShader();
46 QSSGRhiShaderPipelinePtr getRhiGridShader(int viewCount);
47 QSSGRhiShaderPipelinePtr getRhiOrthographicShadowBlurXShader();
48 QSSGRhiShaderPipelinePtr getRhiOrthographicShadowBlurYShader();
49 QSSGRhiShaderPipelinePtr getRhiSsaoShader(int viewCount);
50 QSSGRhiShaderPipelinePtr getRhiSkyBoxCubeShader(int viewCount);
51 QSSGRhiShaderPipelinePtr getRhiSkyBoxShader(QSSGRenderLayer::TonemapMode tonemapMode, bool isRGBE, int viewCount);
52 QSSGRhiShaderPipelinePtr getRhiSupersampleResolveShader(int viewCount);
53 QSSGRhiShaderPipelinePtr getRhiProgressiveAAShader();
54 QSSGRhiShaderPipelinePtr getRhiParticleShader(QSSGRenderParticles::FeatureLevel featureLevel, int viewCount);
55 QSSGRhiShaderPipelinePtr getRhiSimpleQuadShader(int viewCount);
56 QSSGRhiShaderPipelinePtr getRhiLightmapUVRasterizationShader(LightmapUVRasterizationShaderMode mode);
57 QSSGRhiShaderPipelinePtr getRhiLightmapDilateShader();
58 QSSGRhiShaderPipelinePtr getRhiDebugObjectShader();
59 QSSGRhiShaderPipelinePtr getRhiReflectionprobePreFilterShader();
60 QSSGRhiShaderPipelinePtr getRhienvironmentmapPreFilterShader(bool isRGBE);
61 QSSGRhiShaderPipelinePtr getRhiEnvironmentmapShader();
62
63private:
64 QSSGShaderCache &m_shaderCache; // We're owned by the shadercache
65
66 struct BuiltinShader {
67 // The shader refs are non-null if we have attempted to generate the
68 // shader. This does not mean we were successul, however.
69 QSSGRhiShaderPipelinePtr shaderPipeline;
70 int viewCount = 1;
71 };
72
73 QSSGRhiShaderPipelinePtr getBuiltinRhiShader(const QByteArray &name,
74 BuiltinShader &storage,
75 int viewCount = 1);
76
77 struct {
80 BuiltinShader gridShader;
83 BuiltinShader ssaoRhiShader;
84 BuiltinShader skyBoxRhiShader[QSSGRenderLayer::TonemapModeCount * 2 /* rgbe+hdr */];
85 BuiltinShader skyBoxCubeRhiShader;
88 BuiltinShader texturedQuadRhiShader;
89 BuiltinShader simpleQuadRhiShader;
93 BuiltinShader lightmapDilateShader;
94 BuiltinShader debugObjectShader;
95
97 BuiltinShader environmentmapPreFilterShader[2];
98 BuiltinShader environmentmapShader;
99
112 } m_cache;
113};
114
116
117#endif // QSSGRENDERERIMPLSHADERS_P_H
\inmodule QtCore
Definition qbytearray.h:57
QSSGBuiltInRhiShaderCache(QSSGShaderCache &shaderCache)
Combined button and popup list for selecting options.
GLenum mode
GLuint name
static QT_BEGIN_NAMESPACE const uint Default
Definition qsplitter_p.h:27
std::shared_ptr< QSSGRhiShaderPipeline > QSSGRhiShaderPipelinePtr
QStorageInfo storage
[1]
static size_t constexpr TonemapModeCount