move position of GetMipLevel functions.

This commit is contained in:
hyzboy 2020-10-25 15:07:41 +08:00
parent 2c5fd977f2
commit 7f71b50316
3 changed files with 11 additions and 16 deletions

2
CMCore

@ -1 +1 @@
Subproject commit 180228d46a44b76468840dfdf54672a85ecddba7
Subproject commit 0f3ef7ff3fad57b6a61d9700fe707ad0a97c844e

View File

@ -87,6 +87,16 @@ enum ImageTiling
Linear
};//
inline const uint32_t GetMipLevel(const VkExtent2D &ext)
{
return hgl::GetMipLevel(ext.width,ext.height);
}
inline const uint32_t GetMipLevel(const VkExtent3D &ext)
{
return hgl::GetMipLevel(ext.width,ext.height,ext.depth);
}
enum IndexType
{
U16=0,

View File

@ -10,21 +10,6 @@
VK_NAMESPACE_BEGIN
namespace
{
const uint32_t GetMipLevel(const uint32_t size)
{
return static_cast<uint32_t>(std::floor(std::log2(size)))+1;
}
const uint32_t GetMipLevel(const VkExtent2D &ext)
{
return GetMipLevel(std::max(ext.width,ext.height));
}
const uint32_t GetMipLevel(const VkExtent3D &ext)
{
return GetMipLevel(std::max(std::max(ext.width,ext.height),ext.depth));
}
void GenerateMipmaps(GPUCmdBuffer *texture_cmd_buf,VkImage image,VkImageAspectFlags aspect_mask,const int32_t width,const int32_t height,const uint32_t mipLevels)
{
//VkImage image, VkFormat imageFormat, int32_t texWidth, int32_t texHeight, uint32_t mipLevels) {