Browse Source

Vk: reorder test cases to match call order.

pull/168/merge
Vladimír Vondruš 2 years ago
parent
commit
26d74d7bab
  1. 36
      src/Magnum/Vk/Test/DescriptorPoolVkTest.cpp

36
src/Magnum/Vk/Test/DescriptorPoolVkTest.cpp

@ -247,6 +247,24 @@ void DescriptorPoolVkTest::allocateVariableCount() {
}
}
void DescriptorPoolVkTest::allocateVariableCountFreeDescriptorSet() {
if(!(_deviceVariableDescriptorCount.enabledFeatures() & DeviceFeature::DescriptorBindingVariableDescriptorCount))
CORRADE_SKIP("DeviceFeature::DescriptorBindingVariableDescriptorCount not supported, can't test.");
DescriptorSetLayout layout{_deviceVariableDescriptorCount, DescriptorSetLayoutCreateInfo{
{{0, DescriptorType::UniformBuffer, 4, ~ShaderStages{}, DescriptorSetLayoutBinding::Flag::VariableDescriptorCount}}
}};
DescriptorPool pool{_deviceVariableDescriptorCount, DescriptorPoolCreateInfo{1, {
{DescriptorType::UniformBuffer, 4}
}, DescriptorPoolCreateInfo::Flag::FreeDescriptorSet}};
DescriptorSet allocated = pool.allocate(layout, 4);
CORRADE_VERIFY(allocated.handle());
/* vkFreeDescriptorSets() gets called on destruction */
CORRADE_COMPARE(allocated.handleFlags(), HandleFlag::DestroyOnDestruction);
}
void DescriptorPoolVkTest::allocateVariableCountFail() {
if(!(_deviceVariableDescriptorCount.enabledFeatures() & DeviceFeature::DescriptorBindingVariableDescriptorCount))
CORRADE_SKIP("DeviceFeature::DescriptorBindingVariableDescriptorCount not supported, can't test.");
@ -277,24 +295,6 @@ void DescriptorPoolVkTest::allocateVariableCountFail() {
}
}
void DescriptorPoolVkTest::allocateVariableCountFreeDescriptorSet() {
if(!(_deviceVariableDescriptorCount.enabledFeatures() & DeviceFeature::DescriptorBindingVariableDescriptorCount))
CORRADE_SKIP("DeviceFeature::DescriptorBindingVariableDescriptorCount not supported, can't test.");
DescriptorSetLayout layout{_deviceVariableDescriptorCount, DescriptorSetLayoutCreateInfo{
{{0, DescriptorType::UniformBuffer, 4, ~ShaderStages{}, DescriptorSetLayoutBinding::Flag::VariableDescriptorCount}}
}};
DescriptorPool pool{_deviceVariableDescriptorCount, DescriptorPoolCreateInfo{1, {
{DescriptorType::UniformBuffer, 4}
}, DescriptorPoolCreateInfo::Flag::FreeDescriptorSet}};
DescriptorSet allocated = pool.allocate(layout, 4);
CORRADE_VERIFY(allocated.handle());
/* vkFreeDescriptorSets() gets called on destruction */
CORRADE_COMPARE(allocated.handleFlags(), HandleFlag::DestroyOnDestruction);
}
void DescriptorPoolVkTest::reset() {
DescriptorSetLayout layout{device(), DescriptorSetLayoutCreateInfo{
{{0, DescriptorType::UniformBuffer}}

Loading…
Cancel
Save