From 074cb9cc19e26a59b36b2b4c8109f45636a2546f Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 10 Jan 2022 20:29:55 +0800 Subject: [PATCH] used newly ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR --- inc/hgl/graph/VK.h | 3 +-- src/SceneGraph/Vulkan/VKDeviceMaterial.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/inc/hgl/graph/VK.h b/inc/hgl/graph/VK.h index 5e2a40ab..e4146684 100644 --- a/inc/hgl/graph/VK.h +++ b/inc/hgl/graph/VK.h @@ -92,8 +92,7 @@ constexpr char *DescriptSetsTypeName[]= inline const char *GetDescriptorSetsTypeName(const enum class DescriptorSetsType &type) { - if(!ENUM_CLASS_RANGE_CHECK(DescriptorSetsType,type)) - return nullptr; + ENUM_CLASS_RANGE_ERROR_RETURN_NULLPTR(type); return DescriptSetsTypeName[(size_t)type]; } diff --git a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp index d8d182b2..2ac6c18e 100644 --- a/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp +++ b/src/SceneGraph/Vulkan/VKDeviceMaterial.cpp @@ -10,7 +10,7 @@ VK_NAMESPACE_BEGIN 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)];