Use new Vulkan-Headers repository. Don't generate createReturnValue function call if the return type is void. (#335)

This commit is contained in:
Markus Tavenrath 2019-06-06 13:13:38 +02:00 committed by GitHub
parent d2a1056a56
commit 50e0a941e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 58358 deletions

6
.gitmodules vendored
View File

@ -7,6 +7,6 @@
[submodule "tinyxml2"]
path = tinyxml2
url = https://github.com/leethomason/tinyxml2.git
[submodule "Vulkan-Docs"]
path = Vulkan-Docs
url = https://github.com/KhronosGroup/Vulkan-Docs.git
[submodule "Vulkan-Headers"]
path = Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git

View File

@ -33,4 +33,4 @@ script:
- echo " vk::Result result = vk::createInstance(&inst_info, nullptr, &inst);" >> /tmp/test.cpp
- echo "}" >> /tmp/test.cpp
- cat /tmp/test.cpp
- ${CXX} -std=c++11 -Ivulkan -IVulkan-Docs/include -c /tmp/test.cpp
- ${CXX} -std=c++11 -Ivulkan -IVulkan-Headers/include -c /tmp/test.cpp

View File

@ -36,11 +36,11 @@ else(MSVC)
add_compile_options(-Wall)
endif(MSVC)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Docs/xml/vk.xml vk_spec)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/registry/vk.xml vk_spec)
string(REPLACE "\\" "\\\\" vk_spec ${vk_spec})
add_definitions(-DVK_SPEC="${vk_spec}")
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/vulkan/vulkan.hpp vulkan_hpp)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/include/vulkan.hpp vulkan_hpp)
string(REPLACE "\\" "\\\\" vulkan_hpp ${vulkan_hpp})
add_definitions(-DVULKAN_HPP_FILE="${vulkan_hpp}")

@ -1 +0,0 @@
Subproject commit 6635a81b5b9dea234faf967d54abf7241db371c9

1
Vulkan-Headers Submodule

@ -0,0 +1 @@
Subproject commit 097a1045098213919fd56442f52c716fc78eeb27

View File

@ -2651,6 +2651,7 @@ void VulkanHppGenerator::writeFunctionBodyEnhanced(std::ostream & os, std::strin
if ((commandData.second.returnType == "VkResult") || !commandData.second.successCodes.empty())
{
writeFunctionBodyEnhancedReturnResultValue(os, indentation, returnName, commandName, commandData, returnParamIndex, twoStep, singular, unique);
}
else if ((returnParamIndex != INVALID_INDEX) && (stripPrefix(commandData.second.returnType, "Vk") != enhancedReturnType))
@ -2795,6 +2796,11 @@ void VulkanHppGenerator::writeFunctionBodyEnhancedReturnResultValue(std::ostream
std::string type = (returnParamIndex != INVALID_INDEX) ? commandData.second.params[returnParamIndex].type.type : "";
std::string returnVectorName = (returnParamIndex != INVALID_INDEX) ? stripPostfix(stripPrefix(commandData.second.params[returnParamIndex].name, "p"), "s") : "";
if (commandData.second.returnType == "void") {
std::cerr << "warning: skipping writeFunctionBodyEnhancedReturnResultValue for function " << commandName << " because the returnType is void";
return;
}
assert(m_commandToHandle.find(commandData.first) != m_commandToHandle.end());
std::string const& handle = m_commandToHandle.find(commandData.first)->second;

View File

@ -29,7 +29,7 @@ endif()
FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*)
if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Docs/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
else()
include_directories("${Vulkan_INCLUDE_DIRS}")

View File

@ -29,7 +29,7 @@ endif()
FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*)
if (TESTS_BUILD_WITH_LOCAL_VULKAN_HPP)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Docs/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
else()
include_directories("${Vulkan_INCLUDE_DIRS}")

File diff suppressed because it is too large Load Diff