diff options
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgtexture_platform.h')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgtexture_platform.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgtexture_platform.h b/src/quick/scenegraph/coreapi/qsgtexture_platform.h index e8aef9078f..63c35c381d 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture_platform.h +++ b/src/quick/scenegraph/coreapi/qsgtexture_platform.h @@ -15,8 +15,14 @@ #include <QtGui/qvulkaninstance.h> #endif -#if defined(__OBJC__) || defined(Q_QDOC) -@protocol MTLTexture; +#if QT_CONFIG(metal) || defined(Q_QDOC) +# if defined(__OBJC__) || defined(Q_QDOC) + @protocol MTLTexture; +# define QT_OBJC_PROTOCOL(protocol) id<protocol> +# else + typedef struct objc_object *id; +# define QT_OBJC_PROTOCOL(protocol) id +# endif #endif QT_BEGIN_NAMESPACE @@ -49,14 +55,25 @@ struct Q_QUICK_EXPORT QSGD3D11Texture const QSize &size, QQuickWindow::CreateTextureOptions options = {}); }; +struct Q_QUICK_EXPORT QSGD3D12Texture +{ + QT_DECLARE_NATIVE_INTERFACE(QSGD3D12Texture, 1, QSGTexture) + virtual void *nativeTexture() const = 0; + virtual int nativeResourceState() const = 0; + static QSGTexture *fromNative(void *texture, + int resourceState, + QQuickWindow *window, + const QSize &size, + QQuickWindow::CreateTextureOptions options = {}); +}; #endif -#if defined(__OBJC__) || defined(Q_QDOC) +#if QT_CONFIG(metal) || defined(Q_QDOC) struct Q_QUICK_EXPORT QSGMetalTexture { QT_DECLARE_NATIVE_INTERFACE(QSGMetalTexture, 1, QSGTexture) - virtual id<MTLTexture> nativeTexture() const = 0; - static QSGTexture *fromNative(id<MTLTexture> texture, + virtual QT_OBJC_PROTOCOL(MTLTexture) nativeTexture() const = 0; + static QSGTexture *fromNative(QT_OBJC_PROTOCOL(MTLTexture) texture, QQuickWindow *window, const QSize &size, QQuickWindow::CreateTextureOptions options = {}); |