vk: Code improvements

This commit is contained in:
kd-11 2025-06-22 14:43:38 +03:00
parent a58efda3b2
commit 759e32745c
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);
}
#define IS_DIGIT(x) (x >= '0' && x <= '9')
constexpr int max_index_length = 2;
const int name_length = static_cast<int>(name.length());
std::string index;
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];
}
}
#undef IS_DIGIT
if (index.empty())
{
fmt::throw_exception("Invalid texture name: '%s'", name);

View file

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