move position of GetMipLevel functions.
This commit is contained in:
parent
2c5fd977f2
commit
7f71b50316
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit 180228d46a44b76468840dfdf54672a85ecddba7
|
Subproject commit 0f3ef7ff3fad57b6a61d9700fe707ad0a97c844e
|
@ -87,6 +87,16 @@ enum ImageTiling
|
|||||||
Linear
|
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
|
enum IndexType
|
||||||
{
|
{
|
||||||
U16=0,
|
U16=0,
|
||||||
|
@ -10,21 +10,6 @@
|
|||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
namespace
|
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)
|
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) {
|
//VkImage image, VkFormat imageFormat, int32_t texWidth, int32_t texHeight, uint32_t mipLevels) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user