1/* WARNING: This is auto-generated file. Do not modify, since changes will 2 * be lost! Modify the generating script instead. 3 */ 4 5inline VkAllocationCallbacks makeAllocationCallbacks (void* pUserData, PFN_vkAllocationFunction pfnAllocation, PFN_vkReallocationFunction pfnReallocation, PFN_vkFreeFunction pfnFree, PFN_vkInternalAllocationNotification pfnInternalAllocation, PFN_vkInternalFreeNotification pfnInternalFree) 6{ 7 VkAllocationCallbacks res; 8 res.pUserData = pUserData; 9 res.pfnAllocation = pfnAllocation; 10 res.pfnReallocation = pfnReallocation; 11 res.pfnFree = pfnFree; 12 res.pfnInternalAllocation = pfnInternalAllocation; 13 res.pfnInternalFree = pfnInternalFree; 14 return res; 15} 16 17inline VkExtent3D makeExtent3D (deUint32 width, deUint32 height, deUint32 depth) 18{ 19 VkExtent3D res; 20 res.width = width; 21 res.height = height; 22 res.depth = depth; 23 return res; 24} 25 26inline VkMemoryRequirements makeMemoryRequirements (VkDeviceSize size, VkDeviceSize alignment, deUint32 memoryTypeBits) 27{ 28 VkMemoryRequirements res; 29 res.size = size; 30 res.alignment = alignment; 31 res.memoryTypeBits = memoryTypeBits; 32 return res; 33} 34 35inline VkSparseMemoryBind makeSparseMemoryBind (VkDeviceSize resourceOffset, VkDeviceSize size, VkDeviceMemory memory, VkDeviceSize memoryOffset, VkSparseMemoryBindFlags flags) 36{ 37 VkSparseMemoryBind res; 38 res.resourceOffset = resourceOffset; 39 res.size = size; 40 res.memory = memory; 41 res.memoryOffset = memoryOffset; 42 res.flags = flags; 43 return res; 44} 45 46inline VkSparseBufferMemoryBindInfo makeSparseBufferMemoryBindInfo (VkBuffer buffer, deUint32 bindCount, const VkSparseMemoryBind* pBinds) 47{ 48 VkSparseBufferMemoryBindInfo res; 49 res.buffer = buffer; 50 res.bindCount = bindCount; 51 res.pBinds = pBinds; 52 return res; 53} 54 55inline VkSparseImageOpaqueMemoryBindInfo makeSparseImageOpaqueMemoryBindInfo (VkImage image, deUint32 bindCount, const VkSparseMemoryBind* pBinds) 56{ 57 VkSparseImageOpaqueMemoryBindInfo res; 58 res.image = image; 59 res.bindCount = bindCount; 60 res.pBinds = pBinds; 61 return res; 62} 63 64inline VkImageSubresource makeImageSubresource (VkImageAspectFlags aspectMask, deUint32 mipLevel, deUint32 arrayLayer) 65{ 66 VkImageSubresource res; 67 res.aspectMask = aspectMask; 68 res.mipLevel = mipLevel; 69 res.arrayLayer = arrayLayer; 70 return res; 71} 72 73inline VkOffset3D makeOffset3D (deInt32 x, deInt32 y, deInt32 z) 74{ 75 VkOffset3D res; 76 res.x = x; 77 res.y = y; 78 res.z = z; 79 return res; 80} 81 82inline VkSparseImageMemoryBindInfo makeSparseImageMemoryBindInfo (VkImage image, deUint32 bindCount, const VkSparseImageMemoryBind* pBinds) 83{ 84 VkSparseImageMemoryBindInfo res; 85 res.image = image; 86 res.bindCount = bindCount; 87 res.pBinds = pBinds; 88 return res; 89} 90 91inline VkSubresourceLayout makeSubresourceLayout (VkDeviceSize offset, VkDeviceSize size, VkDeviceSize rowPitch, VkDeviceSize arrayPitch, VkDeviceSize depthPitch) 92{ 93 VkSubresourceLayout res; 94 res.offset = offset; 95 res.size = size; 96 res.rowPitch = rowPitch; 97 res.arrayPitch = arrayPitch; 98 res.depthPitch = depthPitch; 99 return res; 100} 101 102inline VkComponentMapping makeComponentMapping (VkComponentSwizzle r, VkComponentSwizzle g, VkComponentSwizzle b, VkComponentSwizzle a) 103{ 104 VkComponentMapping res; 105 res.r = r; 106 res.g = g; 107 res.b = b; 108 res.a = a; 109 return res; 110} 111 112inline VkImageSubresourceRange makeImageSubresourceRange (VkImageAspectFlags aspectMask, deUint32 baseMipLevel, deUint32 levelCount, deUint32 baseArrayLayer, deUint32 layerCount) 113{ 114 VkImageSubresourceRange res; 115 res.aspectMask = aspectMask; 116 res.baseMipLevel = baseMipLevel; 117 res.levelCount = levelCount; 118 res.baseArrayLayer = baseArrayLayer; 119 res.layerCount = layerCount; 120 return res; 121} 122 123inline VkSpecializationMapEntry makeSpecializationMapEntry (deUint32 constantID, deUint32 offset, deUintptr size) 124{ 125 VkSpecializationMapEntry res; 126 res.constantID = constantID; 127 res.offset = offset; 128 res.size = size; 129 return res; 130} 131 132inline VkSpecializationInfo makeSpecializationInfo (deUint32 mapEntryCount, const VkSpecializationMapEntry* pMapEntries, deUintptr dataSize, const void* pData) 133{ 134 VkSpecializationInfo res; 135 res.mapEntryCount = mapEntryCount; 136 res.pMapEntries = pMapEntries; 137 res.dataSize = dataSize; 138 res.pData = pData; 139 return res; 140} 141 142inline VkVertexInputBindingDescription makeVertexInputBindingDescription (deUint32 binding, deUint32 stride, VkVertexInputRate inputRate) 143{ 144 VkVertexInputBindingDescription res; 145 res.binding = binding; 146 res.stride = stride; 147 res.inputRate = inputRate; 148 return res; 149} 150 151inline VkVertexInputAttributeDescription makeVertexInputAttributeDescription (deUint32 location, deUint32 binding, VkFormat format, deUint32 offset) 152{ 153 VkVertexInputAttributeDescription res; 154 res.location = location; 155 res.binding = binding; 156 res.format = format; 157 res.offset = offset; 158 return res; 159} 160 161inline VkViewport makeViewport (float x, float y, float width, float height, float minDepth, float maxDepth) 162{ 163 VkViewport res; 164 res.x = x; 165 res.y = y; 166 res.width = width; 167 res.height = height; 168 res.minDepth = minDepth; 169 res.maxDepth = maxDepth; 170 return res; 171} 172 173inline VkOffset2D makeOffset2D (deInt32 x, deInt32 y) 174{ 175 VkOffset2D res; 176 res.x = x; 177 res.y = y; 178 return res; 179} 180 181inline VkExtent2D makeExtent2D (deUint32 width, deUint32 height) 182{ 183 VkExtent2D res; 184 res.width = width; 185 res.height = height; 186 return res; 187} 188 189inline VkStencilOpState makeStencilOpState (VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp, deUint32 compareMask, deUint32 writeMask, deUint32 reference) 190{ 191 VkStencilOpState res; 192 res.failOp = failOp; 193 res.passOp = passOp; 194 res.depthFailOp = depthFailOp; 195 res.compareOp = compareOp; 196 res.compareMask = compareMask; 197 res.writeMask = writeMask; 198 res.reference = reference; 199 return res; 200} 201 202inline VkPipelineColorBlendAttachmentState makePipelineColorBlendAttachmentState (VkBool32 blendEnable, VkBlendFactor srcColorBlendFactor, VkBlendFactor dstColorBlendFactor, VkBlendOp colorBlendOp, VkBlendFactor srcAlphaBlendFactor, VkBlendFactor dstAlphaBlendFactor, VkBlendOp alphaBlendOp, VkColorComponentFlags colorWriteMask) 203{ 204 VkPipelineColorBlendAttachmentState res; 205 res.blendEnable = blendEnable; 206 res.srcColorBlendFactor = srcColorBlendFactor; 207 res.dstColorBlendFactor = dstColorBlendFactor; 208 res.colorBlendOp = colorBlendOp; 209 res.srcAlphaBlendFactor = srcAlphaBlendFactor; 210 res.dstAlphaBlendFactor = dstAlphaBlendFactor; 211 res.alphaBlendOp = alphaBlendOp; 212 res.colorWriteMask = colorWriteMask; 213 return res; 214} 215 216inline VkPushConstantRange makePushConstantRange (VkShaderStageFlags stageFlags, deUint32 offset, deUint32 size) 217{ 218 VkPushConstantRange res; 219 res.stageFlags = stageFlags; 220 res.offset = offset; 221 res.size = size; 222 return res; 223} 224 225inline VkDescriptorSetLayoutBinding makeDescriptorSetLayoutBinding (deUint32 binding, VkDescriptorType descriptorType, deUint32 descriptorCount, VkShaderStageFlags stageFlags, const VkSampler* pImmutableSamplers) 226{ 227 VkDescriptorSetLayoutBinding res; 228 res.binding = binding; 229 res.descriptorType = descriptorType; 230 res.descriptorCount = descriptorCount; 231 res.stageFlags = stageFlags; 232 res.pImmutableSamplers = pImmutableSamplers; 233 return res; 234} 235 236inline VkDescriptorPoolSize makeDescriptorPoolSize (VkDescriptorType type, deUint32 descriptorCount) 237{ 238 VkDescriptorPoolSize res; 239 res.type = type; 240 res.descriptorCount = descriptorCount; 241 return res; 242} 243 244inline VkDescriptorImageInfo makeDescriptorImageInfo (VkSampler sampler, VkImageView imageView, VkImageLayout imageLayout) 245{ 246 VkDescriptorImageInfo res; 247 res.sampler = sampler; 248 res.imageView = imageView; 249 res.imageLayout = imageLayout; 250 return res; 251} 252 253inline VkDescriptorBufferInfo makeDescriptorBufferInfo (VkBuffer buffer, VkDeviceSize offset, VkDeviceSize range) 254{ 255 VkDescriptorBufferInfo res; 256 res.buffer = buffer; 257 res.offset = offset; 258 res.range = range; 259 return res; 260} 261 262inline VkAttachmentDescription makeAttachmentDescription (VkAttachmentDescriptionFlags flags, VkFormat format, VkSampleCountFlagBits samples, VkAttachmentLoadOp loadOp, VkAttachmentStoreOp storeOp, VkAttachmentLoadOp stencilLoadOp, VkAttachmentStoreOp stencilStoreOp, VkImageLayout initialLayout, VkImageLayout finalLayout) 263{ 264 VkAttachmentDescription res; 265 res.flags = flags; 266 res.format = format; 267 res.samples = samples; 268 res.loadOp = loadOp; 269 res.storeOp = storeOp; 270 res.stencilLoadOp = stencilLoadOp; 271 res.stencilStoreOp = stencilStoreOp; 272 res.initialLayout = initialLayout; 273 res.finalLayout = finalLayout; 274 return res; 275} 276 277inline VkAttachmentReference makeAttachmentReference (deUint32 attachment, VkImageLayout layout) 278{ 279 VkAttachmentReference res; 280 res.attachment = attachment; 281 res.layout = layout; 282 return res; 283} 284 285inline VkSubpassDescription makeSubpassDescription (VkSubpassDescriptionFlags flags, VkPipelineBindPoint pipelineBindPoint, deUint32 inputAttachmentCount, const VkAttachmentReference* pInputAttachments, deUint32 colorAttachmentCount, const VkAttachmentReference* pColorAttachments, const VkAttachmentReference* pResolveAttachments, const VkAttachmentReference* pDepthStencilAttachment, deUint32 preserveAttachmentCount, const deUint32* pPreserveAttachments) 286{ 287 VkSubpassDescription res; 288 res.flags = flags; 289 res.pipelineBindPoint = pipelineBindPoint; 290 res.inputAttachmentCount = inputAttachmentCount; 291 res.pInputAttachments = pInputAttachments; 292 res.colorAttachmentCount = colorAttachmentCount; 293 res.pColorAttachments = pColorAttachments; 294 res.pResolveAttachments = pResolveAttachments; 295 res.pDepthStencilAttachment = pDepthStencilAttachment; 296 res.preserveAttachmentCount = preserveAttachmentCount; 297 res.pPreserveAttachments = pPreserveAttachments; 298 return res; 299} 300 301inline VkSubpassDependency makeSubpassDependency (deUint32 srcSubpass, deUint32 dstSubpass, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask, VkDependencyFlags dependencyFlags) 302{ 303 VkSubpassDependency res; 304 res.srcSubpass = srcSubpass; 305 res.dstSubpass = dstSubpass; 306 res.srcStageMask = srcStageMask; 307 res.dstStageMask = dstStageMask; 308 res.srcAccessMask = srcAccessMask; 309 res.dstAccessMask = dstAccessMask; 310 res.dependencyFlags = dependencyFlags; 311 return res; 312} 313 314inline VkBufferCopy makeBufferCopy (VkDeviceSize srcOffset, VkDeviceSize dstOffset, VkDeviceSize size) 315{ 316 VkBufferCopy res; 317 res.srcOffset = srcOffset; 318 res.dstOffset = dstOffset; 319 res.size = size; 320 return res; 321} 322 323inline VkImageSubresourceLayers makeImageSubresourceLayers (VkImageAspectFlags aspectMask, deUint32 mipLevel, deUint32 baseArrayLayer, deUint32 layerCount) 324{ 325 VkImageSubresourceLayers res; 326 res.aspectMask = aspectMask; 327 res.mipLevel = mipLevel; 328 res.baseArrayLayer = baseArrayLayer; 329 res.layerCount = layerCount; 330 return res; 331} 332 333inline VkClearDepthStencilValue makeClearDepthStencilValue (float depth, deUint32 stencil) 334{ 335 VkClearDepthStencilValue res; 336 res.depth = depth; 337 res.stencil = stencil; 338 return res; 339} 340 341inline VkDispatchIndirectCommand makeDispatchIndirectCommand (deUint32 x, deUint32 y, deUint32 z) 342{ 343 VkDispatchIndirectCommand res; 344 res.x = x; 345 res.y = y; 346 res.z = z; 347 return res; 348} 349 350inline VkDrawIndexedIndirectCommand makeDrawIndexedIndirectCommand (deUint32 indexCount, deUint32 instanceCount, deUint32 firstIndex, deInt32 vertexOffset, deUint32 firstInstance) 351{ 352 VkDrawIndexedIndirectCommand res; 353 res.indexCount = indexCount; 354 res.instanceCount = instanceCount; 355 res.firstIndex = firstIndex; 356 res.vertexOffset = vertexOffset; 357 res.firstInstance = firstInstance; 358 return res; 359} 360 361inline VkDrawIndirectCommand makeDrawIndirectCommand (deUint32 vertexCount, deUint32 instanceCount, deUint32 firstVertex, deUint32 firstInstance) 362{ 363 VkDrawIndirectCommand res; 364 res.vertexCount = vertexCount; 365 res.instanceCount = instanceCount; 366 res.firstVertex = firstVertex; 367 res.firstInstance = firstInstance; 368 return res; 369} 370 371inline VkSurfaceFormatKHR makeSurfaceFormatKHR (VkFormat format, VkColorSpaceKHR colorSpace) 372{ 373 VkSurfaceFormatKHR res; 374 res.format = format; 375 res.colorSpace = colorSpace; 376 return res; 377} 378 379inline VkDisplayPlanePropertiesKHR makeDisplayPlanePropertiesKHR (VkDisplayKHR currentDisplay, deUint32 currentStackIndex) 380{ 381 VkDisplayPlanePropertiesKHR res; 382 res.currentDisplay = currentDisplay; 383 res.currentStackIndex = currentStackIndex; 384 return res; 385} 386 387inline VkPresentRegionKHR makePresentRegionKHR (deUint32 rectangleCount, const VkRectLayerKHR* pRectangles) 388{ 389 VkPresentRegionKHR res; 390 res.rectangleCount = rectangleCount; 391 res.pRectangles = pRectangles; 392 return res; 393} 394 395inline VkDescriptorUpdateTemplateEntryKHR makeDescriptorUpdateTemplateEntryKHR (deUint32 dstBinding, deUint32 dstArrayElement, deUint32 descriptorCount, VkDescriptorType descriptorType, deUintptr offset, deUintptr stride) 396{ 397 VkDescriptorUpdateTemplateEntryKHR res; 398 res.dstBinding = dstBinding; 399 res.dstArrayElement = dstArrayElement; 400 res.descriptorCount = descriptorCount; 401 res.descriptorType = descriptorType; 402 res.offset = offset; 403 res.stride = stride; 404 return res; 405} 406 407inline VkInputAttachmentAspectReferenceKHR makeInputAttachmentAspectReferenceKHR (deUint32 subpass, deUint32 inputAttachmentIndex, VkImageAspectFlags aspectMask) 408{ 409 VkInputAttachmentAspectReferenceKHR res; 410 res.subpass = subpass; 411 res.inputAttachmentIndex = inputAttachmentIndex; 412 res.aspectMask = aspectMask; 413 return res; 414} 415 416inline VkExternalMemoryPropertiesKHR makeExternalMemoryPropertiesKHR (VkExternalMemoryFeatureFlagsKHR externalMemoryFeatures, VkExternalMemoryHandleTypeFlagsKHR exportFromImportedHandleTypes, VkExternalMemoryHandleTypeFlagsKHR compatibleHandleTypes) 417{ 418 VkExternalMemoryPropertiesKHR res; 419 res.externalMemoryFeatures = externalMemoryFeatures; 420 res.exportFromImportedHandleTypes = exportFromImportedHandleTypes; 421 res.compatibleHandleTypes = compatibleHandleTypes; 422 return res; 423} 424 425inline VkRefreshCycleDurationGOOGLE makeRefreshCycleDurationGOOGLE (deUint64 refreshDuration) 426{ 427 VkRefreshCycleDurationGOOGLE res; 428 res.refreshDuration = refreshDuration; 429 return res; 430} 431 432inline VkPastPresentationTimingGOOGLE makePastPresentationTimingGOOGLE (deUint32 presentID, deUint64 desiredPresentTime, deUint64 actualPresentTime, deUint64 earliestPresentTime, deUint64 presentMargin) 433{ 434 VkPastPresentationTimingGOOGLE res; 435 res.presentID = presentID; 436 res.desiredPresentTime = desiredPresentTime; 437 res.actualPresentTime = actualPresentTime; 438 res.earliestPresentTime = earliestPresentTime; 439 res.presentMargin = presentMargin; 440 return res; 441} 442 443inline VkPresentTimeGOOGLE makePresentTimeGOOGLE (deUint32 presentID, deUint64 desiredPresentTime) 444{ 445 VkPresentTimeGOOGLE res; 446 res.presentID = presentID; 447 res.desiredPresentTime = desiredPresentTime; 448 return res; 449} 450