mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Add an error check on functions returning VkResult but not specifying success codes. (#262)
This commit is contained in:
parent
38fd14d13c
commit
605ff24487
@ -1415,6 +1415,18 @@ bool VulkanHppGenerator::containsUnion(std::string const& type, std::map<std::st
|
||||
return found;
|
||||
}
|
||||
|
||||
void VulkanHppGenerator::checkCorrectness()
|
||||
{
|
||||
for (auto command : m_commands)
|
||||
{
|
||||
// check that functions returning a VkResult specify successcodes
|
||||
if ((command.second.unchangedReturnType == "VkResult") && command.second.successCodes.empty())
|
||||
{
|
||||
throw std::runtime_error("Spec error on command Vk" + startUpperCase(command.first) + " : missing successcodes on command returning VkResult!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> VulkanHppGenerator::createDefaults()
|
||||
{
|
||||
std::map<std::string, std::string> defaultValues;
|
||||
@ -5219,6 +5231,7 @@ int main( int argc, char **argv )
|
||||
}
|
||||
}
|
||||
|
||||
generator.checkCorrectness();
|
||||
generator.sortDependencies();
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
|
@ -30,6 +30,7 @@ class VulkanHppGenerator
|
||||
m_handles.insert(std::make_pair("", HandleData())); // insert the default "handle" without class (for createInstance, and such)
|
||||
}
|
||||
|
||||
void checkCorrectness();
|
||||
std::map<std::string, std::string> createDefaults();
|
||||
std::string const& getTypesafeCheck() const;
|
||||
std::string const& getVersion() const;
|
||||
|
Loading…
Reference in New Issue
Block a user