summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-08-26 08:09:15 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2020-08-27 08:16:43 +0000
commit3ecd811d1f466130c7a3eede7cee1fee70a94cd7 (patch)
treec7595f3c1b2aac677a08ab81013371b55aab5e91 /src/gui
parent99280f4ee9ad03412578147d0da0c6630ecc324c (diff)
Manually initialize TextureOp and BufferOp structs
As a workaround for broken compilers, this reverts commit 66876da1fd18a037c613639a552001ee87e68a7a and implements the initialization explicitly instead. Task-number: QTBUG-86210 Pick-to: 5.15.1 Change-Id: I0190c7bf90d52448d25f74f8abac40824b23a59c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/rhi/qrhi_p_p.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/gui/rhi/qrhi_p_p.h b/src/gui/rhi/qrhi_p_p.h
index 4ae8de9bd8..206b31356d 100644
--- a/src/gui/rhi/qrhi_p_p.h
+++ b/src/gui/rhi/qrhi_p_p.h
@@ -291,27 +291,31 @@ public:
static BufferOp dynamicUpdate(QRhiBuffer *buf, int offset, int size, const void *data)
{
- BufferOp op = {};
+ BufferOp op;
op.type = DynamicUpdate;
op.buf = buf;
op.offset = offset;
op.data = QByteArray(reinterpret_cast<const char *>(data), size ? size : buf->size());
+ op.readSize = 0;
+ op.result = nullptr;
return op;
}
static BufferOp staticUpload(QRhiBuffer *buf, int offset, int size, const void *data)
{
- BufferOp op = {};
+ BufferOp op;
op.type = StaticUpload;
op.buf = buf;
op.offset = offset;
op.data = QByteArray(reinterpret_cast<const char *>(data), size ? size : buf->size());
+ op.readSize = 0;
+ op.result = nullptr;
return op;
}
static BufferOp read(QRhiBuffer *buf, int offset, int size, QRhiBufferReadbackResult *result)
{
- BufferOp op = {};
+ BufferOp op;
op.type = Read;
op.buf = buf;
op.offset = offset;
@@ -343,38 +347,48 @@ public:
static TextureOp upload(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
{
- TextureOp op = {};
+ TextureOp op;
op.type = Upload;
op.dst = tex;
for (auto it = desc.cbeginEntries(), itEnd = desc.cendEntries(); it != itEnd; ++it)
op.subresDesc[it->layer()][it->level()].append(it->description());
+ op.src = nullptr;
+ op.result = nullptr;
+ op.layer = 0;
return op;
}
static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
{
- TextureOp op = {};
+ TextureOp op;
op.type = Copy;
op.dst = dst;
op.src = src;
op.desc = desc;
+ op.result = nullptr;
+ op.layer = 0;
return op;
}
static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
{
- TextureOp op = {};
+ TextureOp op;
op.type = Read;
+ op.dst = nullptr;
+ op.src = nullptr;
op.rb = rb;
op.result = result;
+ op.layer = 0;
return op;
}
static TextureOp genMips(QRhiTexture *tex, int layer)
{
- TextureOp op = {};
+ TextureOp op;
op.type = GenMips;
op.dst = tex;
+ op.src = nullptr;
+ op.result = nullptr;
op.layer = layer;
return op;
}