このページでは

QRhiMetalInitParams Struct

金属固有の初期化パラメータ。詳細...

ヘッダー: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
以下のように: Qt 6.6
継承元: QRhiInitParams

詳細な説明

注:これは 互換性の保証が限定的な RHI API です。詳細については、QRhi を参照してください。

Metal ベースの `QRhi ` は、初期化に特別なパラメータを必要としません。

QRhiMetalInitParams params;
rhi = QRhi::create(QRhi::Metal, &params);

注: QRhi では、Metal API の検証をプログラムから有効にすることはできません。代わりに、cmake -G Xcode を通じて.xcodeproj ファイルを生成して XCode でアプリケーションのデバッグビルドを実行するか、環境変数METAL_DEVICE_WRAPPER_TYPE=1 を設定してください。この変数は環境の早い段階で、できればプロセスの起動前に設定する必要があります。QRhi の作成時に設定しようとすると、実際には機能しません。 (おそらく手遅れですが)

注: QRhiSwapChain は 、サーフェスタイプがQSurface::MetalSurface に設定されているQWindow インスタンスのみを対象とすることができます。

既存の Metal デバイスとの連携

他のグラフィックスエンジンと相互運用する場合、同じ Metal デバイスを使用するQRhi インスタンスを取得する必要がある場合があります。これは、QRhiMetalNativeHandles へのポインタをQRhi::create() に渡すことで実現できます。その際、デバイスは null 以外の値に設定されている必要があります。オプションで、コマンドキューオブジェクトを指定することもできます。

QRhi は、いかなる外部オブジェクトの所有権も取得しません。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.