aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-05-14 13:25:04 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2020-05-26 13:30:13 +0200
commit8afbdbdc9f33623987e9ecc42d2c7b05754e31c9 (patch)
tree261c023b1d6aec30e8c6273fa6ca506f1ef7bcf1 /src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h
parent7accd9cc74d88a17b08c83ea4b8275557dc318bb (diff)
RHI implementation of compressed texture atlasing
Automatic atlasing (which is enabled by default for normal textures) was added as an experimental, opt-in feature in 5.11. This commit redoes that implementation for RHI, and enables it by default. [ChangeLog] Enable automatic atlasing of compressed textures (can be disabled with QSG_DISABLE_COMPRESSED_ATLAS=1) Fixes: QTBUG-78582 Change-Id: Ia8344fffdc8dd8fb476bf6a77057c359e4816487 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h')
-rw-r--r--src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h b/src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h
index d584f0e2d4..00e37098b1 100644
--- a/src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h
+++ b/src/quick/scenegraph/compressedtexture/qsgcompressedtexture_p.h
@@ -54,11 +54,14 @@
#include <private/qtexturefiledata_p.h>
#include <private/qsgcontext_p.h>
#include <private/qsgtexture_p.h>
+#include <private/qrhi_p.h>
#include <QQuickTextureFactory>
#include <QOpenGLFunctions>
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(QSG_LOG_TEXTUREIO);
+
class Q_QUICK_PRIVATE_EXPORT QSGCompressedTexture : public QSGTexture
{
Q_OBJECT
@@ -78,6 +81,12 @@ public:
QTextureFileData textureData() const;
+ struct FormatInfo
+ {
+ QRhiTexture::Format rhiFormat;
+ bool isSRGB;
+ };
+ static FormatInfo formatInfo(quint32 glTextureFormat);
static bool formatIsOpaque(quint32 glTextureFormat);
protected:
@@ -101,11 +110,10 @@ public:
int textureByteCount() const override;
QSize textureSize() const override;
+ const QTextureFileData *textureData() const { return &m_textureData; }
+
protected:
QTextureFileData m_textureData;
-
-private:
- friend class QSGOpenGLAtlasTexture::Manager;
};
QT_END_NAMESPACE