diff options
Diffstat (limited to 'src/gui/rhi/qrhinull.cpp')
-rw-r--r-- | src/gui/rhi/qrhinull.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhinull.cpp b/src/gui/rhi/qrhinull.cpp index 29f3bab8b0..0a25b58b91 100644 --- a/src/gui/rhi/qrhinull.cpp +++ b/src/gui/rhi/qrhinull.cpp @@ -437,12 +437,15 @@ void QRhiNull::simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::Textu // sourceTopLeft is not supported on this path as per QRhi docs const char *src = subresDesc.data().constData(); const int srcBpl = w * 4; + int srcStride = srcBpl; + if (subresDesc.dataStride()) + srcStride = subresDesc.dataStride(); const QPoint dstOffset = subresDesc.destinationTopLeft(); uchar *dst = texD->image[layer][level].bits(); const int dstBpl = texD->image[layer][level].bytesPerLine(); for (int y = 0; y < h; ++y) { memcpy(dst + dstOffset.x() * 4 + (y + dstOffset.y()) * dstBpl, - src + y * srcBpl, + src + y * srcStride, size_t(srcBpl)); } } @@ -516,7 +519,7 @@ void QRhiNull::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *re } quint32 bytesPerLine = 0; quint32 byteSize = 0; - textureFormatInfo(result->format, result->pixelSize, &bytesPerLine, &byteSize); + textureFormatInfo(result->format, result->pixelSize, &bytesPerLine, &byteSize, nullptr); if (texD && texD->format() == QRhiTexture::RGBA8) { result->data.resize(int(byteSize)); const QImage &src(texD->image[u.rb.layer()][u.rb.level()]); |