6#include <QtCore/qvariant.h>
7#include <QtGui/private/qrhi_p.h>
9#include <QtQuick3DUtils/private/qquick3dprofiler_p.h>
10#include <QtQuick3DUtils/private/qssgmesh_p.h>
11#include <QtQuick3DUtils/private/qssgassert_p.h>
12#include <QtQuick3DRuntimeRender/private/qssgrenderableimage_p.h>
13#include <QtQuick3DRuntimeRender/private/qssgrendermesh_p.h>
14#include <QtQuick3DUtils/private/qssgutils_p.h>
15#include <QtQuick3DUtils/private/qssgassert_p.h>
16#include <qtquick3d_tracepoints_p.h>
236 QRhiBuffer::UsageFlags usageMask,
242 m_indexFormat(indexFormat)
247 qWarning(
"Failed to build QRhiBuffer with size %d", m_buffer->
size());
329 const auto &vertexInputs =
shaders.vertexInputs();
331 QVarLengthArray<QRhiVertexInputAttribute, 8>
attrs;
334 const QSSGRhiInputAssemblerState::InputSemantic
sem = ia->inputs.
at(inputIndex);
335 auto vertexInputVar = vertexInputs.constFind(
sem);
336 if (vertexInputVar != vertexInputs.constEnd()) {
338 attrs.last().setLocation(vertexInputVar->location);
345 if (instanceBufferBinding > 0) {
346 auto instanceBufferLocations =
shaders.instanceBufferLocations();
349 instanceBufferLocations.transform0,
354 instanceBufferLocations.transform1,
359 instanceBufferLocations.transform2,
361 sizeof(
float) * 4 * 2));
364 instanceBufferLocations.color,
366 sizeof(
float) * 4 * 3));
369 instanceBufferLocations.data,
371 sizeof(
float) * 4 * 4));
392 if (blk.binding == 0) {
393 m_ub0Size = blk.size;
405 m_vertexInputs[QSSGRhiInputAssemblerState::PositionSemantic] =
var;
407 m_vertexInputs[QSSGRhiInputAssemblerState::NormalSemantic] =
var;
409 m_vertexInputs[QSSGRhiInputAssemblerState::TexCoord0Semantic] =
var;
411 m_vertexInputs[QSSGRhiInputAssemblerState::TexCoord1Semantic] =
var;
413 m_vertexInputs[QSSGRhiInputAssemblerState::TexCoordLightmapSemantic] =
var;
415 m_vertexInputs[QSSGRhiInputAssemblerState::TangentSemantic] =
var;
417 m_vertexInputs[QSSGRhiInputAssemblerState::BinormalSemantic] =
var;
419 m_vertexInputs[QSSGRhiInputAssemblerState::ColorSemantic] =
var;
421 m_vertexInputs[QSSGRhiInputAssemblerState::JointSemantic] =
var;
423 m_vertexInputs[QSSGRhiInputAssemblerState::WeightSemantic] =
var;
424 }
else if (
var.name ==
"qt_instanceTransform0") {
426 }
else if (
var.name ==
"qt_instanceTransform1") {
428 }
else if (
var.name ==
"qt_instanceTransform2") {
430 }
else if (
var.name ==
"qt_instanceColor") {
432 }
else if (
var.name ==
"qt_instanceData") {
443 m_combinedImageSamplers[
var.name] =
var;
445 std::fill(m_materialImageSamplerBindings,
456 const qint32 v = inValue.toInt();
481 const qint32 v = inValue.value<
bool>();
508 const float v = inValue.value<
float>();
532 const QVector4D v = QSSGUtils::color::sRGBToLinear(inValue.value<
QColor>());
575 float v[2] = { float(
s.width()), float(
s.height()) };
582 float v[2] = { float(
s.width()), float(
s.height()) };
589 float v[2] = { float(
p.x()), float(
p.y()) };
596 float v[2] = { float(
p.x()), float(
p.y()) };
603 float v[4] = { float(
r.x()), float(
r.y()), float(
r.width()), float(
r.height()) };
610 float v[4] = { float(
r.x()), float(
r.y()), float(
r.width()), float(
r.height()) };
617 float v[4] = { float(
q.x()), float(
q.y()), float(
q.z()), float(
q.scalar()) };
622 qWarning(
"Attempted to set uniform %s value with unsupported data type %i",
644 if (!storeIndex || *storeIndex == -1) {
647 if (
it != m_uniformIndex.
cend()) {
654 const int new_idx = m_uniforms.
size();
655 m_uniformIndex[
name] = new_idx;
659 qWarning(
"Attempted to set uniform with too long name: %s",
name);
671 if (u.offset == SIZE_MAX && u.maybeExists) {
674 u.offset =
it->offset;
678 if (u.offset == SIZE_MAX) {
680 u.maybeExists =
false;
684 char *
dst = ubufData + u.offset;
688 const float *
src =
static_cast<const float *
>(
data);
689 memcpy(
dst,
src, 3 *
sizeof(
float));
690 memcpy(
dst + 4 *
sizeof(
float),
src + 3, 3 *
sizeof(
float));
691 memcpy(
dst + 8 *
sizeof(
float),
src + 6, 3 *
sizeof(
float));
708 constexpr size_t std140BaseTypeSize = 4 *
sizeof(float);
712 const size_t uniformSize = std140BaseTypeSize < ua->typeSize ? ua->typeSize * ua->itemCount : std140BaseTypeSize * ua->itemCount;
717 if (!storeIndex || *storeIndex == -1) {
721 if (
it != m_uniformIndex.
cend()) {
723 ua = &m_uniformArrays[
index];
728 ua = &m_uniformArrays.
last();
731 qWarning(
"Attempted to set uniform array with too long name: %s",
name);
737 ua = &m_uniformArrays[*storeIndex];
743 if (ua->offset == SIZE_MAX && ua->maybeExists) {
746 ua->offset =
it->offset;
750 if (ua->offset == SIZE_MAX) {
752 ua->maybeExists =
false;
756 char *
p = ubufData + ua->offset;
762 if (
sizeof(
qint32) != ua->typeSize || itemCount != ua->itemCount) {
763 ua->typeSize =
sizeof(
qint32);
764 ua->itemCount = itemCount;
769 for (
size_t i = 0;
i < itemCount; ++
i)
770 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
776 if (2 *
sizeof(
qint32) != ua->typeSize || itemCount != ua->itemCount) {
777 ua->typeSize = 2 *
sizeof(
qint32);
778 ua->itemCount = itemCount;
783 for (
size_t i = 0;
i < itemCount; ++
i)
784 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
790 if (3 *
sizeof(
qint32) != ua->typeSize || itemCount != ua->itemCount) {
791 ua->typeSize = 3 *
sizeof(
qint32);
792 ua->itemCount = itemCount;
797 for (
size_t i = 0;
i < itemCount; ++
i)
798 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
804 if (4 *
sizeof(
qint32) != ua->typeSize || itemCount != ua->itemCount) {
805 ua->typeSize = 4 *
sizeof(
qint32);
806 ua->itemCount = itemCount;
811 memcpy(
p,
v, ua->typeSize * ua->itemCount);
816 const float *
v =
static_cast<const float *
>(
data);
817 if (
sizeof(
float) != ua->typeSize || itemCount != ua->itemCount) {
818 ua->typeSize =
sizeof(float);
819 ua->itemCount = itemCount;
824 for (
size_t i = 0;
i < itemCount; ++
i)
825 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
831 if (2 *
sizeof(
float) != ua->typeSize || itemCount != ua->itemCount) {
832 ua->typeSize = 2 *
sizeof(float);
833 ua->itemCount = itemCount;
838 for (
size_t i = 0;
i < itemCount; ++
i)
839 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
845 if (3 *
sizeof(
float) != ua->typeSize || itemCount != ua->itemCount) {
846 ua->typeSize = 3 *
sizeof(float);
847 ua->itemCount = itemCount;
852 for (
size_t i = 0;
i < itemCount; ++
i)
853 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
859 if (4 *
sizeof(
float) != ua->typeSize || itemCount != ua->itemCount) {
860 ua->typeSize = 4 *
sizeof(float);
861 ua->itemCount = itemCount;
866 memcpy(
p,
v, ua->typeSize * ua->itemCount);
872 if (4 *
sizeof(
float) != ua->typeSize || itemCount != ua->itemCount) {
873 ua->typeSize = 4 *
sizeof(float);
874 ua->itemCount = itemCount;
879 for (
size_t i = 0;
i < itemCount; ++
i) {
880 const QVector4D vi = QSSGUtils::color::sRGBToLinear(
v[
i]);
881 memcpy(
p +
i * std140BaseTypeSize, &vi, ua->typeSize);
888 if (
sizeof(
quint32) != ua->typeSize || itemCount != ua->itemCount) {
889 ua->typeSize =
sizeof(
quint32);
890 ua->itemCount = itemCount;
895 for (
size_t i = 0;
i < itemCount; ++
i)
896 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
902 if (2 *
sizeof(
quint32) != ua->typeSize || itemCount != ua->itemCount) {
903 ua->typeSize = 2 *
sizeof(
quint32);
904 ua->itemCount = itemCount;
909 for (
size_t i = 0;
i < itemCount; ++
i)
910 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
916 if (3 *
sizeof(
quint32) != ua->typeSize || itemCount != ua->itemCount) {
917 ua->typeSize = 3 *
sizeof(
quint32);
918 ua->itemCount = itemCount;
923 for (
size_t i = 0;
i < itemCount; ++
i)
924 memcpy(
p +
i * std140BaseTypeSize, &
v[
i], ua->typeSize);
930 if (4 *
sizeof(
quint32) != ua->typeSize || itemCount != ua->itemCount) {
931 ua->typeSize = 4 *
sizeof(
quint32);
932 ua->itemCount = itemCount;
937 memcpy(
p,
v, ua->typeSize * ua->itemCount);
943 if (12 *
sizeof(
float) != ua->typeSize || itemCount != ua->itemCount) {
944 ua->typeSize = 12 *
sizeof(float);
945 ua->itemCount = itemCount;
950 for (
uint i = 0;
i < ua->itemCount; ++
i) {
951 memcpy(
p +
i * ua->typeSize,
v[
i].constData(), 3 *
sizeof(
float));
952 memcpy(
p +
i * ua->typeSize + 4 *
sizeof(
float),
v[
i].constData() + 3, 3 *
sizeof(
float));
953 memcpy(
p +
i * ua->typeSize + 8 *
sizeof(
float),
v[
i].constData() + 6, 3 *
sizeof(
float));
960 if (16 *
sizeof(
float) != ua->typeSize || itemCount != ua->itemCount) {
961 ua->typeSize = 16 *
sizeof(float);
962 ua->itemCount = itemCount;
967 for (
uint i = 0;
i < ua->itemCount; ++
i)
968 memcpy(
p +
i * ua->typeSize, &
v[
i] , ua->typeSize);
983 qWarning(
"Attempted to set uniform %s value with type %d that is unsupported for uniform arrays",
996 if ((*ubuf)->size() < totalBufferSize) {
997 (*ubuf)->setSize(totalBufferSize);
1013 const int binding = m_materialImageSamplerBindings[
hint];
1019 const int binding =
it != m_combinedImageSamplers.
cend() ?
it->binding : -1;
1021 m_materialImageSamplerBindings[
hint] = binding;
1042 d->releaseCachedResources();
1063 return d->m_rhi !=
nullptr;
1078 return d->m_mainRpDesc;
1127 return d->m_mainSamples;
1142 return d->m_mainViewCount;
1169 for (
const auto &samplerInfo : std::as_const(
m_samplers))
1170 delete samplerInfo.second;
1180 if (instanceData.owned)
1181 delete instanceData.buffer;
1187 if (instanceData.owned)
1188 delete instanceData.buffer;
1220 dcd.pipeline =
nullptr;
1255 auto compareSampler = [samplerDescription](
const SamplerInfo &
info){
return info.first == samplerDescription; };
1257 const auto found = std::find_if(
samplers.cbegin(),
samplers.cend(), compareSampler);
1259 return found->second;
1262 samplerDescription.minFilter,
1263 samplerDescription.mipmap,
1264 samplerDescription.hTiling,
1265 samplerDescription.vTiling,
1266 samplerDescription.zTiling);
1267 if (!newSampler->
create()) {
1268 qWarning(
"Failed to build image sampler");
1304 static bool warnShown =
false;
1307 qWarning(
"Attempted to use an unsupported filtering or wrap mode, "
1308 "this is likely due to lacking proper support for non-power-of-two textures on this platform.\n"
1309 "If this is with WebGL, try updating the application to use QQuick3D::idealSurfaceFormat() in main() "
1310 "in order to ensure WebGL 2 is used.");
1339 for (
const auto &subset : std::as_const(mesh->
subsets)) {
1340 if (subset.rhi.targetsTexture)
1352 const void *modelNode =
model;
1355 if (
it.key().model == modelNode) {
1393 image.fill(fillColor);
1394 rub->uploadTexture(
t,
image);
1398 qWarning(
"Failed to build dummy texture");
1401 d->m_dummyTextures.insert({
flags,
size, fillColor, arraySize},
t);
1424 info.renderPasses.clear();
1425 info.externalRenderPass = {};
1426 info.currentRenderPassIndex = -1;
1433 const int rpCount =
info.renderPasses.size();
1434 qDebug(
"%d render passes in 3D renderer %p", rpCount,
layer);
1435 for (
int i = 0;
i < rpCount; ++
i) {
1437 qDebug(
"Render pass %d: rt name='%s' target size %dx%d pixels",
1441 if (
info.externalRenderPass.indexedDraws.callCount ||
info.externalRenderPass.instancedIndexedDraws.callCount
1442 ||
info.externalRenderPass.draws.callCount ||
info.externalRenderPass.instancedDraws.callCount)
1444 qDebug(
"Within external render passes:");
1468 info.currentRenderPassIndex =
info.renderPasses.size() - 1;
1473 Q_TRACE(QSSG_renderPass_exit);
1475 info.currentRenderPassIndex = -1;
1513 rp.instancedIndexedDraws.vertexOrIndexCount += indexCount;
1516 rp.indexedDraws.callCount += 1;
1517 rp.indexedDraws.vertexOrIndexCount += indexCount;
1528 rp.instancedDraws.vertexOrIndexCount += vertexCount;
1531 rp.draws.callCount += 1;
1532 rp.draws.vertexOrIndexCount += vertexCount;
1538 qDebug(
"%llu indexed draw calls with %llu indices in total, "
1539 "%llu non-indexed draw calls with %llu vertices in total",
1543 qDebug(
"%llu instanced indexed draw calls with %llu indices and %llu instances in total, "
1544 "%llu instanced non-indexed draw calls with %llu indices and %llu instances in total",
1560 d->binding = binding;
1563 d->u.ubuf.buf =
buf;
1565 d->u.ubuf.maybeSize =
size;
1566 d->u.ubuf.hasDynamicOffset =
false;
1579 d->binding = binding;
1582 d->u.stex.count = 1;
1583 d->u.stex.texSamplers[0].tex = tex;
1584 d->u.stex.texSamplers[0].sampler =
sampler;
1614 ps->
setShaderStages(shaderPipeline->cbeginStages(), shaderPipeline->cendStages());
1619 QRhiGraphicsPipeline::Flags
flags;
1624 if (shaderDebugInfo)
1635 QVarLengthArray<QRhiGraphicsPipeline::TargetBlend, 8> targetBlends(
key.state.colorAttachmentCount);
1636 for (
int i = 0;
i <
key.state.colorAttachmentCount; ++
i)
1637 targetBlends[
i] = blend;
1660 qWarning(
"Failed to build graphics pipeline state");
1679 qWarning(
"Failed to build compute pipeline");
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
The QColor class provides colors based on RGB, HSV or CMYK values.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
const_iterator constFind(const Key &key) const noexcept
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it.
iterator erase(const_iterator it)
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
const_iterator cend() const noexcept
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
constexpr qsizetype size() const noexcept
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QQuaternion class represents a quaternion consisting of a vector and scalar.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
Type
Specifies storage type of buffer resource.
virtual bool create()=0
Creates the corresponding native graphics resources.
@ DoNotTrackResourcesForCompute
IndexFormat
Specifies the index data type.
void setShaderStage(const QRhiShaderStage &stage)
Sets the shader to use.
void setShaderResourceBindings(QRhiShaderResourceBindings *srb)
Associates with srb describing the resource binding layout and the resources (QRhiBuffer,...
@ CompileShadersWithDebugInfo
void setStencilFront(const StencilOpState &state)
Sets the stencil test state for front faces.
void setCullMode(CullMode mode)
Sets the specified face culling mode.
void setTargetBlends(std::initializer_list< TargetBlend > list)
Sets the list of render target blend settings.
void setStencilTest(bool enable)
Enables or disables stencil tests based on enable.
void setDepthWrite(bool enable)
Controls the writing out of depth data into the depth buffer based on enable.
void setShaderResourceBindings(QRhiShaderResourceBindings *srb)
Associates with srb describing the resource binding layout and the resources (QRhiBuffer,...
void setDepthOp(CompareOp op)
Sets the depth comparison function op.
void setSlopeScaledDepthBias(float bias)
Sets the slope scaled depth bias.
void setVertexInputLayout(const QRhiVertexInputLayout &layout)
Specifies the vertex input layout.
void setFlags(Flags f)
Sets the flags f.
void setShaderStages(std::initializer_list< QRhiShaderStage > list)
Sets the list of shader stages.
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Associates with the specified QRhiRenderPassDescriptor desc.
void setSampleCount(int s)
Sets the sample count.
void setTopology(Topology t)
Sets the primitive topology t.
void setMultiViewCount(int count)
Sets the view count for multiview rendering.
Topology
Specifies the primitive topology.
virtual bool create()=0
Creates the corresponding native graphics resources.
void setDepthTest(bool enable)
Enables or disables depth testing based on enable.
void setDepthBias(int bias)
Sets the depth bias.
void setPolygonMode(PolygonMode mode)
Sets the polygon mode.
void setLineWidth(float width)
Sets the line width.
void setStencilWriteMask(quint32 mask)
Sets the stencil write mask.
static const QRhiShaderResourceBinding::Data * shaderResourceBindingData(const QRhiShaderResourceBinding &binding)
virtual QSize pixelSize() const =0
QRhiImplementation * m_rhi
void setBindings(std::initializer_list< QRhiShaderResourceBinding > list)
Sets the list of bindings.
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
QRhiBuffer * newBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size)
int ubufAligned(int v) const
QRhiShaderResourceBindings * newShaderResourceBindings()
QRhiComputePipeline * newComputePipeline()
QRhiGraphicsPipeline * newGraphicsPipeline()
static QSSGComputePipelineStateKey create(const QShader &shader, const QRhiShaderResourceBindings *srb)
static QSSGGraphicsPipelineStateKey create(const QSSGRhiGraphicsPipelineState &state, const QRhiRenderPassDescriptor *rpDesc, const QRhiShaderResourceBindings *srb)
QSSGRhiBuffer(QSSGRhiContext &context, QRhiBuffer::Type type, QRhiBuffer::UsageFlags usageMask, quint32 stride, qsizetype size, QRhiCommandBuffer::IndexFormat indexFormat=QRhiCommandBuffer::IndexUInt16)
\variable QSSGRhiSamplerDescription::minFilter
void setMainRenderPassDescriptor(QRhiRenderPassDescriptor *rpDesc)
void releaseDrawCallData(QSSGRhiDrawCallData &dcd)
QRhiRenderPassDescriptor * m_mainRpDesc
QRhiShaderResourceBindings * srb(const QSSGRhiShaderResourceBindingList &bindings)
QSSGRhiDrawCallData & drawCallData(const QSSGRhiDrawCallDataKey &key)
QRhiGraphicsPipeline * pipeline(const QSSGRhiGraphicsPipelineState &ps, QRhiRenderPassDescriptor *rpDesc, QRhiShaderResourceBindings *srb)
static bool shaderDebuggingEnabled()
void releaseMesh(QSSGRenderMesh *mesh)
QHash< QSSGRenderInstanceTable *, QSSGRhiInstanceBufferData > m_instanceBuffers
void setCommandBuffer(QRhiCommandBuffer *cb)
QVector< QPair< QSSGRhiSamplerDescription, QRhiSampler * > > m_samplers
void setMainPassSampleCount(int samples)
void cleanupDrawCallData(const QSSGRenderModel *model)
QHash< const QSSGRenderGraphObject *, QSSGRhiParticleData > m_particleData
QHash< const QSSGRenderModel *, QSSGRhiInstanceBufferData > m_instanceBuffersLod
QHash< QSSGRhiDummyTextureKey, QRhiTexture * > m_dummyTextures
void registerMesh(QSSGRenderMesh *mesh)
void releaseCachedResources()
void releaseTexture(QRhiTexture *texture)
QSSGRhiParticleData & particleData(const QSSGRenderGraphObject *particlesOrModel)
void setRenderTarget(QRhiRenderTarget *rt)
QHash< QSSGRhiShaderResourceBindingList, QRhiShaderResourceBindings * > m_srbCache
QHash< QSSGRhiDrawCallDataKey, QSSGRhiDrawCallData > m_drawCallData
void setMainPassViewCount(int viewCount)
void registerTexture(QRhiTexture *texture)
static QSSGRhiContextPrivate * get(QSSGRhiContext *q)
QRhiComputePipeline * computePipeline(const QShader &shader, QRhiShaderResourceBindings *srb)
QHash< QSSGComputePipelineStateKey, QRhiComputePipeline * > m_computePipelines
QHash< QSSGGraphicsPipelineStateKey, QRhiGraphicsPipeline * > m_pipelines
QSSGRhiInstanceBufferData & instanceBufferData(QSSGRenderInstanceTable *instanceTable)
static bool profilingEnabled()
static QSSGRhiContextStats & get(QSSGRhiContext &rhiCtx)
void start(QSSGRenderLayer *layer)
QSSGRenderLayer * layerKey
void cleanupLayerInfo(QSSGRenderLayer *layer)
void beginRenderPass(QRhiTextureRenderTarget *rt)
QHash< QSSGRenderLayer *, PerLayerInfo > perLayerInfo
void drawIndexed(quint32 indexCount, quint32 instanceCount)
void draw(quint32 vertexCount, quint32 instanceCount)
static bool rendererDebugEnabled()
void stop(QSSGRenderLayer *layer)
QSet< QSSGRenderLayer * > dynamicDataSources
void printRenderPass(const RenderPassInfo &rp)
QSSGRhiContext(QRhi *rhi)
int mainPassSampleCount() const
Returns the sample count used in the main render pass.
int mainPassViewCount() const
Returns the multiview count used in the main render pass.
QRhiCommandBuffer * commandBuffer() const
QRhiTexture * dummyTexture(QRhiTexture::Flags flags, QRhiResourceUpdateBatch *rub, const QSize &size=QSize(64, 64), const QColor &fillColor=Qt::black, int arraySize=0)
void checkAndAdjustForNPoT(QRhiTexture *texture, QSSGRhiSamplerDescription *samplerDescription)
Adjusts samplerDescription's tiling and filtering modes based on the pixel size of texture.
QRhiCommandBuffer::BeginPassFlags commonPassFlags() const
QRhiSampler * sampler(const QSSGRhiSamplerDescription &samplerDescription)
QRhiRenderTarget * renderTarget() const
QRhiRenderPassDescriptor * mainRenderPassDescriptor() const
void setUniformValue(char *ubufData, const char *name, const QVariant &value, QSSGRenderShaderValue::Type type)
void addStage(const QRhiShaderStage &stage, StageFlags flags={})
void ensureUniformBuffer(QRhiBuffer **ubuf)
int offsetOfUniform(const QByteArray &name)
void ensureCombinedMainLightsUniformBuffer(QRhiBuffer **ubuf)
int bindingForTexture(const char *name, int hint=-1)
void setUniformArray(char *ubufData, const char *name, const void *data, size_t itemCount, QSSGRenderShaderValue::Type type, int *storeIndex=nullptr)
struct QSSGRhiShaderPipeline::InstanceLocations instanceLocations
void setUniform(char *ubufData, const char *name, const void *data, size_t size, int *storeIndex=nullptr, UniformFlags flags={})
void addUniformBuffer(int binding, QRhiShaderResourceBinding::StageFlags stage, QRhiBuffer *buf, int offset=0, int size=0)
static const int MAX_SIZE
void addTexture(int binding, QRhiShaderResourceBinding::StageFlags stage, QRhiTexture *tex, QRhiSampler *sampler)
QRhiShaderResourceBinding v[MAX_SIZE]
bool remove(const T &value)
const_iterator constEnd() const noexcept
const_iterator constFind(const T &value) const
iterator insert(const T &value)
QList< InOutVariable > inputVariables() const
QList< InOutVariable > combinedImageSamplers() const
QList< UniformBlock > uniformBlocks() const
QShaderDescription description() const
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr size_type size() const noexcept
const T & at(qsizetype idx) const
void push_back(const T &t)
const void * constData() const
The QVector2D class represents a vector or vertex in 2D space.
The QVector3D class represents a vector or vertex in 3D space.
The QVector4D class represents a vector or vertex in 4D space.
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
QSSGRenderGenericVec3< quint32 > uvec3
QSSGRenderGenericVec2< bool > bvec2
QSSGRenderGenericVec3< qint32 > ivec3
QSSGRenderGenericVec2< quint32 > uvec2
QSSGRenderGenericVec4< quint32 > uvec4
QSSGRenderGenericVec4< bool > bvec4
QSSGRenderGenericVec2< qint32 > ivec2
QSSGRenderGenericVec4< qint32 > ivec4
QSSGRenderGenericVec3< bool > bvec3
QRhiVertexInputAttribute::Format toVertexInputFormat(QSSGRenderComponentType compType, quint32 numComps)
QRhiGraphicsPipeline::Topology toTopology(QSSGRenderDrawMode drawMode)
void bakeVertexInputLocations(QSSGRhiInputAssemblerState *ia, const QSSGRhiShaderPipeline &shaders, int instanceBufferBinding)
Combined button and popup list for selecting options.
#define Q_STATIC_ASSERT(Condition)
#define QByteArrayLiteral(str)
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 * iter
static struct AttrInfo attrs[]
constexpr quint32 qNextPowerOfTwo(quint32 v)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
const void GLsizei GLsizei stride
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
GLsizei GLsizei GLuint * shaders
#define Q_QUICK3D_PROFILING_ENABLED
#define QSSG_DEBUG_COND(cond)
#define QSSG_ASSERT_X(cond, msg, action)
#define QSSG_ASSERT(cond, action)
QPair< QSSGRhiSamplerDescription, QRhiSampler * > SamplerInfo
static QString getUBMemberSizeWarning(QLatin1StringView name, qsizetype correctedSize, qsizetype requestedSize)
QSSGRhiInputAssemblerStatePrivate::InputAssemblerState QSSGRhiInputAssemblerState
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define qPrintable(string)
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
#define Q_TRACE_ENABLED(x)
#define Q_TRACE_POINT(provider, tracepoint,...)
QSqlQueryModel * model
[16]
static const char * getLightmapUVAttrName()
static const char * getNormalAttrName()
static const char * getUV1AttrName()
static const char * getTexBinormalAttrName()
static const char * getPositionAttrName()
static const char * getTexTanAttrName()
static const char * getColorAttrName()
static const char * getJointAttrName()
static const char * getUV0AttrName()
static const char * getWeightAttrName()
QVector< QSSGRenderSubset > subsets
quint64 vertexOrIndexCount
quint64 vertexOrIndexCount
InstancedDrawInfo instancedDraws
InstancedDrawInfo instancedIndexedDraws
static constexpr const QSSGRhiShaderPipeline * getShaderPipeline(const QSSGRhiGraphicsPipelineState &ps)
\variable QSSGRhiGraphicsPipelineState::depthFunc
\variable QShaderDescription::InOutVariable::name