diff options
Diffstat (limited to 'src/gui/rhi/qrhimetal.mm')
-rw-r--r-- | src/gui/rhi/qrhimetal.mm | 24 |
1 files changed, 12 insertions, 12 deletions
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(); |