diff --git a/README.md b/README.md index 7267559..2500b5b 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ Vulkan is a C API and as such inherits all common pitfalls of using a general C Have a look at the following piece of code which creates a VkImage: -
-
+```c++
   VkImageCreateInfo ci;
   ci.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
   ci.pNext = nullptr;
@@ -23,14 +22,13 @@ Have a look at the following piece of code which creates a VkImage:
   ci.pQueueFamilyIndices = 0;
   ci.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
   vkCreateImage(device, &ci, allocator, &image));
-
-
+``` There may be some issues that can happen when filling the structure which cannot be caught at compile time: -* initialization of ci.sType using wrong enum values -* uninitialized data fields (e.g. missing initialization of ci.mipLevels) -* use of invalid bits for ci.flags (no type-safety for bits) +* initialization of ```ci.sType``` using wrong enum values +* uninitialized data fields (e.g. missing initialization of ```ci.mipLevels```) +* use of invalid bits for ```ci.flags``` (no type-safety for bits) * use of incorrect enums for fields (no type-safety for enums) These initializations will most likely show up as random runtime errors, which usually are nasty and time-consuming to debug. @@ -39,17 +37,16 @@ to avoid incorrect or missing initializations and introduces type-safety with s errors into compile errors. Following is a list of features and conventions introduced by our Vulkan C++ layer: * works along the official C version of the API -* defines all symbols within the 'vk' namespace and to avoid redundancy the vk/Vk/VK_ prefixes have been removed from all symbols, i.e. vk::ImageCreateInfo for VkImageCreateInfo. -* camel case syntax with an 'e' prefix has been introduced for all enums, i.e. vk::ImageType::e2D (the prefix was a compromise, more about that later) removes the 'BIT' suffix from all flag related enums, i.e. vk::ImageUsage::eColorAttachment. -* introduces constructors for all structs, which by default set the appropriate sType and all other values to zero. -* encapsulates member variables of the structs with getter and setter functions, i.e. ci.imageType() to get a value and ci.imageType(vk::ImageType::e2D) to set a value. -* introduces wrapper classes around the vulkan handles, i.e. vk::CommandBuffer for VkCommandBuffer -* introduces member functions of those wrapper classes, that map to vulkan functions getting the corresponding vulkan handle as its first argument. The type of that handle is stripped from the function name, i.e. vk::Device::getProcAddr for vkGetDeviceProcAddr. Note the special handling for the class CommandBuffer, where most of the vulkan functions would just include "Cmd", instead of "CommandBuffer", i.e. vk::CommandBuffer::bindPipeline for vkCmdBindPipeline. - +* defines all symbols within the 'vk' namespace and to avoid redundancy the vk/Vk/VK_ prefixes have been removed from all symbols, i.e. ```vk::ImageCreateInfo``` for VkImageCreateInfo. +* camel case syntax with an 'e' prefix has been introduced for all enums, i.e. ```vk::ImageType::e2D``` (the prefix was a compromise, more about that later) removes the 'BIT' suffix from all flag related enums, i.e. ```vk::ImageUsage::eColorAttachment```. +* introduces constructors for all structs, which by default set the appropriate ```sType``` and all other values to zero. +* encapsulates member variables of the structs with getter and setter functions, i.e. ```ci.imageType()``` to get a value and ```ci.imageType(vk::ImageType::e2D)``` to set a value. +* introduces wrapper classes around the vulkan handles, i.e. ```vk::CommandBuffer``` for VkCommandBuffer +* introduces member functions of those wrapper classes, that map to vulkan functions getting the corresponding vulkan handle as its first argument. The type of that handle is stripped from the function name, i.e. ```vk::Device::getProcAddr``` for vkGetDeviceProcAddr. Note the special handling for the class CommandBuffer, where most of the vulkan functions would just include "Cmd", instead of "CommandBuffer", i.e. ```vk::CommandBuffer::bindPipeline``` for vkCmdBindPipeline. With those changes applied, the updated code snippet looks like this: -
-
+
+```c++
 vk::ImageCreateInfo ci;
 ci.flags(...some flags...);
 ci.imageType(vk::ImageType::e2D);
@@ -65,17 +62,16 @@ ci.sharingMode(vk::SharingMode::eExclusive);
   // ci.pQueueFamilyIndices(0)	// no need to set, already initialized
 ci.initialLayout(vk::ImageLayout::eUndefined);
 device.createImage(&ci, allocator, &image);
-
-
+``` Which is a total of 13 lines of code, versus 17 lines for the C version. In addition, this code is more robust as described above. # Type-safe Enums Splitting up the C enums into a namespace and scoped enums resulted in two compilation issues. -First some enums started with a digit like vk::ImageType::1D which resulted in a compilation error. -Second, there's the risk that upper symbols like vk::CompositeAlphaFlagBitsKHR::OPAQUE do clash with preprocessor defines. -In the given example OPAQUE has been defined in win32gdi.h resulting a compilation error. +First some enums started with a digit like ```vk::ImageType::1D``` which resulted in a compilation error. +Second, there's the risk that upper symbols like ```vk::CompositeAlphaFlagBitsKHR::OPAQUE``` do clash with preprocessor defines. +In the given example ```OPAQUE``` has been defined in ```win32gdi.h``` resulting a compilation error. To overcome those two issues the symbols have been converted to camel case and the prefix 'e' has been added so that each enum starts with a letter. @@ -85,37 +81,33 @@ After those changes the code might look more familiar to C++ developers, but the With C++ features available we replaced all Vulkan enums with scoped enums to achieve type safety which already uncovered a few small issues in our code. The good thing with scoped enums is that there is no implicit casts to integer types anymore. The downside is that OR'ing the bits for the flags does not work anymore without an explicit cast. As a solution to this problem -we have introduced a new vk::Flags<T> template which is used for all flags. This class supports the standard +we have introduced a new ```vk::Flags``` template which is used for all flags. This class supports the standard operations one usually needs on bitmasks like &=, |=, & and |. Except for the initialization with 0, which is being replaced by -the default constructor, the vk::Flags<T> class works exactly like a normal bitmask with the improvement that +the default constructor, the ```vk::Flags``` class works exactly like a normal bitmask with the improvement that it is impossible to set bits not specified by the corresponding enum. To generate a bit mask with two bits set write: -
-
+```c++
 ci.usage = vk::ImageUsage::eColorAttachment | vk::ImageUsage::eStorage;
-
-
+``` -By adding the scoped enums and vk::Flags<T> the C++ API provides type safety for all enums and flags which is a +By adding the scoped enums and ```vk::Flags``` the C++ API provides type safety for all enums and flags which is a big improvement. This leaves the remaining issue that the compiler might not detect uninitialized fields in structs. As a solution we have added constructors to all structs which accept all values defined by the corresponding struct. -
-
+```c++
 vk::ImageCreateInfo ci(
   ...some flags..., vk::ImageType::e2D, vk::Format::eR8G8B8A8Unorm,
   vk::Extent3D { width, height, 1 }, 1, 1,
   vk::SampleCount::e1, vk::ImageTiling::eOptimal,
   vk::ImageUsage::eColorAttachment, vk::SharingMode::eExclusive,
   0, 0, vk::ImageLayout::eUndefined);
-
-
+``` # String conversions At development time it can be quite handy to have a utility function that can convert an enum or flags to a string for debugging purposes. To achieve this, -we have implemented getString(type) functions for all enums and flags. Calling getString(vk::SharingMode::eExclusive) will return 'Exclusive' and calling -getString(vk::QueueFlagBits::eGraphics | vk::QueueFlagBits::eCompute) will return the concatenated string 'Graphics | Compute'. +we have implemented ```getString(type)``` functions for all enums and flags. Calling ```getString(vk::SharingMode::eExclusive)``` will return 'Exclusive' and calling +```getString(vk::QueueFlagBits::eGraphics | vk::QueueFlagBits::eCompute)``` will return the concatenated string 'Graphics | Compute'. # Alternative Initialization of Structs @@ -123,8 +115,7 @@ Another nice feature of those constructors is that sType is being initialized in Finally, we have added a default constructor to each struct which initializes all values to 0 to allow setting the values with the named parameter idiom which is similar to the designated initializer list of C99. -
-
+```c++
 vk::ImageCreateInfo ci = vk::ImageCreateInfo()
   .flags(...some flags...)
   .imageType(vk::ImageType::e2D)
@@ -140,21 +131,21 @@ vk::ImageCreateInfo ci = vk::ImageCreateInfo()
   // .pQueueFamilyIndices(0)	// no need to set, already initialized
   .initialLayout(vk::ImageLayout::eUndefined);
 device.createImage(&ci, allocator, &image);
-
-
+``` - -# Enhancements beyond the API +# Enhancements beyond native Vulkan To provide a more object oriented feeling we're providing classes for each handle which include all Vulkan functions where the first parameter matches the handle. In addition to this we made a few changes to the signatures of the member functions -* (count, T*) has been replaced by std::vector<T> -* const char * has been replaced by -* vk::Result return values have been replaced by exceptions. -* Functions with a single output value do return this value instead +* To enable the enhanced mode put ```#define VKCPP_ENHANCED_MODE``` before including ```vk_cpp.h``` +* ```(count, T*)``` has been replaced by ```std::vector``` +* ```const char *``` has been replaced by ```std::string ``` +* ```T const*``` has been replaced by ```T const &``` to allow temporary objects. This is useful to pass small structures like ```vk::ClearColorValue``` or ```vk::Extent*``` +```commandBuffer.clearColorImage(image, layout, std::array{1.0f, 1.0f, 1.0f, 1.0f}, {...});``` +Optional parameters are being replaced by ```Optional const &``` which accept a type of ```T const&```. To tell the wrapper that a nullptr should be passed use ```T::null()```. +* The wrapper will throw a ```std::system_error``` if a ```vk::Result``` return value is not an success code. If there's only a single success code it's not returned at all. In this case functions with a single output value do return this output value instead. Here are a few code examples: -
-
+```c++
   try {
     VkInstance nativeInstance = nullptr; // Fetch the instance from a favorite toolkit
 
@@ -177,40 +168,30 @@ Here are a few code examples:
     // Accept std::vector as source for updateBuffer
     commandBuffer.updateBuffer(buffer, 0, {some values}); // update buffer with std::vector
 
-    // Sometimes it's necessary to pass a nullptr to a struct. For this case we've added T& null() to all structs T as replacement for nullptr.
+    // Sometimes it's necessary to pass a nullptr to a struct. For this case we've added Optional T::null() to all structs T as replacement for the nullptr.
     device.allocateMemory(allocateInfo, vk::AllocationCallbacks::null());
 
   }
-  catch (vk::Exception e)
+  catch (std::system_error e)
   {
     std::cerr << "Vulkan failure: " << e.what() << std::endl;
   }
-
-
+``` # Usage To start with the C++ version of the Vulkan API download header from GIT, put it in a vulkan subdirectory and add -#include <vulkan/vk_cpp.h> to your source code. +```#include ``` to your source code. To build the header for a given vk.xml specification continue with the following steps: * Build VkCppGenerator * Grab your favourite version vk.xml from Khronos -* Up to Version 1.0.3 of the API there is a tiny bug in vk.xml. The section of the VK_KHR_display extension is missing one symbol which -can easily be fixed by adding the following line -
-                <type name="VkDisplayPlaneAlphaFlagsKHR"/>
-
-before this line: -
-                <type name="VkDisplayPlaneAlphaFlagBitsKHR"/>
-
-* Excute VkCppGenerator <vk.xml> to generate vk_cpp.h in the current working directory. +* Excute ```VkCppGenerator ``` to generate ```vk_cpp.h``` in the current working directory. # Build instructions for VkCppGenerator -* Clone the repository: git clone https://github.com/nvpro-pipeline/vkcpp.git -* Update submodules: git submodule update --init --recursive +* Clone the repository: ```git clone https://github.com/nvpro-pipeline/vkcpp.git``` +* Update submodules: ```git submodule update --init --recursive``` * Use CMake to generate a solution or makefile for your favourite build environment * Launch the build diff --git a/VkCppGenerator.cpp b/VkCppGenerator.cpp index b6cc05a..ba3dbe4 100644 --- a/VkCppGenerator.cpp +++ b/VkCppGenerator.cpp @@ -214,6 +214,23 @@ const std::string flagsHeader( "\n" ); +std::string const optionalClassHeader = ( +" template \n" +" class Optional\n" +" {\n" +" public:\n" +" Optional(RefType & reference) { m_ptr = &reference; }\n" +"\n" +" operator RefType*() const { return m_ptr; }\n" +"\n" +" private:\n" +" Optional(std::nullptr_t) { m_ptr = nullptr; }\n" +" friend typename RefType;\n" +" RefType *m_ptr;\n" +" };\n" +"\n" +); + // trim from end std::string trimEnd(std::string const& input) { @@ -229,6 +246,7 @@ struct MemberData std::string arraySize; std::string pureType; std::string len; + bool optional; }; struct StructData @@ -731,6 +749,8 @@ bool readCommandParam( tinyxml2::XMLElement * element, DependencyData & typeData } } + arg.optional = element->Attribute("optional") && (strcmp(element->Attribute("optional"), "true") == 0); + return element->Attribute("optional") && (strcmp(element->Attribute("optional"), "false,true") == 0); } @@ -1579,7 +1599,17 @@ void writeCall(std::ofstream & ofs, std::string const& name, size_t templateInde { if (commandData.arguments[i].type.find("const") != std::string::npos) { - ofs << "reinterpret_cast( &" << reduceName(commandData.arguments[i].name) << " )"; + ofs << "reinterpret_cast( "; + if (commandData.arguments[i].optional) + { + ofs << "static_cast( "; + } + else + { + ofs << "&"; + } + ofs << reduceName(commandData.arguments[i].name) + << (commandData.arguments[i].optional ? "))" : " )"); } else { @@ -1848,7 +1878,15 @@ void writeFunctionHeader(std::ofstream & ofs, std::string const& indentation, st else { assert(type[pos] == '*'); - type[pos] = '&'; + if (commandData.arguments[i].optional) + { + type[pos] = ' '; + type = "vk::Optional<" + trimEnd(type) + "> const &"; + } + else + { + type[pos] = '&'; + } } ofs << type << " " << reduceName(commandData.arguments[i].name); } @@ -2462,9 +2500,9 @@ void writeTypeStruct( std::ofstream & ofs, DependencyData const& dependencyData, } // null handle - ofs << " static " << dependencyData.name << "& null()" << std::endl + ofs << " static Optional null()" << std::endl << " {" << std::endl - << " return *((" << dependencyData.name << "*)(nullptr));" << std::endl + << " return Optional(nullptr);" << std::endl << " }" << std::endl << std::endl; @@ -2709,7 +2747,8 @@ int main( int argc, char **argv ) writeTypesafeCheck(ofs, typesafeCheck ); ofs << "namespace vk" << std::endl << "{" << std::endl - << flagsHeader; + << flagsHeader + << optionalClassHeader; // first of all, write out vk::Result and the exception handling stuff std::vector::const_iterator it = std::find_if(sortedDependencies.begin(), sortedDependencies.end(), [](DependencyData const& dp) { return dp.name == "Result"; }); diff --git a/vulkan/vk_cpp.h b/vulkan/vk_cpp.h index 4d1b558..4cc10a0 100644 --- a/vulkan/vk_cpp.h +++ b/vulkan/vk_cpp.h @@ -184,6 +184,20 @@ namespace vk return flags ^ bit; } + template + class Optional + { + public: + Optional(RefType & reference) { m_ptr = &reference; } + + operator RefType*() const { return m_ptr; } + + private: + Optional(std::nullptr_t) { m_ptr = nullptr; } + friend typename RefType; + RefType *m_ptr; + }; + enum class Result { eSuccess = VK_SUCCESS, @@ -1826,9 +1840,9 @@ namespace vk return *this; } - static Offset2D& null() + static Optional null() { - return *((Offset2D*)(nullptr)); + return Optional(nullptr); } operator const VkOffset2D&() const @@ -1914,9 +1928,9 @@ namespace vk return *this; } - static Offset3D& null() + static Optional null() { - return *((Offset3D*)(nullptr)); + return Optional(nullptr); } operator const VkOffset3D&() const @@ -1985,9 +1999,9 @@ namespace vk return *this; } - static Extent2D& null() + static Optional null() { - return *((Extent2D*)(nullptr)); + return Optional(nullptr); } operator const VkExtent2D&() const @@ -2073,9 +2087,9 @@ namespace vk return *this; } - static Extent3D& null() + static Optional null() { - return *((Extent3D*)(nullptr)); + return Optional(nullptr); } operator const VkExtent3D&() const @@ -2212,9 +2226,9 @@ namespace vk return *this; } - static Viewport& null() + static Optional null() { - return *((Viewport*)(nullptr)); + return Optional(nullptr); } operator const VkViewport&() const @@ -2283,9 +2297,9 @@ namespace vk return *this; } - static Rect2D& null() + static Optional null() { - return *((Rect2D*)(nullptr)); + return Optional(nullptr); } operator const VkRect2D&() const @@ -2371,9 +2385,9 @@ namespace vk return *this; } - static ClearRect& null() + static Optional null() { - return *((ClearRect*)(nullptr)); + return Optional(nullptr); } operator const VkClearRect&() const @@ -2399,9 +2413,9 @@ namespace vk return m_extensionProperties.specVersion; } - static ExtensionProperties& null() + static Optional null() { - return *((ExtensionProperties*)(nullptr)); + return Optional(nullptr); } operator const VkExtensionProperties&() const @@ -2437,9 +2451,9 @@ namespace vk return reinterpret_cast( m_layerProperties.description ); } - static LayerProperties& null() + static Optional null() { - return *((LayerProperties*)(nullptr)); + return Optional(nullptr); } operator const VkLayerProperties&() const @@ -2572,9 +2586,9 @@ namespace vk return *this; } - static AllocationCallbacks& null() + static Optional null() { - return *((AllocationCallbacks*)(nullptr)); + return Optional(nullptr); } operator const VkAllocationCallbacks&() const @@ -2605,9 +2619,9 @@ namespace vk return m_memoryRequirements.memoryTypeBits; } - static MemoryRequirements& null() + static Optional null() { - return *((MemoryRequirements*)(nullptr)); + return Optional(nullptr); } operator const VkMemoryRequirements&() const @@ -2693,9 +2707,9 @@ namespace vk return *this; } - static DescriptorBufferInfo& null() + static Optional null() { - return *((DescriptorBufferInfo*)(nullptr)); + return Optional(nullptr); } operator const VkDescriptorBufferInfo&() const @@ -2736,9 +2750,9 @@ namespace vk return m_subresourceLayout.depthPitch; } - static SubresourceLayout& null() + static Optional null() { - return *((SubresourceLayout*)(nullptr)); + return Optional(nullptr); } operator const VkSubresourceLayout&() const @@ -2824,9 +2838,9 @@ namespace vk return *this; } - static BufferCopy& null() + static Optional null() { - return *((BufferCopy*)(nullptr)); + return Optional(nullptr); } operator const VkBufferCopy&() const @@ -2912,9 +2926,9 @@ namespace vk return *this; } - static SpecializationMapEntry& null() + static Optional null() { - return *((SpecializationMapEntry*)(nullptr)); + return Optional(nullptr); } operator const VkSpecializationMapEntry&() const @@ -3017,9 +3031,9 @@ namespace vk return *this; } - static SpecializationInfo& null() + static Optional null() { - return *((SpecializationInfo*)(nullptr)); + return Optional(nullptr); } operator const VkSpecializationInfo&() const @@ -3163,9 +3177,9 @@ namespace vk return *this; } - static ClearDepthStencilValue& null() + static Optional null() { - return *((ClearDepthStencilValue*)(nullptr)); + return Optional(nullptr); } operator const VkClearDepthStencilValue&() const @@ -4189,9 +4203,9 @@ namespace vk return *this; } - static PhysicalDeviceFeatures& null() + static Optional null() { - return *((PhysicalDeviceFeatures*)(nullptr)); + return Optional(nullptr); } operator const VkPhysicalDeviceFeatures&() const @@ -4232,9 +4246,9 @@ namespace vk return m_physicalDeviceSparseProperties.residencyNonResidentStrict; } - static PhysicalDeviceSparseProperties& null() + static Optional null() { - return *((PhysicalDeviceSparseProperties*)(nullptr)); + return Optional(nullptr); } operator const VkPhysicalDeviceSparseProperties&() const @@ -4337,9 +4351,9 @@ namespace vk return *this; } - static DrawIndirectCommand& null() + static Optional null() { - return *((DrawIndirectCommand*)(nullptr)); + return Optional(nullptr); } operator const VkDrawIndirectCommand&() const @@ -4459,9 +4473,9 @@ namespace vk return *this; } - static DrawIndexedIndirectCommand& null() + static Optional null() { - return *((DrawIndexedIndirectCommand*)(nullptr)); + return Optional(nullptr); } operator const VkDrawIndexedIndirectCommand&() const @@ -4547,9 +4561,9 @@ namespace vk return *this; } - static DispatchIndirectCommand& null() + static Optional null() { - return *((DispatchIndirectCommand*)(nullptr)); + return Optional(nullptr); } operator const VkDispatchIndirectCommand&() const @@ -4618,9 +4632,9 @@ namespace vk return *this; } - static DisplayPlanePropertiesKHR& null() + static Optional null() { - return *((DisplayPlanePropertiesKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplayPlanePropertiesKHR&() const @@ -4689,9 +4703,9 @@ namespace vk return *this; } - static DisplayModeParametersKHR& null() + static Optional null() { - return *((DisplayModeParametersKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplayModeParametersKHR&() const @@ -4760,9 +4774,9 @@ namespace vk return *this; } - static DisplayModePropertiesKHR& null() + static Optional null() { - return *((DisplayModePropertiesKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplayModePropertiesKHR&() const @@ -4862,9 +4876,9 @@ namespace vk return *this; } - static DescriptorImageInfo& null() + static Optional null() { - return *((DescriptorImageInfo*)(nullptr)); + return Optional(nullptr); } operator const VkDescriptorImageInfo&() const @@ -4933,9 +4947,9 @@ namespace vk return *this; } - static AttachmentReference& null() + static Optional null() { - return *((AttachmentReference*)(nullptr)); + return Optional(nullptr); } operator const VkAttachmentReference&() const @@ -5092,9 +5106,9 @@ namespace vk return *this; } - static ComponentMapping& null() + static Optional null() { - return *((ComponentMapping*)(nullptr)); + return Optional(nullptr); } operator const VkComponentMapping&() const @@ -5178,9 +5192,9 @@ namespace vk return *this; } - static DescriptorPoolSize& null() + static Optional null() { - return *((DescriptorPoolSize*)(nullptr)); + return Optional(nullptr); } operator const VkDescriptorPoolSize&() const @@ -5408,9 +5422,9 @@ namespace vk return *this; } - static SubpassDescription& null() + static Optional null() { - return *((SubpassDescription*)(nullptr)); + return Optional(nullptr); } operator const VkSubpassDescription&() const @@ -5701,9 +5715,9 @@ namespace vk return *this; } - static StencilOpState& null() + static Optional null() { - return *((StencilOpState*)(nullptr)); + return Optional(nullptr); } operator const VkStencilOpState&() const @@ -5838,9 +5852,9 @@ namespace vk return *this; } - static VertexInputBindingDescription& null() + static Optional null() { - return *((VertexInputBindingDescription*)(nullptr)); + return Optional(nullptr); } operator const VkVertexInputBindingDescription&() const @@ -6132,9 +6146,9 @@ namespace vk return *this; } - static VertexInputAttributeDescription& null() + static Optional null() { - return *((VertexInputAttributeDescription*)(nullptr)); + return Optional(nullptr); } operator const VkVertexInputAttributeDescription&() const @@ -6353,9 +6367,9 @@ namespace vk return *this; } - static ApplicationInfo& null() + static Optional null() { - return *((ApplicationInfo*)(nullptr)); + return Optional(nullptr); } operator const VkApplicationInfo&() const @@ -6492,9 +6506,9 @@ namespace vk return *this; } - static DeviceQueueCreateInfo& null() + static Optional null() { - return *((DeviceQueueCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkDeviceQueueCreateInfo&() const @@ -6699,9 +6713,9 @@ namespace vk return *this; } - static DeviceCreateInfo& null() + static Optional null() { - return *((DeviceCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkDeviceCreateInfo&() const @@ -6872,9 +6886,9 @@ namespace vk return *this; } - static InstanceCreateInfo& null() + static Optional null() { - return *((InstanceCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkInstanceCreateInfo&() const @@ -6977,9 +6991,9 @@ namespace vk return *this; } - static MemoryAllocateInfo& null() + static Optional null() { - return *((MemoryAllocateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkMemoryAllocateInfo&() const @@ -7099,9 +7113,9 @@ namespace vk return *this; } - static MappedMemoryRange& null() + static Optional null() { - return *((MappedMemoryRange*)(nullptr)); + return Optional(nullptr); } operator const VkMappedMemoryRange&() const @@ -7306,9 +7320,9 @@ namespace vk return *this; } - static WriteDescriptorSet& null() + static Optional null() { - return *((WriteDescriptorSet*)(nullptr)); + return Optional(nullptr); } operator const VkWriteDescriptorSet&() const @@ -7496,9 +7510,9 @@ namespace vk return *this; } - static CopyDescriptorSet& null() + static Optional null() { - return *((CopyDescriptorSet*)(nullptr)); + return Optional(nullptr); } operator const VkCopyDescriptorSet&() const @@ -7652,9 +7666,9 @@ namespace vk return *this; } - static BufferViewCreateInfo& null() + static Optional null() { - return *((BufferViewCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkBufferViewCreateInfo&() const @@ -7774,9 +7788,9 @@ namespace vk return *this; } - static ShaderModuleCreateInfo& null() + static Optional null() { - return *((ShaderModuleCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkShaderModuleCreateInfo&() const @@ -7896,9 +7910,9 @@ namespace vk return *this; } - static DescriptorSetAllocateInfo& null() + static Optional null() { - return *((DescriptorSetAllocateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkDescriptorSetAllocateInfo&() const @@ -8052,9 +8066,9 @@ namespace vk return *this; } - static PipelineVertexInputStateCreateInfo& null() + static Optional null() { - return *((PipelineVertexInputStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineVertexInputStateCreateInfo&() const @@ -8174,9 +8188,9 @@ namespace vk return *this; } - static PipelineInputAssemblyStateCreateInfo& null() + static Optional null() { - return *((PipelineInputAssemblyStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineInputAssemblyStateCreateInfo&() const @@ -8279,9 +8293,9 @@ namespace vk return *this; } - static PipelineTessellationStateCreateInfo& null() + static Optional null() { - return *((PipelineTessellationStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineTessellationStateCreateInfo&() const @@ -8435,9 +8449,9 @@ namespace vk return *this; } - static PipelineViewportStateCreateInfo& null() + static Optional null() { - return *((PipelineViewportStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineViewportStateCreateInfo&() const @@ -8693,9 +8707,9 @@ namespace vk return *this; } - static PipelineRasterizationStateCreateInfo& null() + static Optional null() { - return *((PipelineRasterizationStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineRasterizationStateCreateInfo&() const @@ -8934,9 +8948,9 @@ namespace vk return *this; } - static PipelineDepthStencilStateCreateInfo& null() + static Optional null() { - return *((PipelineDepthStencilStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineDepthStencilStateCreateInfo&() const @@ -9056,9 +9070,9 @@ namespace vk return *this; } - static PipelineCacheCreateInfo& null() + static Optional null() { - return *((PipelineCacheCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineCacheCreateInfo&() const @@ -9399,9 +9413,9 @@ namespace vk return *this; } - static SamplerCreateInfo& null() + static Optional null() { - return *((SamplerCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkSamplerCreateInfo&() const @@ -9521,9 +9535,9 @@ namespace vk return *this; } - static CommandBufferAllocateInfo& null() + static Optional null() { - return *((CommandBufferAllocateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkCommandBufferAllocateInfo&() const @@ -9677,9 +9691,9 @@ namespace vk return *this; } - static RenderPassBeginInfo& null() + static Optional null() { - return *((RenderPassBeginInfo*)(nullptr)); + return Optional(nullptr); } operator const VkRenderPassBeginInfo&() const @@ -9765,9 +9779,9 @@ namespace vk return *this; } - static EventCreateInfo& null() + static Optional null() { - return *((EventCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkEventCreateInfo&() const @@ -9853,9 +9867,9 @@ namespace vk return *this; } - static SemaphoreCreateInfo& null() + static Optional null() { - return *((SemaphoreCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkSemaphoreCreateInfo&() const @@ -10043,9 +10057,9 @@ namespace vk return *this; } - static FramebufferCreateInfo& null() + static Optional null() { - return *((FramebufferCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkFramebufferCreateInfo&() const @@ -10148,9 +10162,9 @@ namespace vk return *this; } - static DisplayModeCreateInfoKHR& null() + static Optional null() { - return *((DisplayModeCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplayModeCreateInfoKHR&() const @@ -10270,9 +10284,9 @@ namespace vk return *this; } - static DisplayPresentInfoKHR& null() + static Optional null() { - return *((DisplayPresentInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplayPresentInfoKHR&() const @@ -10376,9 +10390,9 @@ namespace vk return *this; } - static AndroidSurfaceCreateInfoKHR& null() + static Optional null() { - return *((AndroidSurfaceCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkAndroidSurfaceCreateInfoKHR&() const @@ -10500,9 +10514,9 @@ namespace vk return *this; } - static MirSurfaceCreateInfoKHR& null() + static Optional null() { - return *((MirSurfaceCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkMirSurfaceCreateInfoKHR&() const @@ -10624,9 +10638,9 @@ namespace vk return *this; } - static WaylandSurfaceCreateInfoKHR& null() + static Optional null() { - return *((WaylandSurfaceCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkWaylandSurfaceCreateInfoKHR&() const @@ -10748,9 +10762,9 @@ namespace vk return *this; } - static Win32SurfaceCreateInfoKHR& null() + static Optional null() { - return *((Win32SurfaceCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkWin32SurfaceCreateInfoKHR&() const @@ -10872,9 +10886,9 @@ namespace vk return *this; } - static XlibSurfaceCreateInfoKHR& null() + static Optional null() { - return *((XlibSurfaceCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkXlibSurfaceCreateInfoKHR&() const @@ -10996,9 +11010,9 @@ namespace vk return *this; } - static XcbSurfaceCreateInfoKHR& null() + static Optional null() { - return *((XcbSurfaceCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkXcbSurfaceCreateInfoKHR&() const @@ -11176,9 +11190,9 @@ namespace vk return *this; } - static PresentInfoKHR& null() + static Optional null() { - return *((PresentInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkPresentInfoKHR&() const @@ -11311,9 +11325,9 @@ namespace vk return *this; } - static PipelineDynamicStateCreateInfo& null() + static Optional null() { - return *((PipelineDynamicStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineDynamicStateCreateInfo&() const @@ -11364,9 +11378,9 @@ namespace vk return reinterpret_cast( m_queueFamilyProperties.minImageTransferGranularity ); } - static QueueFamilyProperties& null() + static Optional null() { - return *((QueueFamilyProperties*)(nullptr)); + return Optional(nullptr); } operator const VkQueueFamilyProperties&() const @@ -11408,9 +11422,9 @@ namespace vk return m_memoryType.heapIndex; } - static MemoryType& null() + static Optional null() { - return *((MemoryType*)(nullptr)); + return Optional(nullptr); } operator const VkMemoryType&() const @@ -11448,9 +11462,9 @@ namespace vk return reinterpret_cast( m_memoryHeap.flags ); } - static MemoryHeap& null() + static Optional null() { - return *((MemoryHeap*)(nullptr)); + return Optional(nullptr); } operator const VkMemoryHeap&() const @@ -11486,9 +11500,9 @@ namespace vk return reinterpret_cast( m_physicalDeviceMemoryProperties.memoryHeaps ); } - static PhysicalDeviceMemoryProperties& null() + static Optional null() { - return *((PhysicalDeviceMemoryProperties*)(nullptr)); + return Optional(nullptr); } operator const VkPhysicalDeviceMemoryProperties&() const @@ -11619,9 +11633,9 @@ namespace vk return *this; } - static MemoryBarrier& null() + static Optional null() { - return *((MemoryBarrier*)(nullptr)); + return Optional(nullptr); } operator const VkMemoryBarrier&() const @@ -11809,9 +11823,9 @@ namespace vk return *this; } - static BufferMemoryBarrier& null() + static Optional null() { - return *((BufferMemoryBarrier*)(nullptr)); + return Optional(nullptr); } operator const VkBufferMemoryBarrier&() const @@ -12016,9 +12030,9 @@ namespace vk return *this; } - static BufferCreateInfo& null() + static Optional null() { - return *((BufferCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkBufferCreateInfo&() const @@ -12157,9 +12171,9 @@ namespace vk return *this; } - static DescriptorSetLayoutBinding& null() + static Optional null() { - return *((DescriptorSetLayoutBinding*)(nullptr)); + return Optional(nullptr); } operator const VkDescriptorSetLayoutBinding&() const @@ -12279,9 +12293,9 @@ namespace vk return *this; } - static DescriptorSetLayoutCreateInfo& null() + static Optional null() { - return *((DescriptorSetLayoutCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkDescriptorSetLayoutCreateInfo&() const @@ -12435,9 +12449,9 @@ namespace vk return *this; } - static PipelineShaderStageCreateInfo& null() + static Optional null() { - return *((PipelineShaderStageCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineShaderStageCreateInfo&() const @@ -12523,9 +12537,9 @@ namespace vk return *this; } - static PushConstantRange& null() + static Optional null() { - return *((PushConstantRange*)(nullptr)); + return Optional(nullptr); } operator const VkPushConstantRange&() const @@ -12679,9 +12693,9 @@ namespace vk return *this; } - static PipelineLayoutCreateInfo& null() + static Optional null() { - return *((PipelineLayoutCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineLayoutCreateInfo&() const @@ -12884,9 +12898,9 @@ namespace vk return *this; } - static ComputePipelineCreateInfo& null() + static Optional null() { - return *((ComputePipelineCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkComputePipelineCreateInfo&() const @@ -13072,9 +13086,9 @@ namespace vk return *this; } - static PipelineColorBlendAttachmentState& null() + static Optional null() { - return *((PipelineColorBlendAttachmentState*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineColorBlendAttachmentState&() const @@ -13245,9 +13259,9 @@ namespace vk return *this; } - static PipelineColorBlendStateCreateInfo& null() + static Optional null() { - return *((PipelineColorBlendStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineColorBlendStateCreateInfo&() const @@ -13345,9 +13359,9 @@ namespace vk return *this; } - static FenceCreateInfo& null() + static Optional null() { - return *((FenceCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkFenceCreateInfo&() const @@ -13402,9 +13416,9 @@ namespace vk return reinterpret_cast( m_formatProperties.bufferFeatures ); } - static FormatProperties& null() + static Optional null() { - return *((FormatProperties*)(nullptr)); + return Optional(nullptr); } operator const VkFormatProperties&() const @@ -13638,9 +13652,9 @@ namespace vk return *this; } - static CommandBufferInheritanceInfo& null() + static Optional null() { - return *((CommandBufferInheritanceInfo*)(nullptr)); + return Optional(nullptr); } operator const VkCommandBufferInheritanceInfo&() const @@ -13743,9 +13757,9 @@ namespace vk return *this; } - static CommandBufferBeginInfo& null() + static Optional null() { - return *((CommandBufferBeginInfo*)(nullptr)); + return Optional(nullptr); } operator const VkCommandBufferBeginInfo&() const @@ -13882,9 +13896,9 @@ namespace vk return *this; } - static QueryPoolCreateInfo& null() + static Optional null() { - return *((QueryPoolCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkQueryPoolCreateInfo&() const @@ -13985,9 +13999,9 @@ namespace vk return *this; } - static ImageSubresource& null() + static Optional null() { - return *((ImageSubresource*)(nullptr)); + return Optional(nullptr); } operator const VkImageSubresource&() const @@ -14090,9 +14104,9 @@ namespace vk return *this; } - static ImageSubresourceLayers& null() + static Optional null() { - return *((ImageSubresourceLayers*)(nullptr)); + return Optional(nullptr); } operator const VkImageSubresourceLayers&() const @@ -14212,9 +14226,9 @@ namespace vk return *this; } - static ImageSubresourceRange& null() + static Optional null() { - return *((ImageSubresourceRange*)(nullptr)); + return Optional(nullptr); } operator const VkImageSubresourceRange&() const @@ -14419,9 +14433,9 @@ namespace vk return *this; } - static ImageMemoryBarrier& null() + static Optional null() { - return *((ImageMemoryBarrier*)(nullptr)); + return Optional(nullptr); } operator const VkImageMemoryBarrier&() const @@ -14592,9 +14606,9 @@ namespace vk return *this; } - static ImageViewCreateInfo& null() + static Optional null() { - return *((ImageViewCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkImageViewCreateInfo&() const @@ -14714,9 +14728,9 @@ namespace vk return *this; } - static ImageCopy& null() + static Optional null() { - return *((ImageCopy*)(nullptr)); + return Optional(nullptr); } operator const VkImageCopy&() const @@ -14819,9 +14833,9 @@ namespace vk return *this; } - static ImageBlit& null() + static Optional null() { - return *((ImageBlit*)(nullptr)); + return Optional(nullptr); } operator const VkImageBlit&() const @@ -14958,9 +14972,9 @@ namespace vk return *this; } - static BufferImageCopy& null() + static Optional null() { - return *((BufferImageCopy*)(nullptr)); + return Optional(nullptr); } operator const VkBufferImageCopy&() const @@ -15080,9 +15094,9 @@ namespace vk return *this; } - static ImageResolve& null() + static Optional null() { - return *((ImageResolve*)(nullptr)); + return Optional(nullptr); } operator const VkImageResolve&() const @@ -15168,9 +15182,9 @@ namespace vk return *this; } - static ClearAttachment& null() + static Optional null() { - return *((ClearAttachment*)(nullptr)); + return Optional(nullptr); } operator const VkClearAttachment&() const @@ -15215,9 +15229,9 @@ namespace vk return reinterpret_cast( m_sparseImageFormatProperties.flags ); } - static SparseImageFormatProperties& null() + static Optional null() { - return *((SparseImageFormatProperties*)(nullptr)); + return Optional(nullptr); } operator const VkSparseImageFormatProperties&() const @@ -15258,9 +15272,9 @@ namespace vk return m_sparseImageMemoryRequirements.imageMipTailStride; } - static SparseImageMemoryRequirements& null() + static Optional null() { - return *((SparseImageMemoryRequirements*)(nullptr)); + return Optional(nullptr); } operator const VkSparseImageMemoryRequirements&() const @@ -15392,9 +15406,9 @@ namespace vk return *this; } - static SparseMemoryBind& null() + static Optional null() { - return *((SparseMemoryBind*)(nullptr)); + return Optional(nullptr); } operator const VkSparseMemoryBind&() const @@ -15531,9 +15545,9 @@ namespace vk return *this; } - static SparseImageMemoryBind& null() + static Optional null() { - return *((SparseImageMemoryBind*)(nullptr)); + return Optional(nullptr); } operator const VkSparseImageMemoryBind&() const @@ -15619,9 +15633,9 @@ namespace vk return *this; } - static SparseBufferMemoryBindInfo& null() + static Optional null() { - return *((SparseBufferMemoryBindInfo*)(nullptr)); + return Optional(nullptr); } operator const VkSparseBufferMemoryBindInfo&() const @@ -15707,9 +15721,9 @@ namespace vk return *this; } - static SparseImageOpaqueMemoryBindInfo& null() + static Optional null() { - return *((SparseImageOpaqueMemoryBindInfo*)(nullptr)); + return Optional(nullptr); } operator const VkSparseImageOpaqueMemoryBindInfo&() const @@ -15795,9 +15809,9 @@ namespace vk return *this; } - static SparseImageMemoryBindInfo& null() + static Optional null() { - return *((SparseImageMemoryBindInfo*)(nullptr)); + return Optional(nullptr); } operator const VkSparseImageMemoryBindInfo&() const @@ -16036,9 +16050,9 @@ namespace vk return *this; } - static BindSparseInfo& null() + static Optional null() { - return *((BindSparseInfo*)(nullptr)); + return Optional(nullptr); } operator const VkBindSparseInfo&() const @@ -16182,9 +16196,9 @@ namespace vk return *this; } - static CommandPoolCreateInfo& null() + static Optional null() { - return *((CommandPoolCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkCommandPoolCreateInfo&() const @@ -16267,9 +16281,9 @@ namespace vk return m_imageFormatProperties.maxResourceSize; } - static ImageFormatProperties& null() + static Optional null() { - return *((ImageFormatProperties*)(nullptr)); + return Optional(nullptr); } operator const VkImageFormatProperties&() const @@ -16559,9 +16573,9 @@ namespace vk return *this; } - static ImageCreateInfo& null() + static Optional null() { - return *((ImageCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkImageCreateInfo&() const @@ -16749,9 +16763,9 @@ namespace vk return *this; } - static PipelineMultisampleStateCreateInfo& null() + static Optional null() { - return *((PipelineMultisampleStateCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkPipelineMultisampleStateCreateInfo&() const @@ -17109,9 +17123,9 @@ namespace vk return *this; } - static GraphicsPipelineCreateInfo& null() + static Optional null() { - return *((GraphicsPipelineCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkGraphicsPipelineCreateInfo&() const @@ -17657,9 +17671,9 @@ namespace vk return m_physicalDeviceLimits.nonCoherentAtomSize; } - static PhysicalDeviceLimits& null() + static Optional null() { - return *((PhysicalDeviceLimits*)(nullptr)); + return Optional(nullptr); } operator const VkPhysicalDeviceLimits&() const @@ -17720,9 +17734,9 @@ namespace vk return reinterpret_cast( m_physicalDeviceProperties.sparseProperties ); } - static PhysicalDeviceProperties& null() + static Optional null() { - return *((PhysicalDeviceProperties*)(nullptr)); + return Optional(nullptr); } operator const VkPhysicalDeviceProperties&() const @@ -17922,9 +17936,9 @@ namespace vk return *this; } - static AttachmentDescription& null() + static Optional null() { - return *((AttachmentDescription*)(nullptr)); + return Optional(nullptr); } operator const VkAttachmentDescription&() const @@ -18087,9 +18101,9 @@ namespace vk return *this; } - static DescriptorPoolCreateInfo& null() + static Optional null() { - return *((DescriptorPoolCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkDescriptorPoolCreateInfo&() const @@ -18933,9 +18947,9 @@ namespace vk return *this; } - static SubpassDependency& null() + static Optional null() { - return *((SubpassDependency*)(nullptr)); + return Optional(nullptr); } operator const VkSubpassDependency&() const @@ -19123,9 +19137,9 @@ namespace vk return *this; } - static RenderPassCreateInfo& null() + static Optional null() { - return *((RenderPassCreateInfo*)(nullptr)); + return Optional(nullptr); } operator const VkRenderPassCreateInfo&() const @@ -19313,9 +19327,9 @@ namespace vk return *this; } - static SubmitInfo& null() + static Optional null() { - return *((SubmitInfo*)(nullptr)); + return Optional(nullptr); } operator const VkSubmitInfo&() const @@ -19506,9 +19520,9 @@ namespace vk return *this; } - static SurfaceFormatKHR& null() + static Optional null() { - return *((SurfaceFormatKHR*)(nullptr)); + return Optional(nullptr); } operator const VkSurfaceFormatKHR&() const @@ -19711,9 +19725,9 @@ namespace vk return *this; } - static DisplayPlaneCapabilitiesKHR& null() + static Optional null() { - return *((DisplayPlaneCapabilitiesKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplayPlaneCapabilitiesKHR&() const @@ -19902,9 +19916,9 @@ namespace vk return *this; } - static DisplayPropertiesKHR& null() + static Optional null() { - return *((DisplayPropertiesKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplayPropertiesKHR&() const @@ -20109,9 +20123,9 @@ namespace vk return *this; } - static DisplaySurfaceCreateInfoKHR& null() + static Optional null() { - return *((DisplaySurfaceCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkDisplaySurfaceCreateInfoKHR&() const @@ -20316,9 +20330,9 @@ namespace vk return *this; } - static SurfaceCapabilitiesKHR& null() + static Optional null() { - return *((SurfaceCapabilitiesKHR*)(nullptr)); + return Optional(nullptr); } operator const VkSurfaceCapabilitiesKHR&() const @@ -20659,9 +20673,9 @@ namespace vk return *this; } - static SwapchainCreateInfoKHR& null() + static Optional null() { - return *((SwapchainCreateInfoKHR*)(nullptr)); + return Optional(nullptr); } operator const VkSwapchainCreateInfoKHR&() const @@ -20711,9 +20725,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroy( const AllocationCallbacks& allocator ) const + void destroy( vk::Optional const & allocator ) const { - vkDestroyDevice( m_device, reinterpret_cast( &allocator ) ); + vkDestroyDevice( m_device, reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -20755,10 +20769,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - DeviceMemory allocateMemory( const MemoryAllocateInfo& allocateInfo, const AllocationCallbacks& allocator ) const + DeviceMemory allocateMemory( const MemoryAllocateInfo& allocateInfo, vk::Optional const & allocator ) const { DeviceMemory memory; - Result result = static_cast( vkAllocateMemory( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &memory ) ) ); + Result result = static_cast( vkAllocateMemory( m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &memory ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::allocateMemory" ); @@ -20773,9 +20787,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void freeMemory( DeviceMemory memory, const AllocationCallbacks& allocator ) const + void freeMemory( DeviceMemory memory, vk::Optional const & allocator ) const { - vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( &allocator ) ); + vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -20946,10 +20960,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Fence createFence( const FenceCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Fence createFence( const FenceCreateInfo& createInfo, vk::Optional const & allocator ) const { Fence fence; - Result result = static_cast( vkCreateFence( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &fence ) ) ); + Result result = static_cast( vkCreateFence( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &fence ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createFence" ); @@ -20964,9 +20978,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyFence( Fence fence, const AllocationCallbacks& allocator ) const + void destroyFence( Fence fence, vk::Optional const & allocator ) const { - vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( &allocator ) ); + vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21028,10 +21042,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Semaphore createSemaphore( const SemaphoreCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Semaphore createSemaphore( const SemaphoreCreateInfo& createInfo, vk::Optional const & allocator ) const { Semaphore semaphore; - Result result = static_cast( vkCreateSemaphore( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &semaphore ) ) ); + Result result = static_cast( vkCreateSemaphore( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &semaphore ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createSemaphore" ); @@ -21046,9 +21060,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroySemaphore( Semaphore semaphore, const AllocationCallbacks& allocator ) const + void destroySemaphore( Semaphore semaphore, vk::Optional const & allocator ) const { - vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( &allocator ) ); + vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21058,10 +21072,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Event createEvent( const EventCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Event createEvent( const EventCreateInfo& createInfo, vk::Optional const & allocator ) const { Event event; - Result result = static_cast( vkCreateEvent( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &event ) ) ); + Result result = static_cast( vkCreateEvent( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &event ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createEvent" ); @@ -21076,9 +21090,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyEvent( Event event, const AllocationCallbacks& allocator ) const + void destroyEvent( Event event, vk::Optional const & allocator ) const { - vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( &allocator ) ); + vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21143,10 +21157,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - QueryPool createQueryPool( const QueryPoolCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + QueryPool createQueryPool( const QueryPoolCreateInfo& createInfo, vk::Optional const & allocator ) const { QueryPool queryPool; - Result result = static_cast( vkCreateQueryPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &queryPool ) ) ); + Result result = static_cast( vkCreateQueryPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &queryPool ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createQueryPool" ); @@ -21161,9 +21175,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyQueryPool( QueryPool queryPool, const AllocationCallbacks& allocator ) const + void destroyQueryPool( QueryPool queryPool, vk::Optional const & allocator ) const { - vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( &allocator ) ); + vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21191,10 +21205,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Buffer createBuffer( const BufferCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Buffer createBuffer( const BufferCreateInfo& createInfo, vk::Optional const & allocator ) const { Buffer buffer; - Result result = static_cast( vkCreateBuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &buffer ) ) ); + Result result = static_cast( vkCreateBuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &buffer ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createBuffer" ); @@ -21209,9 +21223,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyBuffer( Buffer buffer, const AllocationCallbacks& allocator ) const + void destroyBuffer( Buffer buffer, vk::Optional const & allocator ) const { - vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( &allocator ) ); + vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21221,10 +21235,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - BufferView createBufferView( const BufferViewCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + BufferView createBufferView( const BufferViewCreateInfo& createInfo, vk::Optional const & allocator ) const { BufferView view; - Result result = static_cast( vkCreateBufferView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &view ) ) ); + Result result = static_cast( vkCreateBufferView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &view ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createBufferView" ); @@ -21239,9 +21253,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyBufferView( BufferView bufferView, const AllocationCallbacks& allocator ) const + void destroyBufferView( BufferView bufferView, vk::Optional const & allocator ) const { - vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( &allocator ) ); + vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21251,10 +21265,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Image createImage( const ImageCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Image createImage( const ImageCreateInfo& createInfo, vk::Optional const & allocator ) const { Image image; - Result result = static_cast( vkCreateImage( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &image ) ) ); + Result result = static_cast( vkCreateImage( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &image ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createImage" ); @@ -21269,9 +21283,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyImage( Image image, const AllocationCallbacks& allocator ) const + void destroyImage( Image image, vk::Optional const & allocator ) const { - vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( &allocator ) ); + vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21295,10 +21309,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - ImageView createImageView( const ImageViewCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + ImageView createImageView( const ImageViewCreateInfo& createInfo, vk::Optional const & allocator ) const { ImageView view; - Result result = static_cast( vkCreateImageView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &view ) ) ); + Result result = static_cast( vkCreateImageView( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &view ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createImageView" ); @@ -21313,9 +21327,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyImageView( ImageView imageView, const AllocationCallbacks& allocator ) const + void destroyImageView( ImageView imageView, vk::Optional const & allocator ) const { - vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( &allocator ) ); + vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21325,10 +21339,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - ShaderModule createShaderModule( const ShaderModuleCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + ShaderModule createShaderModule( const ShaderModuleCreateInfo& createInfo, vk::Optional const & allocator ) const { ShaderModule shaderModule; - Result result = static_cast( vkCreateShaderModule( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &shaderModule ) ) ); + Result result = static_cast( vkCreateShaderModule( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &shaderModule ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createShaderModule" ); @@ -21343,9 +21357,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyShaderModule( ShaderModule shaderModule, const AllocationCallbacks& allocator ) const + void destroyShaderModule( ShaderModule shaderModule, vk::Optional const & allocator ) const { - vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( &allocator ) ); + vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21355,10 +21369,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - PipelineCache createPipelineCache( const PipelineCacheCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + PipelineCache createPipelineCache( const PipelineCacheCreateInfo& createInfo, vk::Optional const & allocator ) const { PipelineCache pipelineCache; - Result result = static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &pipelineCache ) ) ); + Result result = static_cast( vkCreatePipelineCache( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &pipelineCache ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createPipelineCache" ); @@ -21373,9 +21387,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyPipelineCache( PipelineCache pipelineCache, const AllocationCallbacks& allocator ) const + void destroyPipelineCache( PipelineCache pipelineCache, vk::Optional const & allocator ) const { - vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( &allocator ) ); + vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21426,10 +21440,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - std::vector createGraphicsPipelines( PipelineCache pipelineCache, std::vector const& createInfos, const AllocationCallbacks& allocator ) const + std::vector createGraphicsPipelines( PipelineCache pipelineCache, std::vector const& createInfos, vk::Optional const & allocator ) const { std::vector pipelines( createInfos.size() ); - Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), static_cast( createInfos.size() ), reinterpret_cast( createInfos.data() ), reinterpret_cast( &allocator ), reinterpret_cast( pipelines.data() ) ) ); + Result result = static_cast( vkCreateGraphicsPipelines( m_device, static_cast( pipelineCache ), static_cast( createInfos.size() ), reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( pipelines.data() ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createGraphicsPipelines" ); @@ -21444,10 +21458,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - std::vector createComputePipelines( PipelineCache pipelineCache, std::vector const& createInfos, const AllocationCallbacks& allocator ) const + std::vector createComputePipelines( PipelineCache pipelineCache, std::vector const& createInfos, vk::Optional const & allocator ) const { std::vector pipelines( createInfos.size() ); - Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), static_cast( createInfos.size() ), reinterpret_cast( createInfos.data() ), reinterpret_cast( &allocator ), reinterpret_cast( pipelines.data() ) ) ); + Result result = static_cast( vkCreateComputePipelines( m_device, static_cast( pipelineCache ), static_cast( createInfos.size() ), reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( pipelines.data() ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createComputePipelines" ); @@ -21462,9 +21476,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyPipeline( Pipeline pipeline, const AllocationCallbacks& allocator ) const + void destroyPipeline( Pipeline pipeline, vk::Optional const & allocator ) const { - vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( &allocator ) ); + vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21474,10 +21488,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - PipelineLayout createPipelineLayout( const PipelineLayoutCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + PipelineLayout createPipelineLayout( const PipelineLayoutCreateInfo& createInfo, vk::Optional const & allocator ) const { PipelineLayout pipelineLayout; - Result result = static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &pipelineLayout ) ) ); + Result result = static_cast( vkCreatePipelineLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &pipelineLayout ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createPipelineLayout" ); @@ -21492,9 +21506,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyPipelineLayout( PipelineLayout pipelineLayout, const AllocationCallbacks& allocator ) const + void destroyPipelineLayout( PipelineLayout pipelineLayout, vk::Optional const & allocator ) const { - vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( &allocator ) ); + vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21504,10 +21518,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Sampler createSampler( const SamplerCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Sampler createSampler( const SamplerCreateInfo& createInfo, vk::Optional const & allocator ) const { Sampler sampler; - Result result = static_cast( vkCreateSampler( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &sampler ) ) ); + Result result = static_cast( vkCreateSampler( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &sampler ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createSampler" ); @@ -21522,9 +21536,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroySampler( Sampler sampler, const AllocationCallbacks& allocator ) const + void destroySampler( Sampler sampler, vk::Optional const & allocator ) const { - vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( &allocator ) ); + vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21534,10 +21548,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - DescriptorSetLayout createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + DescriptorSetLayout createDescriptorSetLayout( const DescriptorSetLayoutCreateInfo& createInfo, vk::Optional const & allocator ) const { DescriptorSetLayout setLayout; - Result result = static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &setLayout ) ) ); + Result result = static_cast( vkCreateDescriptorSetLayout( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &setLayout ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createDescriptorSetLayout" ); @@ -21552,9 +21566,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, const AllocationCallbacks& allocator ) const + void destroyDescriptorSetLayout( DescriptorSetLayout descriptorSetLayout, vk::Optional const & allocator ) const { - vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( &allocator ) ); + vkDestroyDescriptorSetLayout( m_device, static_cast( descriptorSetLayout ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21564,10 +21578,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - DescriptorPool createDescriptorPool( const DescriptorPoolCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + DescriptorPool createDescriptorPool( const DescriptorPoolCreateInfo& createInfo, vk::Optional const & allocator ) const { DescriptorPool descriptorPool; - Result result = static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &descriptorPool ) ) ); + Result result = static_cast( vkCreateDescriptorPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &descriptorPool ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createDescriptorPool" ); @@ -21582,9 +21596,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyDescriptorPool( DescriptorPool descriptorPool, const AllocationCallbacks& allocator ) const + void destroyDescriptorPool( DescriptorPool descriptorPool, vk::Optional const & allocator ) const { - vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( &allocator ) ); + vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21658,10 +21672,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Framebuffer createFramebuffer( const FramebufferCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Framebuffer createFramebuffer( const FramebufferCreateInfo& createInfo, vk::Optional const & allocator ) const { Framebuffer framebuffer; - Result result = static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &framebuffer ) ) ); + Result result = static_cast( vkCreateFramebuffer( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &framebuffer ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createFramebuffer" ); @@ -21676,9 +21690,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyFramebuffer( Framebuffer framebuffer, const AllocationCallbacks& allocator ) const + void destroyFramebuffer( Framebuffer framebuffer, vk::Optional const & allocator ) const { - vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( &allocator ) ); + vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21688,10 +21702,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - RenderPass createRenderPass( const RenderPassCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + RenderPass createRenderPass( const RenderPassCreateInfo& createInfo, vk::Optional const & allocator ) const { RenderPass renderPass; - Result result = static_cast( vkCreateRenderPass( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &renderPass ) ) ); + Result result = static_cast( vkCreateRenderPass( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &renderPass ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createRenderPass" ); @@ -21706,9 +21720,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyRenderPass( RenderPass renderPass, const AllocationCallbacks& allocator ) const + void destroyRenderPass( RenderPass renderPass, vk::Optional const & allocator ) const { - vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( &allocator ) ); + vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21732,10 +21746,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - CommandPool createCommandPool( const CommandPoolCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + CommandPool createCommandPool( const CommandPoolCreateInfo& createInfo, vk::Optional const & allocator ) const { CommandPool commandPool; - Result result = static_cast( vkCreateCommandPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &commandPool ) ) ); + Result result = static_cast( vkCreateCommandPool( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &commandPool ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createCommandPool" ); @@ -21750,9 +21764,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyCommandPool( CommandPool commandPool, const AllocationCallbacks& allocator ) const + void destroyCommandPool( CommandPool commandPool, vk::Optional const & allocator ) const { - vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( &allocator ) ); + vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -21810,10 +21824,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - std::vector createSharedSwapchainsKHR( std::vector const& createInfos, const AllocationCallbacks& allocator ) const + std::vector createSharedSwapchainsKHR( std::vector const& createInfos, vk::Optional const & allocator ) const { std::vector swapchains( createInfos.size() ); - Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, static_cast( createInfos.size() ), reinterpret_cast( createInfos.data() ), reinterpret_cast( &allocator ), reinterpret_cast( swapchains.data() ) ) ); + Result result = static_cast( vkCreateSharedSwapchainsKHR( m_device, static_cast( createInfos.size() ), reinterpret_cast( createInfos.data() ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( swapchains.data() ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createSharedSwapchainsKHR" ); @@ -21828,10 +21842,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - SwapchainKHR createSwapchainKHR( const SwapchainCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SwapchainKHR createSwapchainKHR( const SwapchainCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SwapchainKHR swapchain; - Result result = static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &swapchain ) ) ); + Result result = static_cast( vkCreateSwapchainKHR( m_device, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &swapchain ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Device::createSwapchainKHR" ); @@ -21846,9 +21860,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroySwapchainKHR( SwapchainKHR swapchain, const AllocationCallbacks& allocator ) const + void destroySwapchainKHR( SwapchainKHR swapchain, vk::Optional const & allocator ) const { - vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( &allocator ) ); + vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -22032,10 +22046,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - Device createDevice( const DeviceCreateInfo& createInfo, const AllocationCallbacks& allocator ) const + Device createDevice( const DeviceCreateInfo& createInfo, vk::Optional const & allocator ) const { Device device; - Result result = static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &device ) ) ); + Result result = static_cast( vkCreateDevice( m_physicalDevice, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &device ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::PhysicalDevice::createDevice" ); @@ -22211,10 +22225,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - DisplayModeKHR createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + DisplayModeKHR createDisplayModeKHR( DisplayKHR display, const DisplayModeCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { DisplayModeKHR mode; - Result result = static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &mode ) ) ); + Result result = static_cast( vkCreateDisplayModeKHR( m_physicalDevice, static_cast( display ), reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &mode ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::PhysicalDevice::createDisplayModeKHR" ); @@ -22548,9 +22562,9 @@ namespace vk return *this; } - static DebugReportCallbackCreateInfoEXT& null() + static Optional null() { - return *((DebugReportCallbackCreateInfoEXT*)(nullptr)); + return Optional(nullptr); } operator const VkDebugReportCallbackCreateInfoEXT&() const @@ -22621,9 +22635,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroy( const AllocationCallbacks& allocator ) const + void destroy( vk::Optional const & allocator ) const { - vkDestroyInstance( m_instance, reinterpret_cast( &allocator ) ); + vkDestroyInstance( m_instance, reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -22672,10 +22686,10 @@ namespace vk #ifdef VKCPP_ENHANCED_MODE #ifdef VK_USE_PLATFORM_ANDROID_KHR - SurfaceKHR createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SurfaceKHR createAndroidSurfaceKHR( const AndroidSurfaceCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &surface ) ) ); + Result result = static_cast( vkCreateAndroidSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createAndroidSurfaceKHR" ); @@ -22691,10 +22705,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - SurfaceKHR createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SurfaceKHR createDisplayPlaneSurfaceKHR( const DisplaySurfaceCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &surface ) ) ); + Result result = static_cast( vkCreateDisplayPlaneSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createDisplayPlaneSurfaceKHR" ); @@ -22712,10 +22726,10 @@ namespace vk #ifdef VKCPP_ENHANCED_MODE #ifdef VK_USE_PLATFORM_MIR_KHR - SurfaceKHR createMirSurfaceKHR( const MirSurfaceCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SurfaceKHR createMirSurfaceKHR( const MirSurfaceCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &surface ) ) ); + Result result = static_cast( vkCreateMirSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createMirSurfaceKHR" ); @@ -22731,9 +22745,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroySurfaceKHR( SurfaceKHR surface, const AllocationCallbacks& allocator ) const + void destroySurfaceKHR( SurfaceKHR surface, vk::Optional const & allocator ) const { - vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( &allocator ) ); + vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -22746,10 +22760,10 @@ namespace vk #ifdef VKCPP_ENHANCED_MODE #ifdef VK_USE_PLATFORM_WAYLAND_KHR - SurfaceKHR createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SurfaceKHR createWaylandSurfaceKHR( const WaylandSurfaceCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &surface ) ) ); + Result result = static_cast( vkCreateWaylandSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createWaylandSurfaceKHR" ); @@ -22768,10 +22782,10 @@ namespace vk #ifdef VKCPP_ENHANCED_MODE #ifdef VK_USE_PLATFORM_WIN32_KHR - SurfaceKHR createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SurfaceKHR createWin32SurfaceKHR( const Win32SurfaceCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &surface ) ) ); + Result result = static_cast( vkCreateWin32SurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createWin32SurfaceKHR" ); @@ -22790,10 +22804,10 @@ namespace vk #ifdef VKCPP_ENHANCED_MODE #ifdef VK_USE_PLATFORM_XLIB_KHR - SurfaceKHR createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SurfaceKHR createXlibSurfaceKHR( const XlibSurfaceCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &surface ) ) ); + Result result = static_cast( vkCreateXlibSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createXlibSurfaceKHR" ); @@ -22812,10 +22826,10 @@ namespace vk #ifdef VKCPP_ENHANCED_MODE #ifdef VK_USE_PLATFORM_XCB_KHR - SurfaceKHR createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR& createInfo, const AllocationCallbacks& allocator ) const + SurfaceKHR createXcbSurfaceKHR( const XcbSurfaceCreateInfoKHR& createInfo, vk::Optional const & allocator ) const { SurfaceKHR surface; - Result result = static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &surface ) ) ); + Result result = static_cast( vkCreateXcbSurfaceKHR( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &surface ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createXcbSurfaceKHR" ); @@ -22831,10 +22845,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - DebugReportCallbackEXT createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT& createInfo, const AllocationCallbacks& allocator ) const + DebugReportCallbackEXT createDebugReportCallbackEXT( const DebugReportCallbackCreateInfoEXT& createInfo, vk::Optional const & allocator ) const { DebugReportCallbackEXT callback; - Result result = static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &callback ) ) ); + Result result = static_cast( vkCreateDebugReportCallbackEXT( m_instance, reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &callback ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::Instance::createDebugReportCallbackEXT" ); @@ -22849,9 +22863,9 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, const AllocationCallbacks& allocator ) const + void destroyDebugReportCallbackEXT( DebugReportCallbackEXT callback, vk::Optional const & allocator ) const { - vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( &allocator ) ); + vkDestroyDebugReportCallbackEXT( m_instance, static_cast( callback ), reinterpret_cast( static_cast( allocator)) ); } #endif /*VKCPP_ENHANCED_MODE*/ @@ -22902,10 +22916,10 @@ namespace vk } #ifdef VKCPP_ENHANCED_MODE - inline Instance createInstance( const InstanceCreateInfo& createInfo, const AllocationCallbacks& allocator ) + inline Instance createInstance( const InstanceCreateInfo& createInfo, vk::Optional const & allocator ) { Instance instance; - Result result = static_cast( vkCreateInstance( reinterpret_cast( &createInfo ), reinterpret_cast( &allocator ), reinterpret_cast( &instance ) ) ); + Result result = static_cast( vkCreateInstance( reinterpret_cast( &createInfo ), reinterpret_cast( static_cast( allocator)), reinterpret_cast( &instance ) ) ); if ( result != Result::eSuccess ) { throw std::system_error( result, "vk::createInstance" );