From b74db90be055904c43953695e51b216100de71bb Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 17 Feb 2023 16:59:45 +0100 Subject: [PATCH] rhi: Make the mip size helpers static Change-Id: Ibe480330290ccddeac0a62b52a8a33c3399cb5bc Reviewed-by: Andy Nichols --- src/gui/rhi/qrhi.cpp | 4 ++-- src/gui/rhi/qrhi_p.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 6723d3e5a3..567e06405d 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -6946,7 +6946,7 @@ int QRhi::ubufAligned(int v) const /*! \return the number of mip levels for a given \a size. */ -int QRhi::mipLevelsForSize(const QSize &size) const +int QRhi::mipLevelsForSize(const QSize &size) { return qFloor(std::log2(qMax(size.width(), size.height()))) + 1; } @@ -6955,7 +6955,7 @@ int QRhi::mipLevelsForSize(const QSize &size) const \return the texture image size for a given \a mipLevel, calculated based on the level 0 size given in \a baseLevelSize. */ -QSize QRhi::sizeForMipLevel(int mipLevel, const QSize &baseLevelSize) const +QSize QRhi::sizeForMipLevel(int mipLevel, const QSize &baseLevelSize) { const int w = qMax(1, baseLevelSize.width() >> mipLevel); const int h = qMax(1, baseLevelSize.height() >> mipLevel); diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index e254eafd2e..cc94c3b9d8 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -1804,8 +1804,8 @@ public: int ubufAlignment() const; int ubufAligned(int v) const; - int mipLevelsForSize(const QSize &size) const; - QSize sizeForMipLevel(int mipLevel, const QSize &baseLevelSize) const; + static int mipLevelsForSize(const QSize &size); + static QSize sizeForMipLevel(int mipLevel, const QSize &baseLevelSize); bool isYUpInFramebuffer() const; bool isYUpInNDC() const;