spec: rewrite header generator to use Khronos repo directly

This commit is contained in:
Danny Robson 2018-06-11 14:55:49 +10:00
parent 8f0970be5d
commit 751967619b
8 changed files with 542 additions and 465 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "specs"]
path = specs
url = https://github.com/KhronosGroup/Vulkan-Docs.git

View File

@ -27,13 +27,15 @@ COMMENT
COMMAND COMMAND
"${PYTHON_EXECUTABLE}" "${PYTHON_EXECUTABLE}"
"${CMAKE_CURRENT_SOURCE_DIR}/tools/spec.py" "${CMAKE_CURRENT_SOURCE_DIR}/tools/spec.py"
"${CMAKE_CURRENT_SOURCE_DIR}/vk.xml" "${CMAKE_CURRENT_SOURCE_DIR}/specs/xml/vk.xml"
"${CMAKE_CURRENT_BINARY_DIR}/vk.hpp" "${CMAKE_CURRENT_BINARY_DIR}/vk.hpp"
DEPENDS DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/tools/spec.py" "${CMAKE_CURRENT_SOURCE_DIR}/tools/spec.py"
"${CMAKE_CURRENT_SOURCE_DIR}/vk.xml" "${CMAKE_CURRENT_SOURCE_DIR}/specs/xml/vk.xml"
) )
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/specs/include/vulkan")
##----------------------------------------------------------------------------- ##-----------------------------------------------------------------------------
list (APPEND sources list (APPEND sources

View File

@ -53,7 +53,9 @@ using cruft::vk::error_code;
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, \ VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, \
VK_ERROR_OUT_OF_POOL_MEMORY_KHR, \ VK_ERROR_OUT_OF_POOL_MEMORY_KHR, \
VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR, \ VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR, \
VK_ERROR_INVALID_SHADER_NV) VK_ERROR_INVALID_SHADER_NV, \
VK_ERROR_FRAGMENTATION_EXT, \
VK_ERROR_NOT_PERMITTED_EXT)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -87,6 +89,8 @@ to_string (VkResult res)
// EXT // EXT
case VK_ERROR_VALIDATION_FAILED_EXT: return "validation failed"; case VK_ERROR_VALIDATION_FAILED_EXT: return "validation failed";
case VK_ERROR_FRAGMENTATION_EXT: return "too much fragmentation";
case VK_ERROR_NOT_PERMITTED_EXT: return "not permitted";
// KHR // KHR
case VK_ERROR_SURFACE_LOST_KHR: return "surface lost"; case VK_ERROR_SURFACE_LOST_KHR: return "surface lost";

48
fwd.hpp
View File

