summaryrefslogtreecommitdiff
path: root/src/gui/rhi
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/rhi')
-rw-r--r--src/gui/rhi/qrhi.cpp6
-rw-r--r--src/gui/rhi/qrhi_p_p.h2
-rw-r--r--src/gui/rhi/qrhid3d11.cpp4
-rw-r--r--src/gui/rhi/qrhigles2.cpp10
-rw-r--r--src/gui/rhi/qrhimetal.mm24
-rw-r--r--src/gui/rhi/qrhinull.cpp2
-rw-r--r--src/gui/rhi/qrhivulkan.cpp18
-rw-r--r--src/gui/rhi/qshaderdescription.cpp32
8 files changed, 49 insertions, 49 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index afe79c6687..3821062c8e 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -3357,7 +3357,7 @@ void QRhiImplementation::updateLayoutDesc(QRhiShaderResourceBindings *srb)
srb->m_layoutDescHash = 0;
srb->m_layoutDesc.clear();
auto layoutDescAppender = std::back_inserter(srb->m_layoutDesc);
- for (const QRhiShaderResourceBinding &b : qAsConst(srb->m_bindings)) {
+ for (const QRhiShaderResourceBinding &b : std::as_const(srb->m_bindings)) {
const QRhiShaderResourceBinding::Data *d = b.data();
srb->m_layoutDescHash ^= uint(d->binding) ^ uint(d->stage) ^ uint(d->type)
^ uint(d->arraySize());
@@ -5123,7 +5123,7 @@ QRhiImplementation::~QRhiImplementation()
qWarning("QRhi %p going down with %d unreleased resources that own native graphics objects. This is not nice.",
q, int(resources.size()));
}
- for (QRhiResource *res : qAsConst(resources)) {
+ for (QRhiResource *res : std::as_const(resources)) {
if (leakCheck)
qWarning(" %s resource %p (%s)", resourceTypeStr(res), res, res->m_objectName.constData());
@@ -5750,7 +5750,7 @@ void QRhi::addCleanupCallback(const CleanupCallback &callback)
*/
void QRhi::runCleanup()
{
- for (const CleanupCallback &f : qAsConst(d->cleanupCallbacks))
+ for (const CleanupCallback &f : std::as_const(d->cleanupCallbacks))
f(this);
d->cleanupCallbacks.clear();
diff --git a/src/gui/rhi/qrhi_p_p.h b/src/gui/rhi/qrhi_p_p.h
index bf596abef1..7ac0184a16 100644
--- a/src/gui/rhi/qrhi_p_p.h
+++ b/src/gui/rhi/qrhi_p_p.h
@@ -188,7 +188,7 @@ public:
void runGpuFrameTimeCallbacks(float t)
{
- for (const QRhi::GpuFrameTimeCallback &f : qAsConst(gpuFrameTimeCallbacks))
+ for (const QRhi::GpuFrameTimeCallback &f : std::as_const(gpuFrameTimeCallbacks))
f(t);
}
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index 2a69474433..3ef1fa394e 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -1678,7 +1678,7 @@ void QRhiD3D11::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate
QD3D11Texture *texD = QRHI_RES(QD3D11Texture, u.dst);
for (int layer = 0, maxLayer = u.subresDesc.count(); layer < maxLayer; ++layer) {
for (int level = 0; level < QRhi::MAX_MIP_LEVELS; ++level) {
- for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : std::as_const(u.subresDesc[layer][level]))
enqueueSubresUpload(texD, cbD, layer, level, subresDesc);
}
}
@@ -4289,7 +4289,7 @@ bool QD3D11GraphicsPipeline::create()
}
QByteArray vsByteCode;
- for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ for (const QRhiShaderStage &shaderStage : std::as_const(m_shaderStages)) {
auto cacheIt = rhiD->m_shaderCache.constFind(shaderStage);
if (cacheIt != rhiD->m_shaderCache.constEnd()) {
switch (shaderStage.type()) {
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp
index 5d0d6f503f..a45915495e 100644
--- a/src/gui/rhi/qrhigles2.cpp
+++ b/src/gui/rhi/qrhigles2.cpp
@@ -2251,7 +2251,7 @@ void QRhiGles2::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate
QGles2Texture *texD = QRHI_RES(QGles2Texture, u.dst);
for (int layer = 0, maxLayer = u.subresDesc.size(); layer < maxLayer; ++layer) {
for (int level = 0; level < QRhi::MAX_MIP_LEVELS; ++level) {
- for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : std::as_const(u.subresDesc[layer][level]))
enqueueSubresUpload(texD, cbD, layer, level, subresDesc);
}
}
@@ -3599,7 +3599,7 @@ void QRhiGles2::bindShaderResources(QGles2CommandBuffer *cbD,
}
QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, b->u.ubuf.buf);
const char *bufView = bufD->data.constData() + viewOffset;
- for (const QGles2UniformDescription &uniform : qAsConst(uniforms)) {
+ for (const QGles2UniformDescription &uniform : std::as_const(uniforms)) {
if (uniform.binding == b->binding) {
// in a uniform buffer everything is at least 4 byte aligned
// so this should not cause unaligned reads
@@ -5531,7 +5531,7 @@ bool QGles2GraphicsPipeline::create()
};
QShaderDescription desc[LastIdx];
QShader::SeparateToCombinedImageSamplerMappingList samplerMappingList[LastIdx];
- for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ for (const QRhiShaderStage &shaderStage : std::as_const(m_shaderStages)) {
if (isGraphicsStage(shaderStage)) {
const int idx = descIdxForStage(shaderStage);
QShader shader = shaderStage.shader();
@@ -5554,7 +5554,7 @@ bool QGles2GraphicsPipeline::create()
return false;
if (cacheResult == QRhiGles2::ProgramCacheMiss) {
- for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ for (const QRhiShaderStage &shaderStage : std::as_const(m_shaderStages)) {
if (isGraphicsStage(shaderStage)) {
if (!rhiD->compileShader(program, shaderStage, nullptr))
return false;
@@ -5593,7 +5593,7 @@ bool QGles2GraphicsPipeline::create()
// present in both shaders.
QDuplicateTracker<int, 256> activeUniformLocations;
- for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ for (const QRhiShaderStage &shaderStage : std::as_const(m_shaderStages)) {
if (isGraphicsStage(shaderStage)) {
const int idx = descIdxForStage(shaderStage);
for (const QShaderDescription::UniformBlock &ub : desc[idx].uniformBlocks())
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
index b0926d5e21..731d60ecf4 100644
--- a/src/gui/rhi/qrhimetal.mm
+++ b/src/gui/rhi/qrhimetal.mm
@@ -1164,7 +1164,7 @@ void QRhiMetal::enqueueShaderResourceBindings(QMetalShaderResourceBindings *srbD
{
QMetalShaderResourceBindingsData bindingData;
- for (const QRhiShaderResourceBinding &binding : qAsConst(srbD->sortedBindings)) {
+ for (const QRhiShaderResourceBinding &binding : std::as_const(srbD->sortedBindings)) {
const QRhiShaderResourceBinding::Data *b = binding.data();
switch (b->type) {
case QRhiShaderResourceBinding::UniformBuffer:
@@ -1306,7 +1306,7 @@ void QRhiMetal::enqueueShaderResourceBindings(QMetalShaderResourceBindings *srbD
return a.nativeBinding < b.nativeBinding;
});
- for (const QMetalShaderResourceBindingsData::Stage::Buffer &buf : qAsConst(bindingData.res[stage].buffers)) {
+ for (const QMetalShaderResourceBindingsData::Stage::Buffer &buf : std::as_const(bindingData.res[stage].buffers)) {
bindingData.res[stage].bufferBatches.feed(buf.nativeBinding, buf.mtlbuf);
bindingData.res[stage].bufferOffsetBatches.feed(buf.nativeBinding, buf.offset);
}
@@ -1339,10 +1339,10 @@ void QRhiMetal::enqueueShaderResourceBindings(QMetalShaderResourceBindings *srbD
return a.nativeBinding < b.nativeBinding;
});
- for (const QMetalShaderResourceBindingsData::Stage::Texture &t : qAsConst(bindingData.res[stage].textures))
+ for (const QMetalShaderResourceBindingsData::Stage::Texture &t : std::as_const(bindingData.res[stage].textures))
bindingData.res[stage].textureBatches.feed(t.nativeBinding, t.mtltex);
- for (const QMetalShaderResourceBindingsData::Stage::Sampler &s : qAsConst(bindingData.res[stage].samplers))
+ for (const QMetalShaderResourceBindingsData::Stage::Sampler &s : std::as_const(bindingData.res[stage].samplers))
bindingData.res[stage].samplerBatches.feed(s.nativeBinding, s.mtlsampler);
bindingData.res[stage].textureBatches.finish();
@@ -2050,7 +2050,7 @@ QRhi::FrameOpResult QRhiMetal::beginFrame(QRhiSwapChain *swapChain, QRhi::BeginF
// commands+present to complete, while for others just for the commands
// (for this same frame slot) but not sure how to do that in a sane way so
// wait for full cb completion for now.
- for (QMetalSwapChain *sc : qAsConst(swapchains)) {
+ for (QMetalSwapChain *sc : std::as_const(swapchains)) {
dispatch_semaphore_t sem = sc->d->sem[swapChainD->currentFrameSlot];
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
if (sc != swapChainD)
@@ -2144,7 +2144,7 @@ QRhi::FrameOpResult QRhiMetal::beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi:
currentFrameSlot = (currentFrameSlot + 1) % QMTL_FRAMES_IN_FLIGHT;
if (swapchains.count() > 1) {
- for (QMetalSwapChain *sc : qAsConst(swapchains)) {
+ for (QMetalSwapChain *sc : std::as_const(swapchains)) {
// wait+signal is the general pattern to ensure the commands for a
// given frame slot have completed (if sem is 1, we go 0 then 1; if
// sem is 0 we go -1, block, completion increments to 0, then us to 1)
@@ -2198,7 +2198,7 @@ QRhi::FrameOpResult QRhiMetal::finish()
}
}
- for (QMetalSwapChain *sc : qAsConst(swapchains)) {
+ for (QMetalSwapChain *sc : std::as_const(swapchains)) {
for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
if (currentSwapChain && sc == currentSwapChain && i == currentFrameSlot) {
// no wait as this is the thing we're going to be commit below and
@@ -2446,7 +2446,7 @@ void QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate
qsizetype stagingSize = 0;
for (int layer = 0, maxLayer = u.subresDesc.count(); layer < maxLayer; ++layer) {
for (int level = 0; level < QRhi::MAX_MIP_LEVELS; ++level) {
- for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : std::as_const(u.subresDesc[layer][level]))
stagingSize += subresUploadByteSize(subresDesc);
}
}
@@ -2460,7 +2460,7 @@ void QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate
qsizetype curOfs = 0;
for (int layer = 0, maxLayer = u.subresDesc.count(); layer < maxLayer; ++layer) {
for (int level = 0; level < QRhi::MAX_MIP_LEVELS; ++level) {
- for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : std::as_const(u.subresDesc[layer][level]))
enqueueSubresUpload(utexD, mp, blitEnc, layer, level, subresDesc, &curOfs);
}
}
@@ -2573,7 +2573,7 @@ void QRhiMetal::executeBufferHostWritesForSlot(QMetalBuffer *bufD, int slot)
void *p = [bufD->d->buf[slot] contents];
quint32 changeBegin = UINT32_MAX;
quint32 changeEnd = 0;
- for (const QMetalBufferData::BufferUpdate &u : qAsConst(bufD->d->pendingUpdates[slot])) {
+ for (const QMetalBufferData::BufferUpdate &u : std::as_const(bufD->d->pendingUpdates[slot])) {
memcpy(static_cast<char *>(p) + u.offset, u.data.constData(), size_t(u.data.size()));
if (u.offset < changeBegin)
changeBegin = u.offset;
@@ -4511,7 +4511,7 @@ bool QMetalGraphicsPipeline::createVertexFragmentPipeline()
// buffers not just the resource binding layout), so leave
// rpDesc.vertex/fragmentBuffers at the defaults.
- for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ for (const QRhiShaderStage &shaderStage : std::as_const(m_shaderStages)) {
auto cacheIt = rhiD->d->shaderCache.constFind(shaderStage);
if (cacheIt != rhiD->d->shaderCache.constEnd()) {
switch (shaderStage.type()) {
@@ -5131,7 +5131,7 @@ bool QMetalGraphicsPipeline::create()
QShader tesc;
QShader tese;
QShader tessFrag;
- for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ for (const QRhiShaderStage &shaderStage : std::as_const(m_shaderStages)) {
switch (shaderStage.type()) {
case QRhiShaderStage::Vertex:
tessVert = shaderStage.shader();
diff --git a/src/gui/rhi/qrhinull.cpp b/src/gui/rhi/qrhinull.cpp
index 5728e428b3..b0c3c559c4 100644
--- a/src/gui/rhi/qrhinull.cpp
+++ b/src/gui/rhi/qrhinull.cpp
@@ -384,7 +384,7 @@ void QRhiNull::simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::Textu
QNullTexture *texD = QRHI_RES(QNullTexture, u.dst);
for (int layer = 0, maxLayer = u.subresDesc.size(); layer < maxLayer; ++layer) {
for (int level = 0; level < QRhi::MAX_MIP_LEVELS; ++level) {
- for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level])) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : std::as_const(u.subresDesc[layer][level])) {
if (!subresDesc.image().isNull()) {
const QImage src = subresDesc.image();
QPainter painter(&texD->image[layer][level]);
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index 06e7fbcc38..daf934f1d3 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -544,7 +544,7 @@ bool QRhiVulkan::create(QRhi::Flags flags)
if (devExtCount) {
QList<VkExtensionProperties> extProps(devExtCount);
f->vkEnumerateDeviceExtensionProperties(physDev, nullptr, &devExtCount, extProps.data());
- for (const VkExtensionProperties &p : qAsConst(extProps))
+ for (const VkExtensionProperties &p : std::as_const(extProps))
devExts.append({ p.extensionName, p.specVersion });
}
qCDebug(QRHI_LOG_INFO, "%d device extensions available", int(devExts.count()));
@@ -2071,7 +2071,7 @@ QRhi::FrameOpResult QRhiVulkan::endAndSubmitPrimaryCommandBuffer(VkCommandBuffer
void QRhiVulkan::waitCommandCompletion(int frameSlot)
{
- for (QVkSwapChain *sc : qAsConst(swapchains)) {
+ for (QVkSwapChain *sc : std::as_const(swapchains)) {
const int frameResIndex = sc->bufferCount > 1 ? frameSlot : 0;
QVkSwapChain::FrameResources &frame(sc->frameRes[frameResIndex]);
if (frame.cmdFenceWaitable) {
@@ -3267,7 +3267,7 @@ void QRhiVulkan::enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdat
VkDeviceSize stagingSize = 0;
for (int layer = 0, maxLayer = u.subresDesc.size(); layer < maxLayer; ++layer) {
for (int level = 0; level < QRhi::MAX_MIP_LEVELS; ++level) {
- for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : std::as_const(u.subresDesc[layer][level]))
stagingSize += subresUploadByteSize(subresDesc);
}
}
@@ -3305,7 +3305,7 @@ void QRhiVulkan::enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdat
const QList<QRhiTextureSubresourceUploadDescription> &srd(u.subresDesc[layer][level]);
if (srd.isEmpty())
continue;
- for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(srd)) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : std::as_const(srd)) {
prepareUploadSubres(utexD, layer, level,
subresDesc, &curOfs, mp, &copyInfos);
}
@@ -3608,7 +3608,7 @@ void QRhiVulkan::executeBufferHostWritesForSlot(QVkBuffer *bufD, int slot)
}
quint32 changeBegin = UINT32_MAX;
quint32 changeEnd = 0;
- for (const QVkBuffer::DynamicUpdate &u : qAsConst(bufD->pendingDynamicUpdates[slot])) {
+ for (const QVkBuffer::DynamicUpdate &u : std::as_const(bufD->pendingDynamicUpdates[slot])) {
memcpy(static_cast<char *>(p) + u.offset, u.data.constData(), u.data.size());
if (u.offset < changeBegin)
changeBegin = u.offset;
@@ -4782,7 +4782,7 @@ void QRhiVulkan::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBin
// because dynOfs has to be ordered based on the binding numbers,
// and neither srb nor dynamicOffsets has any such ordering
// requirement.
- for (const QRhiShaderResourceBinding &binding : qAsConst(srbD->sortedBindings)) {
+ for (const QRhiShaderResourceBinding &binding : std::as_const(srbD->sortedBindings)) {
const QRhiShaderResourceBinding::Data *b = binding.data();
if (b->type == QRhiShaderResourceBinding::UniformBuffer && b->u.ubuf.hasDynamicOffset) {
uint32_t offset = 0;
@@ -6764,7 +6764,7 @@ bool QVkShaderResourceBindings::create()
hasSlottedResource = false;
hasDynamicOffset = false;
- for (const QRhiShaderResourceBinding &binding : qAsConst(sortedBindings)) {
+ for (const QRhiShaderResourceBinding &binding : std::as_const(sortedBindings)) {
const QRhiShaderResourceBinding::Data *b = binding.data();
if (b->type == QRhiShaderResourceBinding::UniformBuffer && b->u.ubuf.buf) {
if (QRHI_RES(QVkBuffer, b->u.ubuf.buf)->type() == QRhiBuffer::Dynamic)
@@ -6775,7 +6775,7 @@ bool QVkShaderResourceBindings::create()
}
QVarLengthArray<VkDescriptorSetLayoutBinding, 4> vkbindings;
- for (const QRhiShaderResourceBinding &binding : qAsConst(sortedBindings)) {
+ for (const QRhiShaderResourceBinding &binding : std::as_const(sortedBindings)) {
const QRhiShaderResourceBinding::Data *b = binding.data();
VkDescriptorSetLayoutBinding vkbinding = {};
vkbinding.binding = uint32_t(b->binding);
@@ -7074,7 +7074,7 @@ bool QVkGraphicsPipeline::create()
VkPipelineColorBlendStateCreateInfo blendInfo = {};
blendInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
QVarLengthArray<VkPipelineColorBlendAttachmentState, 4> vktargetBlends;
- for (const QRhiGraphicsPipeline::TargetBlend &b : qAsConst(m_targetBlends)) {
+ for (const QRhiGraphicsPipeline::TargetBlend &b : std::as_const(m_targetBlends)) {
VkPipelineColorBlendAttachmentState blend = {};
blend.blendEnable = b.enable;
blend.srcColorBlendFactor = toVkBlendFactor(b.srcColor);
diff --git a/src/gui/rhi/qshaderdescription.cpp b/src/gui/rhi/qshaderdescription.cpp
index c701265bc6..387ebc7c53 100644
--- a/src/gui/rhi/qshaderdescription.cpp
+++ b/src/gui/rhi/qshaderdescription.cpp
@@ -1136,13 +1136,13 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
QJsonObject root;
QJsonArray jinputs;
- for (const QShaderDescription::InOutVariable &v : qAsConst(inVars))
+ for (const QShaderDescription::InOutVariable &v : std::as_const(inVars))
jinputs.append(inOutObject(v));
if (!jinputs.isEmpty())
root[inputsKey()] = jinputs;
QJsonArray joutputs;
- for (const QShaderDescription::InOutVariable &v : qAsConst(outVars))
+ for (const QShaderDescription::InOutVariable &v : std::as_const(outVars))
joutputs.append(inOutObject(v));
if (!joutputs.isEmpty())
root[outputsKey()] = joutputs;
@@ -1200,7 +1200,7 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
root[storageBlocksKey()] = jstorageBlocks;
QJsonArray jcombinedSamplers;
- for (const QShaderDescription::InOutVariable &v : qAsConst(combinedImageSamplers)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(combinedImageSamplers)) {
QJsonObject sampler;
sampler[nameKey()] = QString::fromUtf8(v.name);
sampler[typeKey()] = typeStr(v.type);
@@ -1211,7 +1211,7 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
root[combinedImageSamplersKey()] = jcombinedSamplers;
QJsonArray jstorageImages;
- for (const QShaderDescription::InOutVariable &v : qAsConst(storageImages)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(storageImages)) {
QJsonObject image;
image[nameKey()] = QString::fromUtf8(v.name);
image[typeKey()] = typeStr(v.type);
@@ -1222,7 +1222,7 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
root[storageImagesKey()] = jstorageImages;
QJsonArray jinBuiltins;
- for (const QShaderDescription::BuiltinVariable &v : qAsConst(inBuiltins)) {
+ for (const QShaderDescription::BuiltinVariable &v : std::as_const(inBuiltins)) {
QJsonObject builtin;
builtin[typeKey()] = builtinTypeStr(v.type);
jinBuiltins.append(builtin);
@@ -1231,7 +1231,7 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
root[inBuiltinsKey()] = jinBuiltins;
QJsonArray joutBuiltins;
- for (const QShaderDescription::BuiltinVariable &v : qAsConst(outBuiltins)) {
+ for (const QShaderDescription::BuiltinVariable &v : std::as_const(outBuiltins)) {
QJsonObject builtin;
builtin[typeKey()] = builtinTypeStr(v.type);
joutBuiltins.append(builtin);
@@ -1259,7 +1259,7 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
root[tessellationPartitioningKey()] = tessPartStr(tessPart);
QJsonArray jseparateImages;
- for (const QShaderDescription::InOutVariable &v : qAsConst(separateImages)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(separateImages)) {
QJsonObject image;
image[nameKey()] = QString::fromUtf8(v.name);
image[typeKey()] = typeStr(v.type);
@@ -1270,7 +1270,7 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
root[separateImagesKey()] = jseparateImages;
QJsonArray jseparateSamplers;
- for (const QShaderDescription::InOutVariable &v : qAsConst(separateSamplers)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(separateSamplers)) {
QJsonObject sampler;
sampler[nameKey()] = QString::fromUtf8(v.name);
sampler[typeKey()] = typeStr(v.type);
@@ -1286,11 +1286,11 @@ QJsonDocument QShaderDescriptionPrivate::makeDoc()
void QShaderDescriptionPrivate::writeToStream(QDataStream *stream)
{
(*stream) << int(inVars.size());
- for (const QShaderDescription::InOutVariable &v : qAsConst(inVars))
+ for (const QShaderDescription::InOutVariable &v : std::as_const(inVars))
serializeInOutVar(stream, v);
(*stream) << int(outVars.size());
- for (const QShaderDescription::InOutVariable &v : qAsConst(outVars))
+ for (const QShaderDescription::InOutVariable &v : std::as_const(outVars))
serializeInOutVar(stream, v);
(*stream) << int(uniformBlocks.size());
@@ -1327,14 +1327,14 @@ void QShaderDescriptionPrivate::writeToStream(QDataStream *stream)
}
(*stream) << int(combinedImageSamplers.size());
- for (const QShaderDescription::InOutVariable &v : qAsConst(combinedImageSamplers)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(combinedImageSamplers)) {
(*stream) << QString::fromUtf8(v.name);
(*stream) << int(v.type);
serializeDecorations(stream, v);
}
(*stream) << int(storageImages.size());
- for (const QShaderDescription::InOutVariable &v : qAsConst(storageImages)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(storageImages)) {
(*stream) << QString::fromUtf8(v.name);
(*stream) << int(v.type);
serializeDecorations(stream, v);
@@ -1344,14 +1344,14 @@ void QShaderDescriptionPrivate::writeToStream(QDataStream *stream)
(*stream) << quint32(localSize[i]);
(*stream) << int(separateImages.size());
- for (const QShaderDescription::InOutVariable &v : qAsConst(separateImages)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(separateImages)) {
(*stream) << QString::fromUtf8(v.name);
(*stream) << int(v.type);
serializeDecorations(stream, v);
}
(*stream) << int(separateSamplers.size());
- for (const QShaderDescription::InOutVariable &v : qAsConst(separateSamplers)) {
+ for (const QShaderDescription::InOutVariable &v : std::as_const(separateSamplers)) {
(*stream) << QString::fromUtf8(v.name);
(*stream) << int(v.type);
serializeDecorations(stream, v);
@@ -1363,11 +1363,11 @@ void QShaderDescriptionPrivate::writeToStream(QDataStream *stream)
(*stream) << quint32(tessPart);
(*stream) << int(inBuiltins.size());
- for (const QShaderDescription::BuiltinVariable &v : qAsConst(inBuiltins))
+ for (const QShaderDescription::BuiltinVariable &v : std::as_const(inBuiltins))
(*stream) << int(v.type);
(*stream) << int(outBuiltins.size());
- for (const QShaderDescription::BuiltinVariable &v : qAsConst(outBuiltins))
+ for (const QShaderDescription::BuiltinVariable &v : std::as_const(outBuiltins))
(*stream) << int(v.type);
}