used newly ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR

This commit is contained in:
hyzboy 2022-01-10 20:29:55 +08:00
parent b6c10dca4a
commit 074cb9cc19
2 changed files with 2 additions and 3 deletions

View File

@ -92,8 +92,7 @@ constexpr char *DescriptSetsTypeName[]=
inline const char *GetDescriptorSetsTypeName(const enum class DescriptorSetsType &type) inline const char *GetDescriptorSetsTypeName(const enum class DescriptorSetsType &type)
{ {
if(!ENUM_CLASS_RANGE_CHECK(DescriptorSetsType,type)) ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(type);
return nullptr;
return DescriptSetsTypeName[(size_t)type]; return DescriptSetsTypeName[(size_t)type];
} }

View File

@ -10,7 +10,7 @@
VK_NAMESPACE_BEGIN VK_NAMESPACE_BEGIN
DescriptorSets *GPUDevice::CreateDescriptorSets(const PipelineLayoutData *pld,const DescriptorSetsType &type)const DescriptorSets *GPUDevice::CreateDescriptorSets(const PipelineLayoutData *pld,const DescriptorSetsType &type)const
{ {
ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(DescriptorSetsType,type); ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(type);
const uint32_t binding_count=pld->binding_count[size_t(type)]; const uint32_t binding_count=pld->binding_count[size_t(type)];