From 7ccd2d02463f8076631bc45e5bf1386c61037dc7 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 3 Feb 2021 18:07:47 +0100 Subject: rhi: Add support for custom bytes-per-line for uncompressed raw data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-90770 Change-Id: Icba328c417bcce256e7b44f1d540af7f8e83376b Reviewed-by: Qt CI Bot Reviewed-by: Christian Strømme --- src/gui/rhi/qrhid3d11.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gui/rhi/qrhid3d11.cpp') diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 3e0ba0820b..addb058d4d 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -542,6 +542,8 @@ bool QRhiD3D11::isFeatureSupported(QRhi::Feature feature) const return true; case QRhi::PipelineCacheDataLoadSave: return false; + case QRhi::ImageDataStride: + return true; default: Q_UNREACHABLE(); return false; @@ -1401,7 +1403,10 @@ void QRhiD3D11::enqueueSubresUpload(QD3D11Texture *texD, QD3D11CommandBuffer *cb const QSize size = subresDesc.sourceSize().isEmpty() ? q->sizeForMipLevel(level, texD->m_pixelSize) : subresDesc.sourceSize(); quint32 bpl = 0; - textureFormatInfo(texD->m_format, size, &bpl, nullptr); + if (subresDesc.dataStride()) + bpl = subresDesc.dataStride(); + else + textureFormatInfo(texD->m_format, size, &bpl, nullptr, nullptr); box.left = UINT(dp.x()); box.top = UINT(dp.y()); box.right = UINT(dp.x() + size.width()); @@ -1577,7 +1582,7 @@ void QRhiD3D11::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate } quint32 byteSize = 0; quint32 bpl = 0; - textureFormatInfo(format, pixelSize, &bpl, &byteSize); + textureFormatInfo(format, pixelSize, &bpl, &byteSize, nullptr); D3D11_TEXTURE2D_DESC desc; memset(&desc, 0, sizeof(desc)); -- cgit v1.2.3