summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-05-14 08:56:02 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-05-15 04:59:20 +0200
commit6f34c0c650d3309fdda4a3be5424c4082f1f531c (patch)
tree219928b65c2a649d9ed2aafea815f962e0459340 /src
parent7bee4e9cb3750be4573e1872f52023081b014500 (diff)
downloadqtbase-6f34c0c650d3309fdda4a3be5424c4082f1f531c.tar.gz
Initialize TextureOp and BufferOp structs
Fixes Coverity warnings, and avoids hard-to-debug errors, at minimal overhead. Change-Id: I3ff530a9263693d1123932458b3e186e79a14b7e Coverity-Id: 263692 Coverity-Id: 263693 Coverity-Id: 263699 Coverity-Id: 263700 Coverity-Id: 263702 Coverity-Id: 263705 Pick-to: 5.15 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/rhi/qrhi_p_p.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/rhi/qrhi_p_p.h b/src/gui/rhi/qrhi_p_p.h
index cf725632f4..1706ab131c 100644
--- a/src/gui/rhi/qrhi_p_p.h
+++ b/src/gui/rhi/qrhi_p_p.h
@@ -292,7 +292,7 @@ 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;
@@ -302,7 +302,7 @@ public:
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;
@@ -312,7 +312,7 @@ public:
static BufferOp read(QRhiBuffer *buf, int offset, int size, QRhiBufferReadbackResult *result)
{
- BufferOp op;
+ BufferOp op = {};
op.type = Read;
op.buf = buf;
op.offset = offset;
@@ -344,7 +344,7 @@ 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)
@@ -354,7 +354,7 @@ public:
static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
{
- TextureOp op;
+ TextureOp op = {};
op.type = Copy;
op.dst = dst;
op.src = src;
@@ -364,7 +364,7 @@ public:
static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
{
- TextureOp op;
+ TextureOp op = {};
op.type = Read;
op.rb = rb;
op.result = result;
@@ -373,7 +373,7 @@ public:
static TextureOp genMips(QRhiTexture *tex, int layer)
{
- TextureOp op;
+ TextureOp op = {};
op.type = GenMips;
op.dst = tex;
op.layer = layer;