diff --git a/CMCore b/CMCore index 180228d4..0f3ef7ff 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit 180228d46a44b76468840dfdf54672a85ecddba7 +Subproject commit 0f3ef7ff3fad57b6a61d9700fe707ad0a97c844e diff --git a/inc/hgl/graph/VK.h b/inc/hgl/graph/VK.h index 95bc946f..220eeb17 100644 --- a/inc/hgl/graph/VK.h +++ b/inc/hgl/graph/VK.h @@ -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, diff --git a/src/RenderDevice/VKDeviceTexture.cpp b/src/RenderDevice/VKDeviceTexture.cpp index cd15265e..a8e97a71 100644 --- a/src/RenderDevice/VKDeviceTexture.cpp +++ b/src/RenderDevice/VKDeviceTexture.cpp @@ -10,21 +10,6 @@ VK_NAMESPACE_BEGIN namespace { - const uint32_t GetMipLevel(const uint32_t size) - { - return static_cast(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) {