4#ifndef QSGTEXTURE_PLATFORM_H
5#define QSGTEXTURE_PLATFORM_H
7#include <QtCore/qnativeinterface.h>
8#include <QtQuick/qquickwindow.h>
11#include <QtGui/qopengl.h>
15#include <QtGui/qvulkaninstance.h>
18#if QT_CONFIG(metal) || defined(Q_QDOC)
19# if defined(__OBJC__) || defined(Q_QDOC)
21# define QT_OBJC_PROTOCOL(protocol) id<protocol>
24# define QT_OBJC_PROTOCOL(protocol) id
30namespace QNativeInterface {
32#if QT_CONFIG(opengl) || defined(Q_QDOC)
33struct Q_QUICK_EXPORT QSGOpenGLTexture
35 QT_DECLARE_NATIVE_INTERFACE(QSGOpenGLTexture, 1, QSGTexture)
36 virtual GLuint nativeTexture()
const = 0;
37 static QSGTexture *fromNative(GLuint textureId,
40 QQuickWindow::CreateTextureOptions options = {});
41 static QSGTexture *fromNativeExternalOES(GLuint textureId,
44 QQuickWindow::CreateTextureOptions options = {});
48#if defined(Q_OS_WIN) || defined(Q_QDOC)
49struct Q_QUICK_EXPORT QSGD3D11Texture
51 QT_DECLARE_NATIVE_INTERFACE(QSGD3D11Texture, 1, QSGTexture)
52 virtual void *nativeTexture()
const = 0;
53 static QSGTexture *fromNative(
void *texture,
56 QQuickWindow::CreateTextureOptions options = {});
58struct Q_QUICK_EXPORT QSGD3D12Texture
60 QT_DECLARE_NATIVE_INTERFACE(QSGD3D12Texture, 1, QSGTexture)
61 virtual void *nativeTexture()
const = 0;
62 virtual int nativeResourceState()
const = 0;
63 static QSGTexture *fromNative(
void *texture,
67 QQuickWindow::CreateTextureOptions options = {});
71#if QT_CONFIG(metal) || defined(Q_QDOC)
72struct Q_QUICK_EXPORT QSGMetalTexture
74 QT_DECLARE_NATIVE_INTERFACE(QSGMetalTexture, 1, QSGTexture)
75 virtual QT_OBJC_PROTOCOL(MTLTexture) nativeTexture()
const = 0;
76 static QSGTexture *fromNative(QT_OBJC_PROTOCOL(MTLTexture) texture,
79 QQuickWindow::CreateTextureOptions options = {});
83#if QT_CONFIG(vulkan) || defined(Q_QDOC)
84struct Q_QUICK_EXPORT QSGVulkanTexture
86 QT_DECLARE_NATIVE_INTERFACE(QSGVulkanTexture, 1, QSGTexture)
87 virtual VkImage nativeImage()
const = 0;
88 virtual VkImageLayout nativeImageLayout()
const = 0;
89 static QSGTexture *fromNative(VkImage image,
93 QQuickWindow::CreateTextureOptions options = {});
The QSGDynamicTexture class serves as a baseclass for dynamically changing textures,...
static void qt_debug_print_texture_count()
static void qt_debug_remove_texture(QSGTexture *texture)
static void qt_debug_add_texture(QSGTexture *texture)
size_t qHash(const QSGSamplerDescription &s, size_t seed=0) noexcept
Q_DECLARE_TYPEINFO(QSGSamplerDescription, Q_RELOCATABLE_TYPE)
bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept
Q_QUICK_EXPORT bool qsg_safeguard_texture(QSGTexture *)
bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept
static QSGSamplerDescription fromTexture(QSGTexture *t)