diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-24 15:59:56 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-06-26 14:42:42 +0200 |
commit | db61e43c81f4b5ed8c36365f63c2e2fb81e2a1e7 (patch) | |
tree | 5da4247a52a91872f53464e95c54611ca6db6349 /src/gui/rhi/qrhimetal.mm | |
parent | b60f516aca5196a49e3cc53e7620c2b5da3f507c (diff) |
rhi: Enable specifying just an adapter or phys dev
Required by OpenXR. A VkPhysicalDevice or an adapter LUID + feature
level pair should be adoptable while leaving the rest (device, queue,
etc. setup) to QRhi as normal.
Change-Id: Iada0972671b037b4efb03e7831b7c9b8c5f2393d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhimetal.mm')
-rw-r--r-- | src/gui/rhi/qrhimetal.mm | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index 46a121c812..357e9e792d 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -107,10 +107,6 @@ QT_BEGIN_NAMESPACE \class QRhiMetalNativeHandles \inmodule QtRhi \brief Holds the Metal device used by the QRhi. - - \note The class uses \c{void *} as the type since including the Objective C - headers is not acceptable here. The actual types are \c{id<MTLDevice>} and - \c{id<MTLCommandQueue>}. */ /*! @@ -413,8 +409,8 @@ bool QRhiMetal::create(QRhi::Flags flags) } #endif - nativeHandlesStruct.dev = d->dev; - nativeHandlesStruct.cmdQueue = d->cmdQueue; + nativeHandlesStruct.dev = (MTLDevice *) d->dev; + nativeHandlesStruct.cmdQueue = (MTLCommandQueue *) d->cmdQueue; return true; } @@ -3657,8 +3653,8 @@ void QMetalCommandBuffer::destroy() const QRhiNativeHandles *QMetalCommandBuffer::nativeHandles() { - nativeHandlesStruct.commandBuffer = d->cb; - nativeHandlesStruct.encoder = d->currentRenderPassEncoder; + nativeHandlesStruct.commandBuffer = (MTLCommandBuffer *) d->cb; + nativeHandlesStruct.encoder = (MTLRenderCommandEncoder *) d->currentRenderPassEncoder; return &nativeHandlesStruct; } |