优化函数定义

This commit is contained in:
hyzboy 2019-07-02 21:59:27 +08:00
parent 9b961ffe08
commit d50a70cfb9

View File

@ -76,18 +76,14 @@ public:
return fp;
}
bool IsOptimalTilingFeatures(const VkFormat format,const VkFormatFeatureFlags flag)const
{
if(format<VK_FORMAT_BEGIN_RANGE||format>VK_FORMAT_END_RANGE)
return(false);
return(format_properties[format].optimalTilingFeatures&flag);
}
bool OptimalSupport (const VkFormat format,const VkFormatFeatureFlags flag)const{return((format<VK_FORMAT_BEGIN_RANGE||format>VK_FORMAT_END_RANGE)?false:(format_properties[format].optimalTilingFeatures&flag));}
bool LinearSupport (const VkFormat format,const VkFormatFeatureFlags flag)const{return((format<VK_FORMAT_BEGIN_RANGE||format>VK_FORMAT_END_RANGE)?false:(format_properties[format].linearTilingFeatures&flag));}
bool BufferSupport (const VkFormat format,const VkFormatFeatureFlags flag)const{return((format<VK_FORMAT_BEGIN_RANGE||format>VK_FORMAT_END_RANGE)?false:(format_properties[format].bufferFeatures&flag));}
bool IsColorAttachmentOptimal(const VkFormat format)const{return IsOptimalTilingFeatures(format,VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT);}
bool IsDepthAttachmentOptimal(const VkFormat format)const{return IsOptimalTilingFeatures(format,VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT);}
bool IsColorAttachmentOptimal(const VkFormat format)const{return OptimalSupport(format,VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT);}
bool IsDepthAttachmentOptimal(const VkFormat format)const{return OptimalSupport(format,VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT);}
VkFormat GetDepthFormat(bool lower_to_high=true)const;
VkFormat GetDepthStencilFormat(bool lower_to_high=true)const;
};//class PhysicalDevice
VK_NAMESPACE_END
VK_NAMESPACE_END