Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsgtexture_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSGTEXTURE_P_H
5#define QSGTEXTURE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick/private/qtquickglobal_p.h>
19#include <private/qobject_p.h>
20#include "qsgtexture.h"
21
23
34
36
37bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept;
38bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept;
39size_t qHash(const QSGSamplerDescription &s, size_t seed = 0) noexcept;
40
41#if QT_CONFIG(opengl)
42class Q_QUICK_EXPORT QSGTexturePlatformOpenGL : public QNativeInterface::QSGOpenGLTexture
43{
44public:
45 QSGTexturePlatformOpenGL(QSGTexture *t) : m_texture(t) { }
46 QSGTexture *m_texture;
47
48 GLuint nativeTexture() const override;
49};
50#endif
51
52#ifdef Q_OS_WIN
53class Q_QUICK_EXPORT QSGTexturePlatformD3D11 : public QNativeInterface::QSGD3D11Texture
54{
55public:
56 QSGTexturePlatformD3D11(QSGTexture *t) : m_texture(t) { }
57 QSGTexture *m_texture;
58
59 void *nativeTexture() const override;
60};
61class Q_QUICK_EXPORT QSGTexturePlatformD3D12 : public QNativeInterface::QSGD3D12Texture
62{
63public:
64 QSGTexturePlatformD3D12(QSGTexture *t) : m_texture(t) { }
65 QSGTexture *m_texture;
66
67 int nativeResourceState() const override;
68 void *nativeTexture() const override;
69};
70#endif
71
72#if QT_CONFIG(metal)
73class Q_QUICK_EXPORT QSGTexturePlatformMetal : public QNativeInterface::QSGMetalTexture
74{
75public:
76 QSGTexturePlatformMetal(QSGTexture *t) : m_texture(t) { }
77 QSGTexture *m_texture;
78
79 QT_OBJC_PROTOCOL(MTLTexture) nativeTexture() const override;
80};
81#endif
82
83#if QT_CONFIG(vulkan)
84class Q_QUICK_EXPORT QSGTexturePlatformVulkan : public QNativeInterface::QSGVulkanTexture
85{
86public:
87 QSGTexturePlatformVulkan(QSGTexture *t) : m_texture(t) { }
88 QSGTexture *m_texture;
89
90 VkImage nativeImage() const override;
91 VkImageLayout nativeImageLayout() const override;
92};
93#endif
94
95class Q_QUICK_EXPORT QSGTexturePrivate : public QObjectPrivate
96{
97 Q_DECLARE_PUBLIC(QSGTexture)
98public:
100 static QSGTexturePrivate *get(QSGTexture *t) { return t->d_func(); }
101 void resetDirtySamplerOptions();
102 bool hasDirtySamplerOptions() const;
103
107
113
114 // While we could make QSGTexturePrivate implement all the interfaces, we
115 // rather choose to use separate objects to avoid clashes in the function
116 // names and signatures.
117#if QT_CONFIG(opengl)
118 QSGTexturePlatformOpenGL m_openglTextureAccessor;
119#endif
120#ifdef Q_OS_WIN
121 QSGTexturePlatformD3D11 m_d3d11TextureAccessor;
122 QSGTexturePlatformD3D12 m_d3d12TextureAccessor;
123#endif
124#if QT_CONFIG(metal)
125 QSGTexturePlatformMetal m_metalTextureAccessor;
126#endif
127#if QT_CONFIG(vulkan)
128 QSGTexturePlatformVulkan m_vulkanTextureAccessor;
129#endif
130};
131
132Q_QUICK_EXPORT bool qsg_safeguard_texture(QSGTexture *);
133
135
136#endif // QSGTEXTURE_P_H
static QSGTexturePrivate * get(QSGTexture *t)
\inmodule QtQuick
Definition qsgtexture.h:20
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
Definition qsgtexture.h:34
WrapMode
Specifies how the sampler should treat texture coordinates.
Definition qsgtexture.h:28
AnisotropyLevel
Specifies the anisotropic filtering level to be used when the texture is not screen aligned.
Definition qsgtexture.h:40
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLdouble s
[6]
Definition qopenglext.h:235
GLdouble GLdouble t
Definition qopenglext.h:243
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
#define GLuint
size_t qHash(const QSGSamplerDescription &s, size_t seed=0) noexcept
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
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
unsigned int uint
Definition qtypes.h:34
QSGTexture::WrapMode verticalWrap
static QSGSamplerDescription fromTexture(QSGTexture *t)
QSGTexture::WrapMode horizontalWrap
QSGTexture::AnisotropyLevel anisotropylevel
QSGTexture::Filtering filtering
QSGTexture::Filtering mipmapFiltering