aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_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/qsgcompressedatlastexture_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/qsgcompressedatlastexture_p.h')
-rw-r--r--src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h
index a2d6d96dfe..fd60aa5f02 100644
--- a/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h
+++ b/src/quick/scenegraph/compressedtexture/qsgcompressedatlastexture_p.h
@@ -53,11 +53,9 @@
#include <QtCore/QSize>
-#include <qopengl.h>
-
#include <QtQuick/QSGTexture>
#include <QtQuick/private/qsgareaallocator_p.h>
-#include <QtQuick/private/qsgopenglatlastexture_p.h>
+#include <QtQuick/private/qsgrhiatlastexture_p.h>
QT_BEGIN_NAMESPACE
@@ -67,16 +65,17 @@ namespace QSGCompressedAtlasTexture {
class Texture;
-class Atlas : public QSGOpenGLAtlasTexture::AtlasBase
+class Atlas : public QSGRhiAtlasTexture::AtlasBase
{
public:
- Atlas(const QSize &size, uint format);
+ Atlas(QSGDefaultRenderContext *rc, const QSize &size, uint format);
~Atlas();
- void generateTexture() override;
- void uploadPendingTexture(int i) override;
+ bool generateTexture() override;
+ void enqueueTextureUpload(QSGRhiAtlasTexture::TextureBase *t,
+ QRhiResourceUpdateBatch *rcub) override;
- Texture *create(const QByteArray &data, int dataLength, int dataOffset, const QSize &size, const QSize &paddedSize);
+ Texture *create(const QByteArray &data, int dataLength, int dataOffset, const QSize &size);
uint format() const { return m_format; }
@@ -84,7 +83,7 @@ private:
uint m_format;
};
-class Texture : public QSGOpenGLAtlasTexture::TextureBase
+class Texture : public QSGRhiAtlasTexture::TextureBase
{
Q_OBJECT
public: