Fixed pNext chain setup function and added validation flags/enables to run_tests

This commit is contained in:
Charles Giessen 2020-02-17 14:09:40 -07:00
parent fb3a7c4689
commit b171ced11e
2 changed files with 15 additions and 12 deletions

View File

@ -148,14 +148,13 @@ bool check_extensions_supported (std::vector<const char*> extension_names) {
} }
template <typename T> template <typename T>
void setup_pNext_chain (T& structure, std::vector<VkBaseOutStructure*>& structs) { void setup_pNext_chain (T& structure, std::vector<VkBaseOutStructure*> const& structs) {
structure.pNext = nullptr; structure.pNext = nullptr;
if (structs.size () <= 0) return; if (structs.size () <= 0) return;
for (int i = 0; i < structs.size () - 1; i++) { for (int i = 0; i < structs.size () - 1; i++) {
VkBaseOutStructure* cur = reinterpret_cast<VkBaseOutStructure*> (&structs[i]); structs.at (i)->pNext = structs.at (i + 1);
cur = reinterpret_cast<VkBaseOutStructure*> (&structs[i + 1]);
} }
structure.pNext = &structs.at (0); structure.pNext = structs.at (0);
} }
} // namespace detail } // namespace detail

View File

@ -69,13 +69,17 @@ int test_instance_headless () {
vkb::InstanceBuilder builder; vkb::InstanceBuilder builder;
auto instance_ret = builder.setup_validation_layers () auto instance_ret =
builder.setup_validation_layers ()
.set_headless () .set_headless ()
.set_app_version (4, 5, 6) .set_app_version (4, 5, 6)
.set_app_name ("headless") .set_app_name ("headless")
.set_engine_name ("nick") .set_engine_name ("nick")
.set_api_version (1, 0, 34) .set_api_version (1, 0, 34)
.set_default_debug_messenger () .set_default_debug_messenger ()
.add_validation_feature_enable (VkValidationFeatureEnableEXT::VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT)
.add_validation_feature_disable (VkValidationFeatureDisableEXT::VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT)
.add_validation_disable (VkValidationCheckEXT::VK_VALIDATION_CHECK_SHADERS_EXT)
.build (); .build ();
if (!instance_ret.has_value ()) { if (!instance_ret.has_value ()) {
return 1; return 1;