mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
vulkan: simplify code slightly
This commit is contained in:
@@ -178,24 +178,17 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t getFreeBinding() {
|
uint32_t getFreeBinding()
|
||||||
|
{
|
||||||
for (uint32_t i = 0;; i++)
|
for (uint32_t i = 0;; i++)
|
||||||
{
|
{
|
||||||
bool free = true;
|
if (isFreeBinding(i))
|
||||||
for (const auto &entry : bindingMappings)
|
|
||||||
{
|
|
||||||
if (entry.second == i)
|
|
||||||
{
|
|
||||||
free = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (free)
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isFreeBinding(uint32_t binding) {
|
bool isFreeBinding(uint32_t binding)
|
||||||
|
{
|
||||||
for (const auto &entry : bindingMappings)
|
for (const auto &entry : bindingMappings)
|
||||||
{
|
{
|
||||||
if (entry.second == binding)
|
if (entry.second == binding)
|
||||||
@@ -218,8 +211,8 @@ static VkShaderStageFlagBits getStageBit(ShaderStageType type)
|
|||||||
return VK_SHADER_STAGE_FRAGMENT_BIT;
|
return VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
case SHADERSTAGE_COMPUTE:
|
case SHADERSTAGE_COMPUTE:
|
||||||
return VK_SHADER_STAGE_COMPUTE_BIT;
|
return VK_SHADER_STAGE_COMPUTE_BIT;
|
||||||
default:
|
default:
|
||||||
throw love::Exception("invalid type");
|
throw love::Exception("invalid type");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user