From 1c2dd60502abefbfc00e2515cbbee96a07589030 Mon Sep 17 00:00:00 2001 From: Zhou Zhenglong Date: Wed, 16 Oct 2024 13:04:20 +0800 Subject: [PATCH] rename --- native/cocos/renderer/gfx-base/GFXDef.cpp | 2 +- native/cocos/renderer/gfx-base/GFXSamplerUtils.h | 4 ++-- native/cocos/renderer/gfx-base/states/GFXSampler.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/native/cocos/renderer/gfx-base/GFXDef.cpp b/native/cocos/renderer/gfx-base/GFXDef.cpp index 02703daec9c..675d6ff5b86 100644 --- a/native/cocos/renderer/gfx-base/GFXDef.cpp +++ b/native/cocos/renderer/gfx-base/GFXDef.cpp @@ -204,7 +204,7 @@ bool operator==(const BufferInfo &lhs, const BufferInfo &rhs) { template <> ccstd::hash_t Hasher::operator()(const SamplerInfo &info) const { - return static_cast(compressSamplerInfo(info)); + return static_cast(packSamplerInfo(info)); } bool operator==(const SamplerInfo &lhs, const SamplerInfo &rhs) { diff --git a/native/cocos/renderer/gfx-base/GFXSamplerUtils.h b/native/cocos/renderer/gfx-base/GFXSamplerUtils.h index 4d17faff9eb..d8827a9924c 100644 --- a/native/cocos/renderer/gfx-base/GFXSamplerUtils.h +++ b/native/cocos/renderer/gfx-base/GFXSamplerUtils.h @@ -28,7 +28,7 @@ namespace cc { namespace gfx { -constexpr uint32_t compressSamplerInfo(const SamplerInfo &info) noexcept { +constexpr uint32_t packSamplerInfo(const SamplerInfo &info) noexcept { CC_ASSERT(static_cast(info.minFilter) < (1 << 2)); CC_ASSERT(static_cast(info.magFilter) < (1 << 2)); CC_ASSERT(static_cast(info.mipFilter) < (1 << 2)); @@ -49,7 +49,7 @@ constexpr uint32_t compressSamplerInfo(const SamplerInfo &info) noexcept { return packed; } -constexpr SamplerInfo uncompressSamplerInfo(const uint32_t packed) noexcept { +constexpr SamplerInfo unpackSamplerInfo(const uint32_t packed) noexcept { SamplerInfo info{}; info.minFilter = static_cast(packed & ((1 << 2) - 1)); info.magFilter = static_cast((packed >> 2) & ((1 << 2) - 1)); diff --git a/native/cocos/renderer/gfx-base/states/GFXSampler.cpp b/native/cocos/renderer/gfx-base/states/GFXSampler.cpp index 2ce721d45ee..88c294b6997 100644 --- a/native/cocos/renderer/gfx-base/states/GFXSampler.cpp +++ b/native/cocos/renderer/gfx-base/states/GFXSampler.cpp @@ -39,14 +39,14 @@ ccstd::hash_t Sampler::computeHash(const SamplerInfo &info) { } SamplerInfo Sampler::unpackFromHash(ccstd::hash_t hash) { - return uncompressSamplerInfo(hash); + return unpackSamplerInfo(hash); } namespace { constexpr bool testSamplerInfo(const SamplerInfo &info) { - const uint32_t packed = compressSamplerInfo(info); - const SamplerInfo unpacked = uncompressSamplerInfo(packed); + const uint32_t packed = packSamplerInfo(info); + const SamplerInfo unpacked = unpackSamplerInfo(packed); return info.minFilter == unpacked.minFilter && info.magFilter == unpacked.magFilter &&