5#ifndef QSSG_RENDER_SHADER_CACHE_H
6#define QSSG_RENDER_SHADER_CACHE_H
19#include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
20#include <QtQuick3DUtils/private/qssgdataref_p.h>
21#include <QtQuick3DUtils/private/qqsbcollection_p.h>
23#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
24#include <QtQuick3DRuntimeRender/private/qssgrendererimplshaders_p.h>
26#include <QtCore/QString>
27#include <QtCore/qcryptographichash.h>
28#include <QtCore/QSharedPointer>
29#include <QtCore/QVector>
69 IblOrientation = (1 << 9) + 1,
72 DepthPass = (1 << 12) + 4,
73 OrthoShadowPass = (1 << 13) + 5,
74 CubeShadowPass = (1 << 14) + 6,
75 LinearTonemapping = (1 << 15) + 7,
76 AcesTonemapping = (1 << 16) + 8,
77 HejlDawsonTonemapping = (1 << 17) + 9,
78 FilmicTonemapping = (1 << 18) + 10,
79 RGBELightProbe = (1 << 19) + 11,
80 OpaqueDepthPrePass = (1 << 20) + 12,
81 ReflectionProbe = (1 << 21) + 13,
82 ReduceMaxNumLights = (1 << 22) + 14,
83 Lightmap = (1 << 23) + 15,
84 DisableMultiView = (1 << 24) + 16,
85 ForceIblExposure = (1 << 25) + 17,
91static constexpr quint32 Count = (
static_cast<FlagType>(Feature::LastFeature) & IndexMask);
98void set(Feature feature,
bool val);
106 set(Feature::LinearTonemapping,
false);
107 set(Feature::AcesTonemapping,
false);
108 set(Feature::FilmicTonemapping,
false);
109 set(Feature::HejlDawsonTonemapping,
false);
110 set(Feature::ForceIblExposure,
false);
115 QVarLengthArray<const char *, Count> enabledFeatureStrings;
116 for (
quint32 idx = 0; idx < Count; ++idx) {
117 const Feature feature = fromIndex(idx);
118 if (features.
isSet(feature))
119 enabledFeatureStrings.append(asDefineString(feature));
121 stream.nospace() <<
"QSSGShaderFeatures(";
122 for (
int i = 0;
i < enabledFeatureStrings.size(); ++
i)
123 stream.nospace() << (
i > 0 ?
", " :
"") << enabledFeatureStrings[
i];
161 return key.m_hashCode;
178 typedef QHash<QSSGShaderCacheKey, QSSGRhiShaderPipelinePtr>
TRhiShaderMap;
185 QString m_persistentShaderStorageFileName;
201 void releaseCachedResources();
211 QSSGRhiShaderPipeline::StageFlags stageFlags = {});
217 QSSGRhiShaderPipeline::StageFlags stageFlags = {});
223 QSSGRhiShaderPipeline::StageFlags stageFlags,
225 bool perTargetCompilation);
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
QSSGBuiltInRhiShaderCache & getBuiltInRhiShaders()
QQsbInMemoryCollection & persistentShaderBakingCache()
void(*)(QShaderBaker *baker, QRhi *rhi) InitBakerFunc
Stage
Describes the stage of the graphics pipeline the shader is suitable for.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
Q_QUICK3DRUNTIMERENDER_EXPORT void setStatusCallback(StatusCallback cb)
void(*)(const QByteArray &descKey, Status status, const QString &err, QShader::Stage stage) StatusCallback
Q_QUICK3DRUNTIMERENDER_EXPORT void setAutomaticDiskCache(bool enable)
Q_QUICK3DRUNTIMERENDER_EXPORT bool isAutomaticDiskCacheEnabled()
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
Q_QUICK3DRUNTIMERENDER_EXPORT size_t qHash(QSSGShaderFeatures features) noexcept
std::shared_ptr< QSSGRhiShaderPipeline > QSSGRhiShaderPipelinePtr
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
QFuture< QSet< QChar > > set
[10]
static size_t generateHashCode(const QByteArray &key, QSSGShaderFeatures features)
QSSGShaderCacheKey & operator=(const QSSGShaderCacheKey &other)=default
bool operator==(const QSSGShaderCacheKey &inOther) const
QSSGShaderCacheKey(const QSSGShaderCacheKey &other)=default
QSSGShaderCacheKey(const QByteArray &key=QByteArray())
QSSGShaderFeatures m_features
constexpr bool isSet(Feature feature) const
friend QDebug operator<<(QDebug stream, const QSSGShaderFeatures &features)
friend bool operator==(QSSGShaderFeatures a, QSSGShaderFeatures b)
constexpr bool isNull() const
void disableTonemapping()
\qmltype MapCircle \instantiates QDeclarativeCircleMapItem \inqmlmodule QtLocation