@ -18,7 +18,7 @@
#ifndef CRUFT_VK_FWD_HPP #ifndef CRUFT_VK_FWD_HPP
#define CRUFT_VK_FWD_HPP #define CRUFT_VK_FWD_HPP
#include "./vk.hpp" #include "vk.hpp"
#include <cruft/util/preprocessor.hpp> #include <cruft/util/preprocessor.hpp>
@ -176,7 +176,6 @@ namespace cruft::vk {
VkQueryResultFlagBits, \ VkQueryResultFlagBits, \
VkSparseMemoryBindFlagBits, \ VkSparseMemoryBindFlagBits, \
VkValidationCacheHeaderVersionEXT, \ VkValidationCacheHeaderVersionEXT, \
VkDeviceGroupPresentModeFlagBitsKHX, \
VkColorSpaceKHR, \ VkColorSpaceKHR, \
VkPresentModeKHR, \ VkPresentModeKHR, \
VkCommandPoolResetFlagBits, \ VkCommandPoolResetFlagBits, \
@ -199,10 +198,8 @@ namespace cruft::vk {
VkFenceCreateFlagBits, \ VkFenceCreateFlagBits, \
VkDisplayEventTypeEXT, \ VkDisplayEventTypeEXT, \
VkDescriptorPoolCreateFlagBits, \ VkDescriptorPoolCreateFlagBits, \
VkPeerMemoryFeatureFlagBitsKHX, \
VkCoverageModulationModeNV, \ VkCoverageModulationModeNV, \
VkObjectType, \ VkObjectType, \
VkMemoryAllocateFlagBitsKHX, \
VkPipelineCacheHeaderVersion, \ VkPipelineCacheHeaderVersion, \
VkDiscardRectangleModeEXT, \ VkDiscardRectangleModeEXT, \
VkDeviceEventTypeEXT, \ VkDeviceEventTypeEXT, \
@ -220,7 +217,6 @@ namespace cruft::vk {
VkExtent3D, \ VkExtent3D, \
VkViewport, \ VkViewport, \
VkRect2D, \ VkRect2D, \
VkRect3D, \
VkClearRect, \ VkClearRect, \
VkComponentMapping, \ VkComponentMapping, \
VkPhysicalDeviceProperties, \ VkPhysicalDeviceProperties, \
@ -329,12 +325,6 @@ namespace cruft::vk {
VkDisplaySurfaceCreateInfoKHR, \ VkDisplaySurfaceCreateInfoKHR, \
VkDisplayPresentInfoKHR, \ VkDisplayPresentInfoKHR, \
VkSurfaceCapabilitiesKHR, \ VkSurfaceCapabilitiesKHR, \
VkAndroidSurfaceCreateInfoKHR, \
VkMirSurfaceCreateInfoKHR, \
VkViSurfaceCreateInfoNN, \
VkWaylandSurfaceCreateInfoKHR, \
VkWin32SurfaceCreateInfoKHR, \
VkXlibSurfaceCreateInfoKHR, \
VkXcbSurfaceCreateInfoKHR, \ VkXcbSurfaceCreateInfoKHR, \
VkSurfaceFormatKHR, \ VkSurfaceFormatKHR, \
VkSwapchainCreateInfoKHR, \ VkSwapchainCreateInfoKHR, \
@ -351,9 +341,6 @@ namespace cruft::vk {
VkExternalImageFormatPropertiesNV, \ VkExternalImageFormatPropertiesNV, \
VkExternalMemoryImageCreateInfoNV, \ VkExternalMemoryImageCreateInfoNV, \
VkExportMemoryAllocateInfoNV, \ VkExportMemoryAllocateInfoNV, \
VkImportMemoryWin32HandleInfoNV, \
VkExportMemoryWin32HandleInfoNV, \
VkWin32KeyedMutexAcquireReleaseInfoNV, \
VkDeviceGeneratedCommandsFeaturesNVX, \ VkDeviceGeneratedCommandsFeaturesNVX, \
VkDeviceGeneratedCommandsLimitsNVX, \ VkDeviceGeneratedCommandsLimitsNVX, \
VkIndirectCommandsTokenNVX, \ VkIndirectCommandsTokenNVX, \
@ -391,55 +378,24 @@ namespace cruft::vk {
VkExternalMemoryImageCreateInfoKHR, \ VkExternalMemoryImageCreateInfoKHR, \
VkExternalMemoryBufferCreateInfoKHR, \ VkExternalMemoryBufferCreateInfoKHR, \
VkExportMemoryAllocateInfoKHR, \ VkExportMemoryAllocateInfoKHR, \
VkImportMemoryWin32HandleInfoKHR, \
VkExportMemoryWin32HandleInfoKHR, \
VkMemoryWin32HandlePropertiesKHR, \
VkMemoryGetWin32HandleInfoKHR, \
VkImportMemoryFdInfoKHR, \ VkImportMemoryFdInfoKHR, \
VkMemoryFdPropertiesKHR, \ VkMemoryFdPropertiesKHR, \
VkMemoryGetFdInfoKHR, \ VkMemoryGetFdInfoKHR, \
VkWin32KeyedMutexAcquireReleaseInfoKHR, \
VkPhysicalDeviceExternalSemaphoreInfoKHR, \ VkPhysicalDeviceExternalSemaphoreInfoKHR, \
VkExternalSemaphorePropertiesKHR, \ VkExternalSemaphorePropertiesKHR, \
VkExportSemaphoreCreateInfoKHR, \ VkExportSemaphoreCreateInfoKHR, \
VkImportSemaphoreWin32HandleInfoKHR, \
VkExportSemaphoreWin32HandleInfoKHR, \
VkD3D12FenceSubmitInfoKHR, \
VkSemaphoreGetWin32HandleInfoKHR, \
VkImportSemaphoreFdInfoKHR, \ VkImportSemaphoreFdInfoKHR, \
VkSemaphoreGetFdInfoKHR, \ VkSemaphoreGetFdInfoKHR, \
VkPhysicalDeviceExternalFenceInfoKHR, \ VkPhysicalDeviceExternalFenceInfoKHR, \
VkExternalFencePropertiesKHR, \ VkExternalFencePropertiesKHR, \
VkExportFenceCreateInfoKHR, \ VkExportFenceCreateInfoKHR, \
VkImportFenceWin32HandleInfoKHR, \
VkExportFenceWin32HandleInfoKHR, \
VkFenceGetWin32HandleInfoKHR, \
VkImportFenceFdInfoKHR, \ VkImportFenceFdInfoKHR, \
VkFenceGetFdInfoKHR, \ VkFenceGetFdInfoKHR, \
VkPhysicalDeviceMultiviewFeaturesKHX, \
VkPhysicalDeviceMultiviewPropertiesKHX, \
VkRenderPassMultiviewCreateInfoKHX, \
VkSurfaceCapabilities2EXT, \ VkSurfaceCapabilities2EXT, \
VkDisplayPowerInfoEXT, \ VkDisplayPowerInfoEXT, \
VkDeviceEventInfoEXT, \ VkDeviceEventInfoEXT, \
VkDisplayEventInfoEXT, \ VkDisplayEventInfoEXT, \
VkSwapchainCounterCreateInfoEXT, \ VkSwapchainCounterCreateInfoEXT, \
VkPhysicalDeviceGroupPropertiesKHX, \
VkMemoryAllocateFlagsInfoKHX, \
VkBindBufferMemoryInfoKHX, \
VkBindImageMemoryInfoKHX, \
VkDeviceGroupRenderPassBeginInfoKHX, \
VkDeviceGroupCommandBufferBeginInfoKHX, \
VkDeviceGroupSubmitInfoKHX, \
VkDeviceGroupBindSparseInfoKHX, \
VkDeviceGroupPresentCapabilitiesKHX, \
VkImageSwapchainCreateInfoKHX, \
VkBindImageMemorySwapchainInfoKHX, \
VkAcquireNextImageInfoKHX, \
VkDeviceGroupPresentInfoKHX, \
VkDeviceGroupDeviceCreateInfoKHX, \
VkDeviceGroupSwapchainCreateInfoKHX, \
VkDescriptorUpdateTemplateEntryKHR, \
VkDescriptorUpdateTemplateCreateInfoKHR, \ VkDescriptorUpdateTemplateCreateInfoKHR, \
VkXYColorEXT, \ VkXYColorEXT, \
VkHdrMetadataEXT, \ VkHdrMetadataEXT, \
@ -447,8 +403,6 @@ namespace cruft::vk {
VkPastPresentationTimingGOOGLE, \ VkPastPresentationTimingGOOGLE, \
VkPresentTimesInfoGOOGLE, \ VkPresentTimesInfoGOOGLE, \
VkPresentTimeGOOGLE, \ VkPresentTimeGOOGLE, \
VkIOSSurfaceCreateInfoMVK, \
VkMacOSSurfaceCreateInfoMVK, \
VkViewportWScalingNV, \ VkViewportWScalingNV, \
VkPipelineViewportWScalingStateCreateInfoNV, \ VkPipelineViewportWScalingStateCreateInfoNV, \
VkViewportSwizzleNV, \ VkViewportSwizzleNV, \

View File

@ -15,13 +15,15 @@
* 2017, Danny Robson <danny@nerdcruft.net> * 2017, Danny Robson <danny@nerdcruft.net>
*/ */
#include "./ostream.hpp" #include "ostream.hpp"
#include "./instance.hpp" #include "instance.hpp"
#include "./physical_device.hpp" #include "physical_device.hpp"
#include <cruft/util/iterator.hpp>
#include <iomanip> #include <iomanip>
#include <cruft/util/iterator.hpp> #include <ostream>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -40,6 +42,7 @@ operator<< (std::ostream &os, VkExtent3D val)
} }
#if 0
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
std::ostream& std::ostream&
operator<< (std::ostream &os, VkQueueFlags val) operator<< (std::ostream &os, VkQueueFlags val)
@ -54,6 +57,7 @@ operator<< (std::ostream &os, VkQueueFlags val)
return os << "[ " << util::make_infix (util::make_view (names, names + cursor)) << " ]"; return os << "[ " << util::make_infix (util::make_view (names, names + cursor)) << " ]";
} }
#endif
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -27,7 +27,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
std::ostream& operator<< (std::ostream&, VkQueueFlags); //std::ostream& operator<< (std::ostream&, VkQueueFlags);
std::ostream& operator<< (std::ostream&, VkExtent2D); std::ostream& operator<< (std::ostream&, VkExtent2D);
std::ostream& operator<< (std::ostream&, VkExtent3D); std::ostream& operator<< (std::ostream&, VkExtent3D);
std::ostream& operator<< (std::ostream&, VkPhysicalDeviceType); std::ostream& operator<< (std::ostream&, VkPhysicalDeviceType);

1
specs Submodule

@ -0,0 +1 @@
Subproject commit ee13fc355fae06ffcd36ee09a98f12132d95dfc0

941
tools/spec.py Executable file → Normal file

File diff suppressed because it is too large Load Diff