vk: Code improvements

This commit is contained in:
kd-11 2025-06-22 14:43:38 +03:00 committed by kd-11
parent 91491c7cf3
commit cdc78f81f7
2 changed files with 2 additions and 6 deletions

View file

@ -43,22 +43,18 @@ namespace vk
fmt::throw_exception("Invalid texture name: '%s'", name); fmt::throw_exception("Invalid texture name: '%s'", name);
} }
#define IS_DIGIT(x) (x >= '0' && x <= '9')
constexpr int max_index_length = 2; constexpr int max_index_length = 2;
const int name_length = static_cast<int>(name.length()); const int name_length = static_cast<int>(name.length());
std::string index; std::string index;
for (int char_idx = name_length - max_index_length; char_idx < name_length; ++char_idx) for (int char_idx = name_length - max_index_length; char_idx < name_length; ++char_idx)
{ {
if (IS_DIGIT(name[char_idx])) if (std::isdigit(name[char_idx]))
{ {
index += name[char_idx]; index += name[char_idx];
} }
} }
#undef IS_DIGIT
if (index.empty()) if (index.empty())
{ {
fmt::throw_exception("Invalid texture name: '%s'", name); fmt::throw_exception("Invalid texture name: '%s'", name);

View file

@ -361,7 +361,7 @@ namespace vk
{ {
if (!set.m_device) if (!set.m_device)
{ {
break; continue;
} }
set.create_descriptor_set_layout(); set.create_descriptor_set_layout();