From 19384f2e8f50bad0a0775f7b2e10aff3372bcbb5 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 16 Mar 2021 16:33:27 +0100 Subject: rhi: Make it possible to clone a QRhiRenderPassDescriptor Pick-to: 6.1 Task-number: QTBUG-91888 Change-Id: Ib6d2e639e6c24f3e9a733c6563dc8a6d6da47719 Reviewed-by: Qt CI Bot Reviewed-by: Andy Nichols --- src/gui/rhi/qrhimetal.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gui/rhi/qrhimetal.mm') diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index a736dd511e..ddbd0ea740 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -2900,6 +2900,16 @@ bool QMetalRenderPassDescriptor::isCompatible(const QRhiRenderPassDescriptor *ot return true; } +QRhiRenderPassDescriptor *QMetalRenderPassDescriptor::newCompatibleRenderPassDescriptor() const +{ + QMetalRenderPassDescriptor *rp = new QMetalRenderPassDescriptor(m_rhi); + rp->colorAttachmentCount = colorAttachmentCount; + rp->hasDepthStencil = hasDepthStencil; + memcpy(rp->colorFormat, colorFormat, sizeof(colorFormat)); + rp->dsFormat = dsFormat; + return rp; +} + QMetalReferenceRenderTarget::QMetalReferenceRenderTarget(QRhiImplementation *rhi) : QRhiRenderTarget(rhi), d(new QMetalRenderTargetData) -- cgit v1.2.3