Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-118647

QSGMetalTexture native interface is not available

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 6.5.3
    • Quick: SceneGraph
    • None
    • macOS

    Description

      I've been working on integrating a custom Metal-based renderer with Qt's scenegraph. I've had previous success with the OpenGL & DirectX11 backends.

      I've encountered a problem that the following call:

      tx.nativeInterface<QNativeInterface::QSGMetalTexture>();

      always returns a null pointer. I've confirmed that Qt uses Metal as the Rhi backend:

      qt.scenegraph.general: Creating QRhi with backend Metal for window 0x600001e8afa0 (wflags 0x1)

      Some investigation revealed that the required m_metalTextureAccessor field is initialized to NULL, because the initializer is inside an #if defined(_OBJC_) block, while the qsgtexture.cpp file is compiled as C++. Link to offending line.

       

      The bug was introduced in commit 28005c0c037626d5601192e2a412633656d52b39. While protecting the interface by ifdef(_OBJC_) makes good sense in headers, it fails to serve its purpose when placed in cpp files.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              janichol Andy Nichols
              anszom Andrzej Szombierski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes