Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qssgrhicustommaterialsystem_p.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_RHI_CUSTOM_MATERIAL_SYSTEM_H
6
#define QSSG_RHI_CUSTOM_MATERIAL_SYSTEM_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
20
#include <QtQuick3DRuntimeRender/private/qssgrendershaderlibrarymanager_p.h>
21
#include <QtQuick3DRuntimeRender/private/qssgvertexpipelineimpl_p.h>
22
#include <QtQuick3DRuntimeRender/private/qssgrenderableobjects_p.h>
23
#include <QtQuick3DRuntimeRender/private/qssgrendercustommaterial_p.h>
24
#include <QtQuick3DRuntimeRender/private/qssgrendershaderkeys_p.h>
25
#include <QtQuick3DRuntimeRender/private/qssgshadermapkey_p.h>
26
#include <QtCore/qhash.h>
27
#include <QtGui/QMatrix4x4>
28
29
QT_BEGIN_NAMESPACE
30
31
struct
QSSGRenderCustomMaterial
;
32
struct
QSSGRenderSubset
;
33
struct
QSSGRenderModel
;
34
class
QSSGLayerRenderData
;
35
struct
QSSGRenderableImage
;
36
struct
QSSGRenderLayer
;
37
struct
QSSGRenderLight
;
38
struct
QSSGRenderCamera
;
39
struct
QSSGReflectionMapEntry
;
40
class
QRhiTexture
;
41
42
43
class
Q_QUICK3DRUNTIMERENDER_EXPORT
QSSGCustomMaterialSystem
44
{
45
Q_DISABLE_COPY(
QSSGCustomMaterialSystem
)
46
typedef
QPair<QByteArray, QByteArray>
TStrStrPair;
47
typedef
QHash<QSSGShaderMapKey, QSSGRhiShaderPipelinePtr>
TShaderMap
;
48
49
QSSGRenderContextInterface
*
context
=
nullptr
;
50
TShaderMap
shaderMap;
51
52
void
setShaderResources(
char
*ubufData,
53
const
QSSGRenderCustomMaterial
&inMaterial,
54
const
QByteArray
&inPropertyName,
55
const
QVariant
&propertyValue,
56
QSSGRenderShaderDataType
inPropertyType,
57
QSSGRhiShaderPipeline
&shaderPipeline);
58
59
public
:
60
QSSGCustomMaterialSystem
();
61
~QSSGCustomMaterialSystem
();
62
63
void
setRenderContextInterface(
QSSGRenderContextInterface
*inContext);
64
65
void
releaseCachedResources();
66
67
// Returns true if the material is dirty and thus will produce a different render result
68
// than previously. This effects things like progressive AA.
69
bool
prepareForRender(
const
QSSGRenderModel
&inModel,
70
const
QSSGRenderSubset
&inSubset,
71
QSSGRenderCustomMaterial
&inMaterial);
72
73
QSSGRhiShaderPipelinePtr
shadersForCustomMaterial(
QSSGRhiGraphicsPipelineState
*ps,
74
const
QSSGRenderCustomMaterial
&material,
75
QSSGSubsetRenderable
&renderable,
76
const
QSSGShaderFeatures
&featureSet);
77
78
void
updateUniformsForCustomMaterial(
QSSGRhiShaderPipeline
&shaderPipeline,
79
QSSGRhiContext
*rhiCtx,
80
const
QSSGLayerRenderData
&inData,
81
char
*ubufData,
82
QSSGRhiGraphicsPipelineState
*ps,
83
const
QSSGRenderCustomMaterial
&material,
84
QSSGSubsetRenderable
&renderable,
85
const
QSSGRenderCamera
&
camera
,
86
const
QVector2D
*depthAdjust,
87
const
QMatrix4x4
*alteredModelViewProjection);
88
89
void
rhiPrepareRenderable(
QSSGRhiGraphicsPipelineState
*ps,
QSSGPassKey
passKey,
90
QSSGSubsetRenderable
&renderable,
91
const
QSSGShaderFeatures
&featureSet,
92
const
QSSGRenderCustomMaterial
&material,
93
const
QSSGLayerRenderData
&layerData,
94
QRhiRenderPassDescriptor
*renderPassDescriptor,
95
int
samples
,
96
QSSGRenderCamera
*
camera
=
nullptr
,
97
int
cubeFace = -1,
98
QMatrix4x4
*modelViewProjection =
nullptr
,
99
QSSGReflectionMapEntry
*
entry
=
nullptr
);
100
void
applyRhiShaderPropertyValues(
char
*ubufData,
101
const
QSSGRenderCustomMaterial
&inMaterial,
102
QSSGRhiShaderPipeline
&shaderPipeline);
103
void
rhiRenderRenderable(
QSSGRhiContext
*rhiCtx,
104
QSSGSubsetRenderable
&renderable,
105
bool
*needsSetViewport,
106
int
cubeFace,
107
const
QSSGRhiGraphicsPipelineState
&
state
);
108
};
109
110
QT_END_NAMESPACE
111
112
#endif
QByteArray
\inmodule QtCore
Definition
qbytearray.h:57
QHash
\inmodule QtCore
Definition
qhash.h:818
QMatrix4x4
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition
qmatrix4x4.h:25
QRhiRenderPassDescriptor
\inmodule QtGui
Definition
qrhi.h:1119
QRhiTexture
\inmodule QtGui
Definition
qrhi.h:883
QSSGCustomMaterialSystem
Definition
qssgrhicustommaterialsystem_p.h:44
QSSGCustomMaterialSystem::QSSGCustomMaterialSystem
QSSGCustomMaterialSystem()
QSSGLayerRenderData
Definition
qssglayerrenderdata_p.h:172
QSSGRenderContextInterface
Definition
qssgrendercontextcore_p.h:40
QSSGRhiContext
Definition
qssgrhicontext_p.h:923
QSSGRhiShaderPipeline
Definition
qssgrhicontext_p.h:202
QVariant
\inmodule QtCore
Definition
qvariant.h:64
QVector2D
The QVector2D class represents a vector or vertex in 2D space.
Definition
qvectornd.h:31
camera
QCamera * camera
Definition
camera.cpp:19
state
else opt state
[0]
Definition
doc_src_styles.cpp:11
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
context
static void * context
Definition
qandroidaudiosource.cpp:42
QPair
std::pair< T1, T2 > QPair
Definition
qcontainerfwd.h:25
samples
GLsizei samples
Definition
qopengles2ext.h:738
entry
GLuint entry
Definition
qopenglext.h:11002
QSSGRenderShaderDataType
QSSGRenderShaderDataType
Definition
qssgrenderbasetypes_p.h:509
QSSGRhiShaderPipelinePtr
std::shared_ptr< QSSGRhiShaderPipeline > QSSGRhiShaderPipelinePtr
Definition
qssgrhicontext_p.h:396
QSSGPassKey
const void * QSSGPassKey
Definition
qtquick3dutilsglobal_p.h:23
QSSGReflectionMapEntry
Definition
qssgrenderreflectionmap_p.h:37
QSSGRenderCamera
Definition
qssgrendercamera_p.h:35
QSSGRenderCustomMaterial
Definition
qssgrendercustommaterial_p.h:33
QSSGRenderLayer
Definition
qssgrenderlayer_p.h:42
QSSGRenderLight
Definition
qssgrenderlight_p.h:26
QSSGRenderModel
Definition
qssgrendermodel_p.h:37
QSSGRenderSubset
Definition
qssgrendermesh_p.h:27
QSSGRenderableImage
Definition
qssgrenderableimage_p.h:33
QSSGRhiGraphicsPipelineState
Definition
qssgrhicontext_p.h:399
QSSGShaderFeatures
Definition
qssgrendershadercache_p.h:38
QSSGSubsetRenderable
Definition
qssgrenderableobjects_p.h:298
qtquick3d
src
runtimerender
qssgrhicustommaterialsystem_p.h
Generated by
1.9.7