5#ifndef QSGTEXTURE_PLATFORM_H
6#define QSGTEXTURE_PLATFORM_H
8#include <QtCore/qnativeinterface.h>
9#include <QtQuick/qquickwindow.h>
12#include <QtGui/qopengl.h>
16#include <QtGui/qvulkaninstance.h>
19#if QT_CONFIG(metal) || defined(Q_QDOC)
20# if defined(__OBJC__) || defined(Q_QDOC)
22# define QT_OBJC_PROTOCOL(protocol) id<protocol>
25# define QT_OBJC_PROTOCOL(protocol) id
31namespace QNativeInterface {
33#if QT_CONFIG(opengl) || defined(Q_QDOC)
34struct Q_QUICK_EXPORT QSGOpenGLTexture
36 QT_DECLARE_NATIVE_INTERFACE(QSGOpenGLTexture, 1, QSGTexture)
37 virtual GLuint nativeTexture()
const = 0;
38 static QSGTexture *fromNative(GLuint textureId,
41 QQuickWindow::CreateTextureOptions options = {});
42 static QSGTexture *fromNativeExternalOES(GLuint textureId,
45 QQuickWindow::CreateTextureOptions options = {});
49#if defined(Q_OS_WIN) || defined(Q_QDOC)
50struct Q_QUICK_EXPORT QSGD3D11Texture
52 QT_DECLARE_NATIVE_INTERFACE(QSGD3D11Texture, 1, QSGTexture)
53 virtual void *nativeTexture()
const = 0;
54 static QSGTexture *fromNative(
void *texture,
57 QQuickWindow::CreateTextureOptions options = {});
59struct Q_QUICK_EXPORT QSGD3D12Texture
61 QT_DECLARE_NATIVE_INTERFACE(QSGD3D12Texture, 1, QSGTexture)
62 virtual void *nativeTexture()
const = 0;
63 virtual int nativeResourceState()
const = 0;
64 static QSGTexture *fromNative(
void *texture,
68 QQuickWindow::CreateTextureOptions options = {});
72#if QT_CONFIG(metal) || defined(Q_QDOC)
73struct Q_QUICK_EXPORT QSGMetalTexture
75 QT_DECLARE_NATIVE_INTERFACE(QSGMetalTexture, 1, QSGTexture)
76 virtual QT_OBJC_PROTOCOL(MTLTexture) nativeTexture()
const = 0;
77 static QSGTexture *fromNative(QT_OBJC_PROTOCOL(MTLTexture) texture,
80 QQuickWindow::CreateTextureOptions options = {});
84#if QT_CONFIG(vulkan) || defined(Q_QDOC)
85struct Q_QUICK_EXPORT QSGVulkanTexture
87 QT_DECLARE_NATIVE_INTERFACE(QSGVulkanTexture, 1, QSGTexture)
88 virtual VkImage nativeImage()
const = 0;
89 virtual VkImageLayout nativeImageLayout()
const = 0;
90 static QSGTexture *fromNative(VkImage image,
94 QQuickWindow::CreateTextureOptions options = {});
The QSGDynamicTexture class serves as a baseclass for dynamically changing textures,...
Combined button and popup list for selecting options.
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)