vkr: validate dynamic arrays of size 0

The decoder gained dynamic array size validation in commit 92b083bb
("vkr: validate array sizes and string lengths") but failed for one
case: fooCount != 0 and pFoo is NULL.  This commit fixes that.

Fixes: 0690ad0b ("vkr: remove some manual NULL checks")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Chia-I Wu 3 years ago
parent 058fa04b1d
commit e5fa2db8b1
  1. 2
      src/venus/venus-protocol/vn_protocol_renderer.h
  2. 6
      src/venus/venus-protocol/vn_protocol_renderer_buffer.h
  3. 76
      src/venus/venus-protocol/vn_protocol_renderer_command_buffer.h
  4. 2
      src/venus/venus-protocol/vn_protocol_renderer_descriptor_pool.h
  5. 18
      src/venus/venus-protocol/vn_protocol_renderer_descriptor_set.h
  6. 6
      src/venus/venus-protocol/vn_protocol_renderer_descriptor_set_layout.h
  7. 2
      src/venus/venus-protocol/vn_protocol_renderer_descriptor_update_template.h
  8. 32
      src/venus/venus-protocol/vn_protocol_renderer_device.h
  9. 4
      src/venus/venus-protocol/vn_protocol_renderer_device_memory.h
  10. 4
      src/venus/venus-protocol/vn_protocol_renderer_fence.h
  11. 6
      src/venus/venus-protocol/vn_protocol_renderer_framebuffer.h
  12. 16
      src/venus/venus-protocol/vn_protocol_renderer_image.h
  13. 14
      src/venus/venus-protocol/vn_protocol_renderer_instance.h
  14. 30
      src/venus/venus-protocol/vn_protocol_renderer_pipeline.h
  15. 6
      src/venus/venus-protocol/vn_protocol_renderer_pipeline_cache.h
  16. 4
      src/venus/venus-protocol/vn_protocol_renderer_pipeline_layout.h
  17. 2
      src/venus/venus-protocol/vn_protocol_renderer_query_pool.h
  18. 38
      src/venus/venus-protocol/vn_protocol_renderer_queue.h
  19. 38
      src/venus/venus-protocol/vn_protocol_renderer_render_pass.h
  20. 4
      src/venus/venus-protocol/vn_protocol_renderer_semaphore.h
  21. 2
      src/venus/venus-protocol/vn_protocol_renderer_shader_module.h
  22. 2
      src/venus/venus-protocol/vn_protocol_renderer_structs.h
  23. 8
      src/venus/venus-protocol/vn_protocol_renderer_transport.h

@ -1,4 +1,4 @@
/* This file is generated by venus-protocol git-e652be12. */ /* This file is generated by venus-protocol git-ab2774c8. */
/* /*
* Copyright 2020 Google LLC * Copyright 2020 Google LLC

@ -182,7 +182,7 @@ vn_decode_VkBufferCreateInfo_self_temp(struct vn_cs_decoder *dec, VkBufferCreate
if (!val->pQueueFamilyIndices) return; if (!val->pQueueFamilyIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pQueueFamilyIndices, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pQueueFamilyIndices, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pQueueFamilyIndices = NULL; val->pQueueFamilyIndices = NULL;
} }
} }
@ -288,7 +288,7 @@ vn_decode_VkBindBufferMemoryDeviceGroupInfo_self_temp(struct vn_cs_decoder *dec,
if (!val->pDeviceIndices) return; if (!val->pDeviceIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pDeviceIndices, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pDeviceIndices, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->deviceIndexCount);
val->pDeviceIndices = NULL; val->pDeviceIndices = NULL;
} }
} }
@ -738,7 +738,7 @@ static inline void vn_decode_vkBindBufferMemory2_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBindBufferMemoryInfo_temp(dec, &((VkBindBufferMemoryInfo *)args->pBindInfos)[i]); vn_decode_VkBindBufferMemoryInfo_temp(dec, &((VkBindBufferMemoryInfo *)args->pBindInfos)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bindInfoCount);
args->pBindInfos = NULL; args->pBindInfos = NULL;
} }
} }

@ -843,7 +843,7 @@ vn_decode_VkDeviceGroupRenderPassBeginInfo_self_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkRect2D_temp(dec, &((VkRect2D *)val->pDeviceRenderAreas)[i]); vn_decode_VkRect2D_temp(dec, &((VkRect2D *)val->pDeviceRenderAreas)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->deviceRenderAreaCount);
val->pDeviceRenderAreas = NULL; val->pDeviceRenderAreas = NULL;
} }
} }
@ -915,7 +915,7 @@ vn_decode_VkRenderPassAttachmentBeginInfo_self_temp(struct vn_cs_decoder *dec, V
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageView_lookup(dec, &((VkImageView *)val->pAttachments)[i]); vn_decode_VkImageView_lookup(dec, &((VkImageView *)val->pAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->attachmentCount);
val->pAttachments = NULL; val->pAttachments = NULL;
} }
} }
@ -1017,7 +1017,7 @@ vn_decode_VkRenderPassBeginInfo_self_temp(struct vn_cs_decoder *dec, VkRenderPas
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkClearValue_temp(dec, &((VkClearValue *)val->pClearValues)[i]); vn_decode_VkClearValue_temp(dec, &((VkClearValue *)val->pClearValues)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pClearValues = NULL; val->pClearValues = NULL;
} }
} }
@ -1201,7 +1201,7 @@ static inline void vn_decode_vkAllocateCommandBuffers_args_temp(struct vn_cs_dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkCommandBuffer_temp(dec, &args->pCommandBuffers[i]); vn_decode_VkCommandBuffer_temp(dec, &args->pCommandBuffers[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, (args->pAllocateInfo ? args->pAllocateInfo->commandBufferCount : 0));
args->pCommandBuffers = NULL; args->pCommandBuffers = NULL;
} }
} }
@ -1242,7 +1242,7 @@ static inline void vn_decode_vkFreeCommandBuffers_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkCommandBuffer_lookup(dec, &((VkCommandBuffer *)args->pCommandBuffers)[i]); vn_decode_VkCommandBuffer_lookup(dec, &((VkCommandBuffer *)args->pCommandBuffers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pCommandBuffers = NULL; args->pCommandBuffers = NULL;
} }
} }
@ -1371,7 +1371,7 @@ static inline void vn_decode_vkCmdSetViewport_args_temp(struct vn_cs_decoder *de
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkViewport_temp(dec, &((VkViewport *)args->pViewports)[i]); vn_decode_VkViewport_temp(dec, &((VkViewport *)args->pViewports)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->viewportCount);
args->pViewports = NULL; args->pViewports = NULL;
} }
} }
@ -1409,7 +1409,7 @@ static inline void vn_decode_vkCmdSetScissor_args_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkRect2D_temp(dec, &((VkRect2D *)args->pScissors)[i]); vn_decode_VkRect2D_temp(dec, &((VkRect2D *)args->pScissors)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->scissorCount);
args->pScissors = NULL; args->pScissors = NULL;
} }
} }
@ -1610,7 +1610,7 @@ static inline void vn_decode_vkCmdBindDescriptorSets_args_temp(struct vn_cs_deco
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorSet_lookup(dec, &((VkDescriptorSet *)args->pDescriptorSets)[i]); vn_decode_VkDescriptorSet_lookup(dec, &((VkDescriptorSet *)args->pDescriptorSets)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->descriptorSetCount);
args->pDescriptorSets = NULL; args->pDescriptorSets = NULL;
} }
vn_decode_uint32_t(dec, &args->dynamicOffsetCount); vn_decode_uint32_t(dec, &args->dynamicOffsetCount);
@ -1620,7 +1620,7 @@ static inline void vn_decode_vkCmdBindDescriptorSets_args_temp(struct vn_cs_deco
if (!args->pDynamicOffsets) return; if (!args->pDynamicOffsets) return;
vn_decode_uint32_t_array(dec, (uint32_t *)args->pDynamicOffsets, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)args->pDynamicOffsets, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->dynamicOffsetCount);
args->pDynamicOffsets = NULL; args->pDynamicOffsets = NULL;
} }
} }
@ -1692,7 +1692,7 @@ static inline void vn_decode_vkCmdBindVertexBuffers_args_temp(struct vn_cs_decod
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pBuffers)[i]); vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pBuffers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bindingCount);
args->pBuffers = NULL; args->pBuffers = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -1701,7 +1701,7 @@ static inline void vn_decode_vkCmdBindVertexBuffers_args_temp(struct vn_cs_decod
if (!args->pOffsets) return; if (!args->pOffsets) return;
vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pOffsets, array_size); vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pOffsets, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bindingCount);
args->pOffsets = NULL; args->pOffsets = NULL;
} }
} }
@ -1910,7 +1910,7 @@ static inline void vn_decode_vkCmdCopyBuffer_args_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBufferCopy_temp(dec, &((VkBufferCopy *)args->pRegions)[i]); vn_decode_VkBufferCopy_temp(dec, &((VkBufferCopy *)args->pRegions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->regionCount);
args->pRegions = NULL; args->pRegions = NULL;
} }
} }
@ -1953,7 +1953,7 @@ static inline void vn_decode_vkCmdCopyImage_args_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageCopy_temp(dec, &((VkImageCopy *)args->pRegions)[i]); vn_decode_VkImageCopy_temp(dec, &((VkImageCopy *)args->pRegions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->regionCount);
args->pRegions = NULL; args->pRegions = NULL;
} }
} }
@ -2000,7 +2000,7 @@ static inline void vn_decode_vkCmdBlitImage_args_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageBlit_temp(dec, &((VkImageBlit *)args->pRegions)[i]); vn_decode_VkImageBlit_temp(dec, &((VkImageBlit *)args->pRegions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->regionCount);
args->pRegions = NULL; args->pRegions = NULL;
} }
vn_decode_VkFilter(dec, &args->filter); vn_decode_VkFilter(dec, &args->filter);
@ -2049,7 +2049,7 @@ static inline void vn_decode_vkCmdCopyBufferToImage_args_temp(struct vn_cs_decod
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBufferImageCopy_temp(dec, &((VkBufferImageCopy *)args->pRegions)[i]); vn_decode_VkBufferImageCopy_temp(dec, &((VkBufferImageCopy *)args->pRegions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->regionCount);
args->pRegions = NULL; args->pRegions = NULL;
} }
} }
@ -2093,7 +2093,7 @@ static inline void vn_decode_vkCmdCopyImageToBuffer_args_temp(struct vn_cs_decod
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBufferImageCopy_temp(dec, &((VkBufferImageCopy *)args->pRegions)[i]); vn_decode_VkBufferImageCopy_temp(dec, &((VkBufferImageCopy *)args->pRegions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->regionCount);
args->pRegions = NULL; args->pRegions = NULL;
} }
} }
@ -2135,7 +2135,7 @@ static inline void vn_decode_vkCmdUpdateBuffer_args_temp(struct vn_cs_decoder *d
if (!args->pData) return; if (!args->pData) return;
vn_decode_blob_array(dec, (void *)args->pData, array_size); vn_decode_blob_array(dec, (void *)args->pData, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->dataSize);
args->pData = NULL; args->pData = NULL;
} }
} }
@ -2209,7 +2209,7 @@ static inline void vn_decode_vkCmdClearColorImage_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageSubresourceRange_temp(dec, &((VkImageSubresourceRange *)args->pRanges)[i]); vn_decode_VkImageSubresourceRange_temp(dec, &((VkImageSubresourceRange *)args->pRanges)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->rangeCount);
args->pRanges = NULL; args->pRanges = NULL;
} }
} }
@ -2260,7 +2260,7 @@ static inline void vn_decode_vkCmdClearDepthStencilImage_args_temp(struct vn_cs_
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageSubresourceRange_temp(dec, &((VkImageSubresourceRange *)args->pRanges)[i]); vn_decode_VkImageSubresourceRange_temp(dec, &((VkImageSubresourceRange *)args->pRanges)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->rangeCount);
args->pRanges = NULL; args->pRanges = NULL;
} }
} }
@ -2302,7 +2302,7 @@ static inline void vn_decode_vkCmdClearAttachments_args_temp(struct vn_cs_decode
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkClearAttachment_temp(dec, &((VkClearAttachment *)args->pAttachments)[i]); vn_decode_VkClearAttachment_temp(dec, &((VkClearAttachment *)args->pAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->attachmentCount);
args->pAttachments = NULL; args->pAttachments = NULL;
} }
vn_decode_uint32_t(dec, &args->rectCount); vn_decode_uint32_t(dec, &args->rectCount);
@ -2313,7 +2313,7 @@ static inline void vn_decode_vkCmdClearAttachments_args_temp(struct vn_cs_decode
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkClearRect_temp(dec, &((VkClearRect *)args->pRects)[i]); vn_decode_VkClearRect_temp(dec, &((VkClearRect *)args->pRects)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->rectCount);
args->pRects = NULL; args->pRects = NULL;
} }
} }
@ -2359,7 +2359,7 @@ static inline void vn_decode_vkCmdResolveImage_args_temp(struct vn_cs_decoder *d
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageResolve_temp(dec, &((VkImageResolve *)args->pRegions)[i]); vn_decode_VkImageResolve_temp(dec, &((VkImageResolve *)args->pRegions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->regionCount);
args->pRegions = NULL; args->pRegions = NULL;
} }
} }
@ -2448,7 +2448,7 @@ static inline void vn_decode_vkCmdWaitEvents_args_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkEvent_lookup(dec, &((VkEvent *)args->pEvents)[i]); vn_decode_VkEvent_lookup(dec, &((VkEvent *)args->pEvents)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->eventCount);
args->pEvents = NULL; args->pEvents = NULL;
} }
vn_decode_VkFlags(dec, &args->srcStageMask); vn_decode_VkFlags(dec, &args->srcStageMask);
@ -2461,7 +2461,7 @@ static inline void vn_decode_vkCmdWaitEvents_args_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkMemoryBarrier_temp(dec, &((VkMemoryBarrier *)args->pMemoryBarriers)[i]); vn_decode_VkMemoryBarrier_temp(dec, &((VkMemoryBarrier *)args->pMemoryBarriers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->memoryBarrierCount);
args->pMemoryBarriers = NULL; args->pMemoryBarriers = NULL;
} }
vn_decode_uint32_t(dec, &args->bufferMemoryBarrierCount); vn_decode_uint32_t(dec, &args->bufferMemoryBarrierCount);
@ -2472,7 +2472,7 @@ static inline void vn_decode_vkCmdWaitEvents_args_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBufferMemoryBarrier_temp(dec, &((VkBufferMemoryBarrier *)args->pBufferMemoryBarriers)[i]); vn_decode_VkBufferMemoryBarrier_temp(dec, &((VkBufferMemoryBarrier *)args->pBufferMemoryBarriers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bufferMemoryBarrierCount);
args->pBufferMemoryBarriers = NULL; args->pBufferMemoryBarriers = NULL;
} }
vn_decode_uint32_t(dec, &args->imageMemoryBarrierCount); vn_decode_uint32_t(dec, &args->imageMemoryBarrierCount);
@ -2483,7 +2483,7 @@ static inline void vn_decode_vkCmdWaitEvents_args_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageMemoryBarrier_temp(dec, &((VkImageMemoryBarrier *)args->pImageMemoryBarriers)[i]); vn_decode_VkImageMemoryBarrier_temp(dec, &((VkImageMemoryBarrier *)args->pImageMemoryBarriers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->imageMemoryBarrierCount);
args->pImageMemoryBarriers = NULL; args->pImageMemoryBarriers = NULL;
} }
} }
@ -2546,7 +2546,7 @@ static inline void vn_decode_vkCmdPipelineBarrier_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkMemoryBarrier_temp(dec, &((VkMemoryBarrier *)args->pMemoryBarriers)[i]); vn_decode_VkMemoryBarrier_temp(dec, &((VkMemoryBarrier *)args->pMemoryBarriers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->memoryBarrierCount);
args->pMemoryBarriers = NULL; args->pMemoryBarriers = NULL;
} }
vn_decode_uint32_t(dec, &args->bufferMemoryBarrierCount); vn_decode_uint32_t(dec, &args->bufferMemoryBarrierCount);
@ -2557,7 +2557,7 @@ static inline void vn_decode_vkCmdPipelineBarrier_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBufferMemoryBarrier_temp(dec, &((VkBufferMemoryBarrier *)args->pBufferMemoryBarriers)[i]); vn_decode_VkBufferMemoryBarrier_temp(dec, &((VkBufferMemoryBarrier *)args->pBufferMemoryBarriers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bufferMemoryBarrierCount);
args->pBufferMemoryBarriers = NULL; args->pBufferMemoryBarriers = NULL;
} }
vn_decode_uint32_t(dec, &args->imageMemoryBarrierCount); vn_decode_uint32_t(dec, &args->imageMemoryBarrierCount);
@ -2568,7 +2568,7 @@ static inline void vn_decode_vkCmdPipelineBarrier_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageMemoryBarrier_temp(dec, &((VkImageMemoryBarrier *)args->pImageMemoryBarriers)[i]); vn_decode_VkImageMemoryBarrier_temp(dec, &((VkImageMemoryBarrier *)args->pImageMemoryBarriers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->imageMemoryBarrierCount);
args->pImageMemoryBarriers = NULL; args->pImageMemoryBarriers = NULL;
} }
} }
@ -2764,7 +2764,7 @@ static inline void vn_decode_vkCmdPushConstants_args_temp(struct vn_cs_decoder *
if (!args->pValues) return; if (!args->pValues) return;
vn_decode_blob_array(dec, (void *)args->pValues, array_size); vn_decode_blob_array(dec, (void *)args->pValues, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->size);
args->pValues = NULL; args->pValues = NULL;
} }
} }
@ -2870,7 +2870,7 @@ static inline void vn_decode_vkCmdExecuteCommands_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkCommandBuffer_lookup(dec, &((VkCommandBuffer *)args->pCommandBuffers)[i]); vn_decode_VkCommandBuffer_lookup(dec, &((VkCommandBuffer *)args->pCommandBuffers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->commandBufferCount);
args->pCommandBuffers = NULL; args->pCommandBuffers = NULL;
} }
} }
@ -3137,7 +3137,7 @@ static inline void vn_decode_vkCmdBindTransformFeedbackBuffersEXT_args_temp(stru
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pBuffers)[i]); vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pBuffers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bindingCount);
args->pBuffers = NULL; args->pBuffers = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -3146,7 +3146,7 @@ static inline void vn_decode_vkCmdBindTransformFeedbackBuffersEXT_args_temp(stru
if (!args->pOffsets) return; if (!args->pOffsets) return;
vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pOffsets, array_size); vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pOffsets, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bindingCount);
args->pOffsets = NULL; args->pOffsets = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -3155,7 +3155,7 @@ static inline void vn_decode_vkCmdBindTransformFeedbackBuffersEXT_args_temp(stru
if (!args->pSizes) return; if (!args->pSizes) return;
vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pSizes, array_size); vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pSizes, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pSizes = NULL; args->pSizes = NULL;
} }
} }
@ -3197,7 +3197,7 @@ static inline void vn_decode_vkCmdBeginTransformFeedbackEXT_args_temp(struct vn_
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pCounterBuffers)[i]); vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pCounterBuffers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pCounterBuffers = NULL; args->pCounterBuffers = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -3206,7 +3206,7 @@ static inline void vn_decode_vkCmdBeginTransformFeedbackEXT_args_temp(struct vn_
if (!args->pCounterBufferOffsets) return; if (!args->pCounterBufferOffsets) return;
vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pCounterBufferOffsets, array_size); vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pCounterBufferOffsets, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pCounterBufferOffsets = NULL; args->pCounterBufferOffsets = NULL;
} }
} }
@ -3246,7 +3246,7 @@ static inline void vn_decode_vkCmdEndTransformFeedbackEXT_args_temp(struct vn_cs
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pCounterBuffers)[i]); vn_decode_VkBuffer_lookup(dec, &((VkBuffer *)args->pCounterBuffers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pCounterBuffers = NULL; args->pCounterBuffers = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -3255,7 +3255,7 @@ static inline void vn_decode_vkCmdEndTransformFeedbackEXT_args_temp(struct vn_cs
if (!args->pCounterBufferOffsets) return; if (!args->pCounterBufferOffsets) return;
vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pCounterBufferOffsets, array_size); vn_decode_VkDeviceSize_array(dec, (VkDeviceSize *)args->pCounterBufferOffsets, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pCounterBufferOffsets = NULL; args->pCounterBufferOffsets = NULL;
} }
} }

@ -55,7 +55,7 @@ vn_decode_VkDescriptorPoolCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDesc
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorPoolSize_temp(dec, &((VkDescriptorPoolSize *)val->pPoolSizes)[i]); vn_decode_VkDescriptorPoolSize_temp(dec, &((VkDescriptorPoolSize *)val->pPoolSizes)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->poolSizeCount);
val->pPoolSizes = NULL; val->pPoolSizes = NULL;
} }
} }

@ -42,7 +42,7 @@ vn_decode_VkDescriptorSetVariableDescriptorCountAllocateInfo_self_temp(struct vn
if (!val->pDescriptorCounts) return; if (!val->pDescriptorCounts) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pDescriptorCounts, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pDescriptorCounts, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->descriptorSetCount);
val->pDescriptorCounts = NULL; val->pDescriptorCounts = NULL;
} }
} }
@ -131,7 +131,7 @@ vn_decode_VkDescriptorSetAllocateInfo_self_temp(struct vn_cs_decoder *dec, VkDes
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorSetLayout_lookup(dec, &((VkDescriptorSetLayout *)val->pSetLayouts)[i]); vn_decode_VkDescriptorSetLayout_lookup(dec, &((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->descriptorSetCount);
val->pSetLayouts = NULL; val->pSetLayouts = NULL;
} }
} }
@ -246,7 +246,7 @@ vn_decode_VkWriteDescriptorSet_self_temp(struct vn_cs_decoder *dec, VkWriteDescr
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorImageInfo_temp(dec, &((VkDescriptorImageInfo *)val->pImageInfo)[i]); vn_decode_VkDescriptorImageInfo_temp(dec, &((VkDescriptorImageInfo *)val->pImageInfo)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pImageInfo = NULL; val->pImageInfo = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -256,7 +256,7 @@ vn_decode_VkWriteDescriptorSet_self_temp(struct vn_cs_decoder *dec, VkWriteDescr
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorBufferInfo_temp(dec, &((VkDescriptorBufferInfo *)val->pBufferInfo)[i]); vn_decode_VkDescriptorBufferInfo_temp(dec, &((VkDescriptorBufferInfo *)val->pBufferInfo)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pBufferInfo = NULL; val->pBufferInfo = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -266,7 +266,7 @@ vn_decode_VkWriteDescriptorSet_self_temp(struct vn_cs_decoder *dec, VkWriteDescr
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBufferView_lookup(dec, &((VkBufferView *)val->pTexelBufferView)[i]); vn_decode_VkBufferView_lookup(dec, &((VkBufferView *)val->pTexelBufferView)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pTexelBufferView = NULL; val->pTexelBufferView = NULL;
} }
} }
@ -413,7 +413,7 @@ static inline void vn_decode_vkAllocateDescriptorSets_args_temp(struct vn_cs_dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorSet(dec, &args->pDescriptorSets[i]); vn_decode_VkDescriptorSet(dec, &args->pDescriptorSets[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0));
args->pDescriptorSets = NULL; args->pDescriptorSets = NULL;
} }
} }
@ -454,7 +454,7 @@ static inline void vn_decode_vkFreeDescriptorSets_args_temp(struct vn_cs_decoder
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorSet_lookup(dec, &((VkDescriptorSet *)args->pDescriptorSets)[i]); vn_decode_VkDescriptorSet_lookup(dec, &((VkDescriptorSet *)args->pDescriptorSets)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pDescriptorSets = NULL; args->pDescriptorSets = NULL;
} }
} }
@ -492,7 +492,7 @@ static inline void vn_decode_vkUpdateDescriptorSets_args_temp(struct vn_cs_decod
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkWriteDescriptorSet_temp(dec, &((VkWriteDescriptorSet *)args->pDescriptorWrites)[i]); vn_decode_VkWriteDescriptorSet_temp(dec, &((VkWriteDescriptorSet *)args->pDescriptorWrites)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->descriptorWriteCount);
args->pDescriptorWrites = NULL; args->pDescriptorWrites = NULL;
} }
vn_decode_uint32_t(dec, &args->descriptorCopyCount); vn_decode_uint32_t(dec, &args->descriptorCopyCount);
@ -503,7 +503,7 @@ static inline void vn_decode_vkUpdateDescriptorSets_args_temp(struct vn_cs_decod
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkCopyDescriptorSet_temp(dec, &((VkCopyDescriptorSet *)args->pDescriptorCopies)[i]); vn_decode_VkCopyDescriptorSet_temp(dec, &((VkCopyDescriptorSet *)args->pDescriptorCopies)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->descriptorCopyCount);
args->pDescriptorCopies = NULL; args->pDescriptorCopies = NULL;
} }
} }

@ -30,7 +30,7 @@ vn_decode_VkDescriptorSetLayoutBinding_temp(struct vn_cs_decoder *dec, VkDescrip
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSampler_lookup(dec, &((VkSampler *)val->pImmutableSamplers)[i]); vn_decode_VkSampler_lookup(dec, &((VkSampler *)val->pImmutableSamplers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pImmutableSamplers = NULL; val->pImmutableSamplers = NULL;
} }
} }
@ -71,7 +71,7 @@ vn_decode_VkDescriptorSetLayoutBindingFlagsCreateInfo_self_temp(struct vn_cs_dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkFlags(dec, &((VkDescriptorBindingFlags *)val->pBindingFlags)[i]); vn_decode_VkFlags(dec, &((VkDescriptorBindingFlags *)val->pBindingFlags)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->bindingCount);
val->pBindingFlags = NULL; val->pBindingFlags = NULL;
} }
} }
@ -160,7 +160,7 @@ vn_decode_VkDescriptorSetLayoutCreateInfo_self_temp(struct vn_cs_decoder *dec, V
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorSetLayoutBinding_temp(dec, &((VkDescriptorSetLayoutBinding *)val->pBindings)[i]); vn_decode_VkDescriptorSetLayoutBinding_temp(dec, &((VkDescriptorSetLayoutBinding *)val->pBindings)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->bindingCount);
val->pBindings = NULL; val->pBindings = NULL;
} }
} }

@ -62,7 +62,7 @@ vn_decode_VkDescriptorUpdateTemplateCreateInfo_self_temp(struct vn_cs_decoder *d
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorUpdateTemplateEntry_temp(dec, &((VkDescriptorUpdateTemplateEntry *)val->pDescriptorUpdateEntries)[i]); vn_decode_VkDescriptorUpdateTemplateEntry_temp(dec, &((VkDescriptorUpdateTemplateEntry *)val->pDescriptorUpdateEntries)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->descriptorUpdateEntryCount);
val->pDescriptorUpdateEntries = NULL; val->pDescriptorUpdateEntries = NULL;
} }
vn_decode_VkDescriptorUpdateTemplateType(dec, &val->templateType); vn_decode_VkDescriptorUpdateTemplateType(dec, &val->templateType);

@ -694,7 +694,7 @@ vn_decode_VkDeviceQueueCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceQ
if (!val->pQueuePriorities) return; if (!val->pQueuePriorities) return;
vn_decode_float_array(dec, (float *)val->pQueuePriorities, array_size); vn_decode_float_array(dec, (float *)val->pQueuePriorities, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->queueCount);
val->pQueuePriorities = NULL; val->pQueuePriorities = NULL;
} }
} }
@ -4219,7 +4219,7 @@ vn_decode_VkDeviceGroupDeviceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkD
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPhysicalDevice_lookup(dec, &((VkPhysicalDevice *)val->pPhysicalDevices)[i]); vn_decode_VkPhysicalDevice_lookup(dec, &((VkPhysicalDevice *)val->pPhysicalDevices)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->physicalDeviceCount);
val->pPhysicalDevices = NULL; val->pPhysicalDevices = NULL;
} }
} }
@ -4495,7 +4495,7 @@ vn_decode_VkDeviceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceCreate
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDeviceQueueCreateInfo_temp(dec, &((VkDeviceQueueCreateInfo *)val->pQueueCreateInfos)[i]); vn_decode_VkDeviceQueueCreateInfo_temp(dec, &((VkDeviceQueueCreateInfo *)val->pQueueCreateInfos)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->queueCreateInfoCount);
val->pQueueCreateInfos = NULL; val->pQueueCreateInfos = NULL;
} }
vn_decode_uint32_t(dec, &val->enabledLayerCount); vn_decode_uint32_t(dec, &val->enabledLayerCount);
@ -4510,7 +4510,7 @@ vn_decode_VkDeviceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceCreate
vn_decode_char_array(dec, ((char **)val->ppEnabledLayerNames)[i], string_size); vn_decode_char_array(dec, ((char **)val->ppEnabledLayerNames)[i], string_size);
} }
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->enabledLayerCount);
val->ppEnabledLayerNames = NULL; val->ppEnabledLayerNames = NULL;
} }
vn_decode_uint32_t(dec, &val->enabledExtensionCount); vn_decode_uint32_t(dec, &val->enabledExtensionCount);
@ -4525,7 +4525,7 @@ vn_decode_VkDeviceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceCreate
vn_decode_char_array(dec, ((char **)val->ppEnabledExtensionNames)[i], string_size); vn_decode_char_array(dec, ((char **)val->ppEnabledExtensionNames)[i], string_size);
} }
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->enabledExtensionCount);
val->ppEnabledExtensionNames = NULL; val->ppEnabledExtensionNames = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -6112,7 +6112,7 @@ vn_decode_VkDrmFormatModifierPropertiesListEXT_self_partial_temp(struct vn_cs_de
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDrmFormatModifierPropertiesEXT_partial_temp(dec, &val->pDrmFormatModifierProperties[i]); vn_decode_VkDrmFormatModifierPropertiesEXT_partial_temp(dec, &val->pDrmFormatModifierProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pDrmFormatModifierProperties = NULL; val->pDrmFormatModifierProperties = NULL;
} }
} }
@ -6301,7 +6301,7 @@ vn_decode_VkPhysicalDeviceImageDrmFormatModifierInfoEXT_self_temp(struct vn_cs_d
if (!val->pQueueFamilyIndices) return; if (!val->pQueueFamilyIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pQueueFamilyIndices, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pQueueFamilyIndices, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pQueueFamilyIndices = NULL; val->pQueueFamilyIndices = NULL;
} }
} }
@ -7437,7 +7437,7 @@ static inline void vn_decode_vkEnumeratePhysicalDevices_args_temp(struct vn_cs_d
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPhysicalDevice_temp(dec, &args->pPhysicalDevices[i]); vn_decode_VkPhysicalDevice_temp(dec, &args->pPhysicalDevices[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pPhysicalDevices = NULL; args->pPhysicalDevices = NULL;
} }
} }
@ -7512,7 +7512,7 @@ static inline void vn_decode_vkGetPhysicalDeviceQueueFamilyProperties_args_temp(
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkQueueFamilyProperties_partial_temp(dec, &args->pQueueFamilyProperties[i]); vn_decode_VkQueueFamilyProperties_partial_temp(dec, &args->pQueueFamilyProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pQueueFamilyProperties = NULL; args->pQueueFamilyProperties = NULL;
} }
} }
@ -7760,7 +7760,7 @@ static inline void vn_decode_vkEnumerateDeviceLayerProperties_args_temp(struct v
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkLayerProperties_partial_temp(dec, &args->pProperties[i]); vn_decode_VkLayerProperties_partial_temp(dec, &args->pProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pProperties = NULL; args->pProperties = NULL;
} }
} }
@ -7798,7 +7798,7 @@ static inline void vn_decode_vkEnumerateDeviceExtensionProperties_args_temp(stru
if (!args->pLayerName) return; if (!args->pLayerName) return;
vn_decode_char_array(dec, (char *)args->pLayerName, string_size); vn_decode_char_array(dec, (char *)args->pLayerName, string_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pLayerName = NULL; args->pLayerName = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -7816,7 +7816,7 @@ static inline void vn_decode_vkEnumerateDeviceExtensionProperties_args_temp(stru
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkExtensionProperties_partial_temp(dec, &args->pProperties[i]); vn_decode_VkExtensionProperties_partial_temp(dec, &args->pProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pProperties = NULL; args->pProperties = NULL;
} }
} }
@ -7922,7 +7922,7 @@ static inline void vn_decode_vkGetPhysicalDeviceSparseImageFormatProperties_args
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseImageFormatProperties_partial_temp(dec, &args->pProperties[i]); vn_decode_VkSparseImageFormatProperties_partial_temp(dec, &args->pProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pProperties = NULL; args->pProperties = NULL;
} }
} }
@ -8105,7 +8105,7 @@ static inline void vn_decode_vkGetPhysicalDeviceQueueFamilyProperties2_args_temp
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkQueueFamilyProperties2_partial_temp(dec, &args->pQueueFamilyProperties[i]); vn_decode_VkQueueFamilyProperties2_partial_temp(dec, &args->pQueueFamilyProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pQueueFamilyProperties = NULL; args->pQueueFamilyProperties = NULL;
} }
} }
@ -8187,7 +8187,7 @@ static inline void vn_decode_vkGetPhysicalDeviceSparseImageFormatProperties2_arg
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseImageFormatProperties2_partial_temp(dec, &args->pProperties[i]); vn_decode_VkSparseImageFormatProperties2_partial_temp(dec, &args->pProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pProperties = NULL; args->pProperties = NULL;
} }
} }
@ -8353,7 +8353,7 @@ static inline void vn_decode_vkEnumeratePhysicalDeviceGroups_args_temp(struct vn
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPhysicalDeviceGroupProperties_partial_temp(dec, &args->pPhysicalDeviceGroupProperties[i]); vn_decode_VkPhysicalDeviceGroupProperties_partial_temp(dec, &args->pPhysicalDeviceGroupProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pPhysicalDeviceGroupProperties = NULL; args->pPhysicalDeviceGroupProperties = NULL;
} }
} }

@ -709,7 +709,7 @@ static inline void vn_decode_vkFlushMappedMemoryRanges_args_temp(struct vn_cs_de
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]); vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->memoryRangeCount);
args->pMemoryRanges = NULL; args->pMemoryRanges = NULL;
} }
} }
@ -745,7 +745,7 @@ static inline void vn_decode_vkInvalidateMappedMemoryRanges_args_temp(struct vn_
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]); vn_decode_VkMappedMemoryRange_temp(dec, &((VkMappedMemoryRange *)args->pMemoryRanges)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->memoryRangeCount);
args->pMemoryRanges = NULL; args->pMemoryRanges = NULL;
} }
} }

@ -236,7 +236,7 @@ static inline void vn_decode_vkResetFences_args_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkFence_lookup(dec, &((VkFence *)args->pFences)[i]); vn_decode_VkFence_lookup(dec, &((VkFence *)args->pFences)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->fenceCount);
args->pFences = NULL; args->pFences = NULL;
} }
} }
@ -293,7 +293,7 @@ static inline void vn_decode_vkWaitForFences_args_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkFence_lookup(dec, &((VkFence *)args->pFences)[i]); vn_decode_VkFence_lookup(dec, &((VkFence *)args->pFences)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->fenceCount);
args->pFences = NULL; args->pFences = NULL;
} }
vn_decode_VkBool32(dec, &args->waitAll); vn_decode_VkBool32(dec, &args->waitAll);

@ -41,7 +41,7 @@ vn_decode_VkFramebufferAttachmentImageInfo_self_temp(struct vn_cs_decoder *dec,
if (!val->pViewFormats) return; if (!val->pViewFormats) return;
vn_decode_VkFormat_array(dec, (VkFormat *)val->pViewFormats, array_size); vn_decode_VkFormat_array(dec, (VkFormat *)val->pViewFormats, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->viewFormatCount);
val->pViewFormats = NULL; val->pViewFormats = NULL;
} }
} }
@ -114,7 +114,7 @@ vn_decode_VkFramebufferAttachmentsCreateInfo_self_temp(struct vn_cs_decoder *dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkFramebufferAttachmentImageInfo_temp(dec, &((VkFramebufferAttachmentImageInfo *)val->pAttachmentImageInfos)[i]); vn_decode_VkFramebufferAttachmentImageInfo_temp(dec, &((VkFramebufferAttachmentImageInfo *)val->pAttachmentImageInfos)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->attachmentImageInfoCount);
val->pAttachmentImageInfos = NULL; val->pAttachmentImageInfos = NULL;
} }
} }
@ -207,7 +207,7 @@ vn_decode_VkFramebufferCreateInfo_self_temp(struct vn_cs_decoder *dec, VkFramebu
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkImageView_lookup(dec, &((VkImageView *)val->pAttachments)[i]); vn_decode_VkImageView_lookup(dec, &((VkImageView *)val->pAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pAttachments = NULL; val->pAttachments = NULL;
} }
vn_decode_uint32_t(dec, &val->width); vn_decode_uint32_t(dec, &val->width);

@ -115,7 +115,7 @@ vn_decode_VkImageDrmFormatModifierListCreateInfoEXT_self_temp(struct vn_cs_decod
if (!val->pDrmFormatModifiers) return; if (!val->pDrmFormatModifiers) return;
vn_decode_uint64_t_array(dec, (uint64_t *)val->pDrmFormatModifiers, array_size); vn_decode_uint64_t_array(dec, (uint64_t *)val->pDrmFormatModifiers, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->drmFormatModifierCount);
val->pDrmFormatModifiers = NULL; val->pDrmFormatModifiers = NULL;
} }
} }
@ -226,7 +226,7 @@ vn_decode_VkImageDrmFormatModifierExplicitCreateInfoEXT_self_temp(struct vn_cs_d
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSubresourceLayout_temp(dec, &((VkSubresourceLayout *)val->pPlaneLayouts)[i]); vn_decode_VkSubresourceLayout_temp(dec, &((VkSubresourceLayout *)val->pPlaneLayouts)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->drmFormatModifierPlaneCount);
val->pPlaneLayouts = NULL; val->pPlaneLayouts = NULL;
} }
} }
@ -359,7 +359,7 @@ vn_decode_VkImageCreateInfo_self_temp(struct vn_cs_decoder *dec, VkImageCreateIn
if (!val->pQueueFamilyIndices) return; if (!val->pQueueFamilyIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pQueueFamilyIndices, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pQueueFamilyIndices, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pQueueFamilyIndices = NULL; val->pQueueFamilyIndices = NULL;
} }
vn_decode_VkImageLayout(dec, &val->initialLayout); vn_decode_VkImageLayout(dec, &val->initialLayout);
@ -490,7 +490,7 @@ vn_decode_VkBindImageMemoryDeviceGroupInfo_self_temp(struct vn_cs_decoder *dec,
if (!val->pDeviceIndices) return; if (!val->pDeviceIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pDeviceIndices, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pDeviceIndices, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->deviceIndexCount);
val->pDeviceIndices = NULL; val->pDeviceIndices = NULL;
} }
vn_decode_uint32_t(dec, &val->splitInstanceBindRegionCount); vn_decode_uint32_t(dec, &val->splitInstanceBindRegionCount);
@ -501,7 +501,7 @@ vn_decode_VkBindImageMemoryDeviceGroupInfo_self_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkRect2D_temp(dec, &((VkRect2D *)val->pSplitInstanceBindRegions)[i]); vn_decode_VkRect2D_temp(dec, &((VkRect2D *)val->pSplitInstanceBindRegions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->splitInstanceBindRegionCount);
val->pSplitInstanceBindRegions = NULL; val->pSplitInstanceBindRegions = NULL;
} }
} }
@ -1152,7 +1152,7 @@ static inline void vn_decode_vkGetImageSparseMemoryRequirements_args_temp(struct
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseImageMemoryRequirements_partial_temp(dec, &args->pSparseMemoryRequirements[i]); vn_decode_VkSparseImageMemoryRequirements_partial_temp(dec, &args->pSparseMemoryRequirements[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pSparseMemoryRequirements = NULL; args->pSparseMemoryRequirements = NULL;
} }
} }
@ -1309,7 +1309,7 @@ static inline void vn_decode_vkBindImageMemory2_args_temp(struct vn_cs_decoder *
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBindImageMemoryInfo_temp(dec, &((VkBindImageMemoryInfo *)args->pBindInfos)[i]); vn_decode_VkBindImageMemoryInfo_temp(dec, &((VkBindImageMemoryInfo *)args->pBindInfos)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bindInfoCount);
args->pBindInfos = NULL; args->pBindInfos = NULL;
} }
} }
@ -1399,7 +1399,7 @@ static inline void vn_decode_vkGetImageSparseMemoryRequirements2_args_temp(struc
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseImageMemoryRequirements2_partial_temp(dec, &args->pSparseMemoryRequirements[i]); vn_decode_VkSparseImageMemoryRequirements2_partial_temp(dec, &args->pSparseMemoryRequirements[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pSparseMemoryRequirements = NULL; args->pSparseMemoryRequirements = NULL;
} }
} }

@ -41,7 +41,7 @@ vn_decode_VkApplicationInfo_self_temp(struct vn_cs_decoder *dec, VkApplicationIn
if (!val->pApplicationName) return; if (!val->pApplicationName) return;
vn_decode_char_array(dec, (char *)val->pApplicationName, string_size); vn_decode_char_array(dec, (char *)val->pApplicationName, string_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pApplicationName = NULL; val->pApplicationName = NULL;
} }
vn_decode_uint32_t(dec, &val->applicationVersion); vn_decode_uint32_t(dec, &val->applicationVersion);
@ -51,7 +51,7 @@ vn_decode_VkApplicationInfo_self_temp(struct vn_cs_decoder *dec, VkApplicationIn
if (!val->pEngineName) return; if (!val->pEngineName) return;
vn_decode_char_array(dec, (char *)val->pEngineName, string_size); vn_decode_char_array(dec, (char *)val->pEngineName, string_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pEngineName = NULL; val->pEngineName = NULL;
} }
vn_decode_uint32_t(dec, &val->engineVersion); vn_decode_uint32_t(dec, &val->engineVersion);
@ -136,7 +136,7 @@ vn_decode_VkInstanceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkInstanceCr
vn_decode_char_array(dec, ((char **)val->ppEnabledLayerNames)[i], string_size); vn_decode_char_array(dec, ((char **)val->ppEnabledLayerNames)[i], string_size);
} }
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->enabledLayerCount);
val->ppEnabledLayerNames = NULL; val->ppEnabledLayerNames = NULL;
} }
vn_decode_uint32_t(dec, &val->enabledExtensionCount); vn_decode_uint32_t(dec, &val->enabledExtensionCount);
@ -151,7 +151,7 @@ vn_decode_VkInstanceCreateInfo_self_temp(struct vn_cs_decoder *dec, VkInstanceCr
vn_decode_char_array(dec, ((char **)val->ppEnabledExtensionNames)[i], string_size); vn_decode_char_array(dec, ((char **)val->ppEnabledExtensionNames)[i], string_size);
} }
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->enabledExtensionCount);
val->ppEnabledExtensionNames = NULL; val->ppEnabledExtensionNames = NULL;
} }
} }
@ -311,7 +311,7 @@ static inline void vn_decode_vkEnumerateInstanceLayerProperties_args_temp(struct
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkLayerProperties_partial_temp(dec, &args->pProperties[i]); vn_decode_VkLayerProperties_partial_temp(dec, &args->pProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pProperties = NULL; args->pProperties = NULL;
} }
} }
@ -346,7 +346,7 @@ static inline void vn_decode_vkEnumerateInstanceExtensionProperties_args_temp(st
if (!args->pLayerName) return; if (!args->pLayerName) return;
vn_decode_char_array(dec, (char *)args->pLayerName, string_size); vn_decode_char_array(dec, (char *)args->pLayerName, string_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pLayerName = NULL; args->pLayerName = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -364,7 +364,7 @@ static inline void vn_decode_vkEnumerateInstanceExtensionProperties_args_temp(st
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkExtensionProperties_partial_temp(dec, &args->pProperties[i]); vn_decode_VkExtensionProperties_partial_temp(dec, &args->pProperties[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pProperties = NULL; args->pProperties = NULL;
} }
} }

@ -45,7 +45,7 @@ vn_decode_VkSpecializationInfo_temp(struct vn_cs_decoder *dec, VkSpecializationI
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSpecializationMapEntry_temp(dec, &((VkSpecializationMapEntry *)val->pMapEntries)[i]); vn_decode_VkSpecializationMapEntry_temp(dec, &((VkSpecializationMapEntry *)val->pMapEntries)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->mapEntryCount);
val->pMapEntries = NULL; val->pMapEntries = NULL;
} }
vn_decode_size_t(dec, &val->dataSize); vn_decode_size_t(dec, &val->dataSize);
@ -55,7 +55,7 @@ vn_decode_VkSpecializationInfo_temp(struct vn_cs_decoder *dec, VkSpecializationI
if (!val->pData) return; if (!val->pData) return;
vn_decode_blob_array(dec, (void *)val->pData, array_size); vn_decode_blob_array(dec, (void *)val->pData, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->dataSize);
val->pData = NULL; val->pData = NULL;
} }
} }
@ -96,7 +96,7 @@ vn_decode_VkPipelineShaderStageCreateInfo_self_temp(struct vn_cs_decoder *dec, V
if (!val->pName) return; if (!val->pName) return;
vn_decode_char_array(dec, (char *)val->pName, string_size); vn_decode_char_array(dec, (char *)val->pName, string_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, strlen(val->pName) + 1);
val->pName = NULL; val->pName = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -214,7 +214,7 @@ vn_decode_VkPipelineVertexInputStateCreateInfo_self_temp(struct vn_cs_decoder *d
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkVertexInputBindingDescription_temp(dec, &((VkVertexInputBindingDescription *)val->pVertexBindingDescriptions)[i]); vn_decode_VkVertexInputBindingDescription_temp(dec, &((VkVertexInputBindingDescription *)val->pVertexBindingDescriptions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->vertexBindingDescriptionCount);
val->pVertexBindingDescriptions = NULL; val->pVertexBindingDescriptions = NULL;
} }
vn_decode_uint32_t(dec, &val->vertexAttributeDescriptionCount); vn_decode_uint32_t(dec, &val->vertexAttributeDescriptionCount);
@ -225,7 +225,7 @@ vn_decode_VkPipelineVertexInputStateCreateInfo_self_temp(struct vn_cs_decoder *d
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkVertexInputAttributeDescription_temp(dec, &((VkVertexInputAttributeDescription *)val->pVertexAttributeDescriptions)[i]); vn_decode_VkVertexInputAttributeDescription_temp(dec, &((VkVertexInputAttributeDescription *)val->pVertexAttributeDescriptions)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->vertexAttributeDescriptionCount);
val->pVertexAttributeDescriptions = NULL; val->pVertexAttributeDescriptions = NULL;
} }
} }
@ -503,7 +503,7 @@ vn_decode_VkPipelineViewportStateCreateInfo_self_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkViewport_temp(dec, &((VkViewport *)val->pViewports)[i]); vn_decode_VkViewport_temp(dec, &((VkViewport *)val->pViewports)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pViewports = NULL; val->pViewports = NULL;
} }
vn_decode_uint32_t(dec, &val->scissorCount); vn_decode_uint32_t(dec, &val->scissorCount);
@ -514,7 +514,7 @@ vn_decode_VkPipelineViewportStateCreateInfo_self_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkRect2D_temp(dec, &((VkRect2D *)val->pScissors)[i]); vn_decode_VkRect2D_temp(dec, &((VkRect2D *)val->pScissors)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pScissors = NULL; val->pScissors = NULL;
} }
} }
@ -752,7 +752,7 @@ vn_decode_VkPipelineMultisampleStateCreateInfo_self_temp(struct vn_cs_decoder *d
if (!val->pSampleMask) return; if (!val->pSampleMask) return;
vn_decode_VkSampleMask_array(dec, (VkSampleMask *)val->pSampleMask, array_size); vn_decode_VkSampleMask_array(dec, (VkSampleMask *)val->pSampleMask, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pSampleMask = NULL; val->pSampleMask = NULL;
} }
vn_decode_VkBool32(dec, &val->alphaToCoverageEnable); vn_decode_VkBool32(dec, &val->alphaToCoverageEnable);
@ -959,7 +959,7 @@ vn_decode_VkPipelineColorBlendStateCreateInfo_self_temp(struct vn_cs_decoder *de
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPipelineColorBlendAttachmentState_temp(dec, &((VkPipelineColorBlendAttachmentState *)val->pAttachments)[i]); vn_decode_VkPipelineColorBlendAttachmentState_temp(dec, &((VkPipelineColorBlendAttachmentState *)val->pAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->attachmentCount);
val->pAttachments = NULL; val->pAttachments = NULL;
} }
{ {
@ -1038,7 +1038,7 @@ vn_decode_VkPipelineDynamicStateCreateInfo_self_temp(struct vn_cs_decoder *dec,
if (!val->pDynamicStates) return; if (!val->pDynamicStates) return;
vn_decode_VkDynamicState_array(dec, (VkDynamicState *)val->pDynamicStates, array_size); vn_decode_VkDynamicState_array(dec, (VkDynamicState *)val->pDynamicStates, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->dynamicStateCount);
val->pDynamicStates = NULL; val->pDynamicStates = NULL;
} }
} }
@ -1108,7 +1108,7 @@ vn_decode_VkGraphicsPipelineCreateInfo_self_temp(struct vn_cs_decoder *dec, VkGr
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPipelineShaderStageCreateInfo_temp(dec, &((VkPipelineShaderStageCreateInfo *)val->pStages)[i]); vn_decode_VkPipelineShaderStageCreateInfo_temp(dec, &((VkPipelineShaderStageCreateInfo *)val->pStages)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->stageCount);
val->pStages = NULL; val->pStages = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -1326,7 +1326,7 @@ static inline void vn_decode_vkCreateGraphicsPipelines_args_temp(struct vn_cs_de
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkGraphicsPipelineCreateInfo_temp(dec, &((VkGraphicsPipelineCreateInfo *)args->pCreateInfos)[i]); vn_decode_VkGraphicsPipelineCreateInfo_temp(dec, &((VkGraphicsPipelineCreateInfo *)args->pCreateInfos)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->createInfoCount);
args->pCreateInfos = NULL; args->pCreateInfos = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -1341,7 +1341,7 @@ static inline void vn_decode_vkCreateGraphicsPipelines_args_temp(struct vn_cs_de
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPipeline(dec, &args->pPipelines[i]); vn_decode_VkPipeline(dec, &args->pPipelines[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->createInfoCount);
args->pPipelines = NULL; args->pPipelines = NULL;
} }
} }
@ -1390,7 +1390,7 @@ static inline void vn_decode_vkCreateComputePipelines_args_temp(struct vn_cs_dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkComputePipelineCreateInfo_temp(dec, &((VkComputePipelineCreateInfo *)args->pCreateInfos)[i]); vn_decode_VkComputePipelineCreateInfo_temp(dec, &((VkComputePipelineCreateInfo *)args->pCreateInfos)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->createInfoCount);
args->pCreateInfos = NULL; args->pCreateInfos = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -1405,7 +1405,7 @@ static inline void vn_decode_vkCreateComputePipelines_args_temp(struct vn_cs_dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPipeline(dec, &args->pPipelines[i]); vn_decode_VkPipeline(dec, &args->pPipelines[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->createInfoCount);
args->pPipelines = NULL; args->pPipelines = NULL;
} }
} }

@ -37,7 +37,7 @@ vn_decode_VkPipelineCacheCreateInfo_self_temp(struct vn_cs_decoder *dec, VkPipel
if (!val->pInitialData) return; if (!val->pInitialData) return;
vn_decode_blob_array(dec, (void *)val->pInitialData, array_size); vn_decode_blob_array(dec, (void *)val->pInitialData, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->initialDataSize);
val->pInitialData = NULL; val->pInitialData = NULL;
} }
} }
@ -174,7 +174,7 @@ static inline void vn_decode_vkGetPipelineCacheData_args_temp(struct vn_cs_decod
args->pData = vn_cs_decoder_alloc_temp(dec, array_size); args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!args->pData) return; if (!args->pData) return;
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pData = NULL; args->pData = NULL;
} }
} }
@ -216,7 +216,7 @@ static inline void vn_decode_vkMergePipelineCaches_args_temp(struct vn_cs_decode
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPipelineCache_lookup(dec, &((VkPipelineCache *)args->pSrcCaches)[i]); vn_decode_VkPipelineCache_lookup(dec, &((VkPipelineCache *)args->pSrcCaches)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->srcCacheCount);
args->pSrcCaches = NULL; args->pSrcCaches = NULL;
} }
} }

@ -56,7 +56,7 @@ vn_decode_VkPipelineLayoutCreateInfo_self_temp(struct vn_cs_decoder *dec, VkPipe
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkDescriptorSetLayout_lookup(dec, &((VkDescriptorSetLayout *)val->pSetLayouts)[i]); vn_decode_VkDescriptorSetLayout_lookup(dec, &((VkDescriptorSetLayout *)val->pSetLayouts)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->setLayoutCount);
val->pSetLayouts = NULL; val->pSetLayouts = NULL;
} }
vn_decode_uint32_t(dec, &val->pushConstantRangeCount); vn_decode_uint32_t(dec, &val->pushConstantRangeCount);
@ -67,7 +67,7 @@ vn_decode_VkPipelineLayoutCreateInfo_self_temp(struct vn_cs_decoder *dec, VkPipe
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkPushConstantRange_temp(dec, &((VkPushConstantRange *)val->pPushConstantRanges)[i]); vn_decode_VkPushConstantRange_temp(dec, &((VkPushConstantRange *)val->pPushConstantRanges)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->pushConstantRangeCount);
val->pPushConstantRanges = NULL; val->pPushConstantRanges = NULL;
} }
} }

@ -163,7 +163,7 @@ static inline void vn_decode_vkGetQueryPoolResults_args_temp(struct vn_cs_decode
args->pData = vn_cs_decoder_alloc_temp(dec, array_size); args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!args->pData) return; if (!args->pData) return;
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->dataSize);
args->pData = NULL; args->pData = NULL;
} }
vn_decode_VkDeviceSize(dec, &args->stride); vn_decode_VkDeviceSize(dec, &args->stride);

@ -36,7 +36,7 @@ vn_decode_VkDeviceGroupSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceG
if (!val->pWaitSemaphoreDeviceIndices) return; if (!val->pWaitSemaphoreDeviceIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pWaitSemaphoreDeviceIndices, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pWaitSemaphoreDeviceIndices, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->waitSemaphoreCount);
val->pWaitSemaphoreDeviceIndices = NULL; val->pWaitSemaphoreDeviceIndices = NULL;
} }
vn_decode_uint32_t(dec, &val->commandBufferCount); vn_decode_uint32_t(dec, &val->commandBufferCount);
@ -46,7 +46,7 @@ vn_decode_VkDeviceGroupSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceG
if (!val->pCommandBufferDeviceMasks) return; if (!val->pCommandBufferDeviceMasks) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pCommandBufferDeviceMasks, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pCommandBufferDeviceMasks, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->commandBufferCount);
val->pCommandBufferDeviceMasks = NULL; val->pCommandBufferDeviceMasks = NULL;
} }
vn_decode_uint32_t(dec, &val->signalSemaphoreCount); vn_decode_uint32_t(dec, &val->signalSemaphoreCount);
@ -56,7 +56,7 @@ vn_decode_VkDeviceGroupSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkDeviceG
if (!val->pSignalSemaphoreDeviceIndices) return; if (!val->pSignalSemaphoreDeviceIndices) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pSignalSemaphoreDeviceIndices, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pSignalSemaphoreDeviceIndices, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->signalSemaphoreCount);
val->pSignalSemaphoreDeviceIndices = NULL; val->pSignalSemaphoreDeviceIndices = NULL;
} }
} }
@ -184,7 +184,7 @@ vn_decode_VkTimelineSemaphoreSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkT
if (!val->pWaitSemaphoreValues) return; if (!val->pWaitSemaphoreValues) return;
vn_decode_uint64_t_array(dec, (uint64_t *)val->pWaitSemaphoreValues, array_size); vn_decode_uint64_t_array(dec, (uint64_t *)val->pWaitSemaphoreValues, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pWaitSemaphoreValues = NULL; val->pWaitSemaphoreValues = NULL;
} }
vn_decode_uint32_t(dec, &val->signalSemaphoreValueCount); vn_decode_uint32_t(dec, &val->signalSemaphoreValueCount);
@ -194,7 +194,7 @@ vn_decode_VkTimelineSemaphoreSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkT
if (!val->pSignalSemaphoreValues) return; if (!val->pSignalSemaphoreValues) return;
vn_decode_uint64_t_array(dec, (uint64_t *)val->pSignalSemaphoreValues, array_size); vn_decode_uint64_t_array(dec, (uint64_t *)val->pSignalSemaphoreValues, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pSignalSemaphoreValues = NULL; val->pSignalSemaphoreValues = NULL;
} }
} }
@ -300,7 +300,7 @@ vn_decode_VkSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkSubmitInfo *val)
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pWaitSemaphores)[i]); vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pWaitSemaphores)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->waitSemaphoreCount);
val->pWaitSemaphores = NULL; val->pWaitSemaphores = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -310,7 +310,7 @@ vn_decode_VkSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkSubmitInfo *val)
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkFlags(dec, &((VkPipelineStageFlags *)val->pWaitDstStageMask)[i]); vn_decode_VkFlags(dec, &((VkPipelineStageFlags *)val->pWaitDstStageMask)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->waitSemaphoreCount);
val->pWaitDstStageMask = NULL; val->pWaitDstStageMask = NULL;
} }
vn_decode_uint32_t(dec, &val->commandBufferCount); vn_decode_uint32_t(dec, &val->commandBufferCount);
@ -321,7 +321,7 @@ vn_decode_VkSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkSubmitInfo *val)
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkCommandBuffer_lookup(dec, &((VkCommandBuffer *)val->pCommandBuffers)[i]); vn_decode_VkCommandBuffer_lookup(dec, &((VkCommandBuffer *)val->pCommandBuffers)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->commandBufferCount);
val->pCommandBuffers = NULL; val->pCommandBuffers = NULL;
} }
vn_decode_uint32_t(dec, &val->signalSemaphoreCount); vn_decode_uint32_t(dec, &val->signalSemaphoreCount);
@ -332,7 +332,7 @@ vn_decode_VkSubmitInfo_self_temp(struct vn_cs_decoder *dec, VkSubmitInfo *val)
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSignalSemaphores)[i]); vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSignalSemaphores)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->signalSemaphoreCount);
val->pSignalSemaphores = NULL; val->pSignalSemaphores = NULL;
} }
} }
@ -436,7 +436,7 @@ vn_decode_VkSparseBufferMemoryBindInfo_temp(struct vn_cs_decoder *dec, VkSparseB
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseMemoryBind_temp(dec, &((VkSparseMemoryBind *)val->pBinds)[i]); vn_decode_VkSparseMemoryBind_temp(dec, &((VkSparseMemoryBind *)val->pBinds)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->bindCount);
val->pBinds = NULL; val->pBinds = NULL;
} }
} }
@ -466,7 +466,7 @@ vn_decode_VkSparseImageOpaqueMemoryBindInfo_temp(struct vn_cs_decoder *dec, VkSp
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseMemoryBind_temp(dec, &((VkSparseMemoryBind *)val->pBinds)[i]); vn_decode_VkSparseMemoryBind_temp(dec, &((VkSparseMemoryBind *)val->pBinds)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->bindCount);
val->pBinds = NULL; val->pBinds = NULL;
} }
} }
@ -520,7 +520,7 @@ vn_decode_VkSparseImageMemoryBindInfo_temp(struct vn_cs_decoder *dec, VkSparseIm
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseImageMemoryBind_temp(dec, &((VkSparseImageMemoryBind *)val->pBinds)[i]); vn_decode_VkSparseImageMemoryBind_temp(dec, &((VkSparseImageMemoryBind *)val->pBinds)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->bindCount);
val->pBinds = NULL; val->pBinds = NULL;
} }
} }
@ -646,7 +646,7 @@ vn_decode_VkBindSparseInfo_self_temp(struct vn_cs_decoder *dec, VkBindSparseInfo
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pWaitSemaphores)[i]); vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pWaitSemaphores)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->waitSemaphoreCount);
val->pWaitSemaphores = NULL; val->pWaitSemaphores = NULL;
} }
vn_decode_uint32_t(dec, &val->bufferBindCount); vn_decode_uint32_t(dec, &val->bufferBindCount);
@ -657,7 +657,7 @@ vn_decode_VkBindSparseInfo_self_temp(struct vn_cs_decoder *dec, VkBindSparseInfo
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseBufferMemoryBindInfo_temp(dec, &((VkSparseBufferMemoryBindInfo *)val->pBufferBinds)[i]); vn_decode_VkSparseBufferMemoryBindInfo_temp(dec, &((VkSparseBufferMemoryBindInfo *)val->pBufferBinds)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->bufferBindCount);
val->pBufferBinds = NULL; val->pBufferBinds = NULL;
} }
vn_decode_uint32_t(dec, &val->imageOpaqueBindCount); vn_decode_uint32_t(dec, &val->imageOpaqueBindCount);
@ -668,7 +668,7 @@ vn_decode_VkBindSparseInfo_self_temp(struct vn_cs_decoder *dec, VkBindSparseInfo
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseImageOpaqueMemoryBindInfo_temp(dec, &((VkSparseImageOpaqueMemoryBindInfo *)val->pImageOpaqueBinds)[i]); vn_decode_VkSparseImageOpaqueMemoryBindInfo_temp(dec, &((VkSparseImageOpaqueMemoryBindInfo *)val->pImageOpaqueBinds)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->imageOpaqueBindCount);
val->pImageOpaqueBinds = NULL; val->pImageOpaqueBinds = NULL;
} }
vn_decode_uint32_t(dec, &val->imageBindCount); vn_decode_uint32_t(dec, &val->imageBindCount);
@ -679,7 +679,7 @@ vn_decode_VkBindSparseInfo_self_temp(struct vn_cs_decoder *dec, VkBindSparseInfo
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSparseImageMemoryBindInfo_temp(dec, &((VkSparseImageMemoryBindInfo *)val->pImageBinds)[i]); vn_decode_VkSparseImageMemoryBindInfo_temp(dec, &((VkSparseImageMemoryBindInfo *)val->pImageBinds)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->imageBindCount);
val->pImageBinds = NULL; val->pImageBinds = NULL;
} }
vn_decode_uint32_t(dec, &val->signalSemaphoreCount); vn_decode_uint32_t(dec, &val->signalSemaphoreCount);
@ -690,7 +690,7 @@ vn_decode_VkBindSparseInfo_self_temp(struct vn_cs_decoder *dec, VkBindSparseInfo
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSignalSemaphores)[i]); vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSignalSemaphores)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->signalSemaphoreCount);
val->pSignalSemaphores = NULL; val->pSignalSemaphores = NULL;
} }
} }
@ -775,7 +775,7 @@ static inline void vn_decode_vkQueueSubmit_args_temp(struct vn_cs_decoder *dec,
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSubmitInfo_temp(dec, &((VkSubmitInfo *)args->pSubmits)[i]); vn_decode_VkSubmitInfo_temp(dec, &((VkSubmitInfo *)args->pSubmits)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->submitCount);
args->pSubmits = NULL; args->pSubmits = NULL;
} }
vn_decode_VkFence_lookup(dec, &args->fence); vn_decode_VkFence_lookup(dec, &args->fence);
@ -832,7 +832,7 @@ static inline void vn_decode_vkQueueBindSparse_args_temp(struct vn_cs_decoder *d
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkBindSparseInfo_temp(dec, &((VkBindSparseInfo *)args->pBindInfo)[i]); vn_decode_VkBindSparseInfo_temp(dec, &((VkBindSparseInfo *)args->pBindInfo)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->bindInfoCount);
args->pBindInfo = NULL; args->pBindInfo = NULL;
} }
vn_decode_VkFence_lookup(dec, &args->fence); vn_decode_VkFence_lookup(dec, &args->fence);

@ -75,7 +75,7 @@ vn_decode_VkSubpassDescription_temp(struct vn_cs_decoder *dec, VkSubpassDescript
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentReference_temp(dec, &((VkAttachmentReference *)val->pInputAttachments)[i]); vn_decode_VkAttachmentReference_temp(dec, &((VkAttachmentReference *)val->pInputAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->inputAttachmentCount);
val->pInputAttachments = NULL; val->pInputAttachments = NULL;
} }
vn_decode_uint32_t(dec, &val->colorAttachmentCount); vn_decode_uint32_t(dec, &val->colorAttachmentCount);
@ -86,7 +86,7 @@ vn_decode_VkSubpassDescription_temp(struct vn_cs_decoder *dec, VkSubpassDescript
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentReference_temp(dec, &((VkAttachmentReference *)val->pColorAttachments)[i]); vn_decode_VkAttachmentReference_temp(dec, &((VkAttachmentReference *)val->pColorAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->colorAttachmentCount);
val->pColorAttachments = NULL; val->pColorAttachments = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -96,7 +96,7 @@ vn_decode_VkSubpassDescription_temp(struct vn_cs_decoder *dec, VkSubpassDescript
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentReference_temp(dec, &((VkAttachmentReference *)val->pResolveAttachments)[i]); vn_decode_VkAttachmentReference_temp(dec, &((VkAttachmentReference *)val->pResolveAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pResolveAttachments = NULL; val->pResolveAttachments = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -113,7 +113,7 @@ vn_decode_VkSubpassDescription_temp(struct vn_cs_decoder *dec, VkSubpassDescript
if (!val->pPreserveAttachments) return; if (!val->pPreserveAttachments) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pPreserveAttachments, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pPreserveAttachments, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->preserveAttachmentCount);
val->pPreserveAttachments = NULL; val->pPreserveAttachments = NULL;
} }
} }
@ -191,7 +191,7 @@ vn_decode_VkRenderPassMultiviewCreateInfo_self_temp(struct vn_cs_decoder *dec, V
if (!val->pViewMasks) return; if (!val->pViewMasks) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pViewMasks, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pViewMasks, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->subpassCount);
val->pViewMasks = NULL; val->pViewMasks = NULL;
} }
vn_decode_uint32_t(dec, &val->dependencyCount); vn_decode_uint32_t(dec, &val->dependencyCount);
@ -201,7 +201,7 @@ vn_decode_VkRenderPassMultiviewCreateInfo_self_temp(struct vn_cs_decoder *dec, V
if (!val->pViewOffsets) return; if (!val->pViewOffsets) return;
vn_decode_int32_t_array(dec, (int32_t *)val->pViewOffsets, array_size); vn_decode_int32_t_array(dec, (int32_t *)val->pViewOffsets, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->dependencyCount);
val->pViewOffsets = NULL; val->pViewOffsets = NULL;
} }
vn_decode_uint32_t(dec, &val->correlationMaskCount); vn_decode_uint32_t(dec, &val->correlationMaskCount);
@ -211,7 +211,7 @@ vn_decode_VkRenderPassMultiviewCreateInfo_self_temp(struct vn_cs_decoder *dec, V
if (!val->pCorrelationMasks) return; if (!val->pCorrelationMasks) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pCorrelationMasks, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pCorrelationMasks, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->correlationMaskCount);
val->pCorrelationMasks = NULL; val->pCorrelationMasks = NULL;
} }
} }
@ -301,7 +301,7 @@ vn_decode_VkRenderPassInputAttachmentAspectCreateInfo_self_temp(struct vn_cs_dec
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkInputAttachmentAspectReference_temp(dec, &((VkInputAttachmentAspectReference *)val->pAspectReferences)[i]); vn_decode_VkInputAttachmentAspectReference_temp(dec, &((VkInputAttachmentAspectReference *)val->pAspectReferences)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->aspectReferenceCount);
val->pAspectReferences = NULL; val->pAspectReferences = NULL;
} }
} }
@ -401,7 +401,7 @@ vn_decode_VkRenderPassCreateInfo_self_temp(struct vn_cs_decoder *dec, VkRenderPa
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentDescription_temp(dec, &((VkAttachmentDescription *)val->pAttachments)[i]); vn_decode_VkAttachmentDescription_temp(dec, &((VkAttachmentDescription *)val->pAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->attachmentCount);
val->pAttachments = NULL; val->pAttachments = NULL;
} }
vn_decode_uint32_t(dec, &val->subpassCount); vn_decode_uint32_t(dec, &val->subpassCount);
@ -412,7 +412,7 @@ vn_decode_VkRenderPassCreateInfo_self_temp(struct vn_cs_decoder *dec, VkRenderPa
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSubpassDescription_temp(dec, &((VkSubpassDescription *)val->pSubpasses)[i]); vn_decode_VkSubpassDescription_temp(dec, &((VkSubpassDescription *)val->pSubpasses)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->subpassCount);
val->pSubpasses = NULL; val->pSubpasses = NULL;
} }
vn_decode_uint32_t(dec, &val->dependencyCount); vn_decode_uint32_t(dec, &val->dependencyCount);
@ -423,7 +423,7 @@ vn_decode_VkRenderPassCreateInfo_self_temp(struct vn_cs_decoder *dec, VkRenderPa
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSubpassDependency_temp(dec, &((VkSubpassDependency *)val->pDependencies)[i]); vn_decode_VkSubpassDependency_temp(dec, &((VkSubpassDependency *)val->pDependencies)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->dependencyCount);
val->pDependencies = NULL; val->pDependencies = NULL;
} }
} }
@ -898,7 +898,7 @@ vn_decode_VkSubpassDescription2_self_temp(struct vn_cs_decoder *dec, VkSubpassDe
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentReference2_temp(dec, &((VkAttachmentReference2 *)val->pInputAttachments)[i]); vn_decode_VkAttachmentReference2_temp(dec, &((VkAttachmentReference2 *)val->pInputAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->inputAttachmentCount);
val->pInputAttachments = NULL; val->pInputAttachments = NULL;
} }
vn_decode_uint32_t(dec, &val->colorAttachmentCount); vn_decode_uint32_t(dec, &val->colorAttachmentCount);
@ -909,7 +909,7 @@ vn_decode_VkSubpassDescription2_self_temp(struct vn_cs_decoder *dec, VkSubpassDe
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentReference2_temp(dec, &((VkAttachmentReference2 *)val->pColorAttachments)[i]); vn_decode_VkAttachmentReference2_temp(dec, &((VkAttachmentReference2 *)val->pColorAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->colorAttachmentCount);
val->pColorAttachments = NULL; val->pColorAttachments = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -919,7 +919,7 @@ vn_decode_VkSubpassDescription2_self_temp(struct vn_cs_decoder *dec, VkSubpassDe
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentReference2_temp(dec, &((VkAttachmentReference2 *)val->pResolveAttachments)[i]); vn_decode_VkAttachmentReference2_temp(dec, &((VkAttachmentReference2 *)val->pResolveAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
val->pResolveAttachments = NULL; val->pResolveAttachments = NULL;
} }
if (vn_decode_simple_pointer(dec)) { if (vn_decode_simple_pointer(dec)) {
@ -936,7 +936,7 @@ vn_decode_VkSubpassDescription2_self_temp(struct vn_cs_decoder *dec, VkSubpassDe
if (!val->pPreserveAttachments) return; if (!val->pPreserveAttachments) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pPreserveAttachments, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pPreserveAttachments, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->preserveAttachmentCount);
val->pPreserveAttachments = NULL; val->pPreserveAttachments = NULL;
} }
} }
@ -1098,7 +1098,7 @@ vn_decode_VkRenderPassCreateInfo2_self_temp(struct vn_cs_decoder *dec, VkRenderP
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkAttachmentDescription2_temp(dec, &((VkAttachmentDescription2 *)val->pAttachments)[i]); vn_decode_VkAttachmentDescription2_temp(dec, &((VkAttachmentDescription2 *)val->pAttachments)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->attachmentCount);
val->pAttachments = NULL; val->pAttachments = NULL;
} }
vn_decode_uint32_t(dec, &val->subpassCount); vn_decode_uint32_t(dec, &val->subpassCount);
@ -1109,7 +1109,7 @@ vn_decode_VkRenderPassCreateInfo2_self_temp(struct vn_cs_decoder *dec, VkRenderP
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSubpassDescription2_temp(dec, &((VkSubpassDescription2 *)val->pSubpasses)[i]); vn_decode_VkSubpassDescription2_temp(dec, &((VkSubpassDescription2 *)val->pSubpasses)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->subpassCount);
val->pSubpasses = NULL; val->pSubpasses = NULL;
} }
vn_decode_uint32_t(dec, &val->dependencyCount); vn_decode_uint32_t(dec, &val->dependencyCount);
@ -1120,7 +1120,7 @@ vn_decode_VkRenderPassCreateInfo2_self_temp(struct vn_cs_decoder *dec, VkRenderP
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSubpassDependency2_temp(dec, &((VkSubpassDependency2 *)val->pDependencies)[i]); vn_decode_VkSubpassDependency2_temp(dec, &((VkSubpassDependency2 *)val->pDependencies)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->dependencyCount);
val->pDependencies = NULL; val->pDependencies = NULL;
} }
vn_decode_uint32_t(dec, &val->correlatedViewMaskCount); vn_decode_uint32_t(dec, &val->correlatedViewMaskCount);
@ -1130,7 +1130,7 @@ vn_decode_VkRenderPassCreateInfo2_self_temp(struct vn_cs_decoder *dec, VkRenderP
if (!val->pCorrelatedViewMasks) return; if (!val->pCorrelatedViewMasks) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pCorrelatedViewMasks, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pCorrelatedViewMasks, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->correlatedViewMaskCount);
val->pCorrelatedViewMasks = NULL; val->pCorrelatedViewMasks = NULL;
} }
} }

@ -186,7 +186,7 @@ vn_decode_VkSemaphoreWaitInfo_self_temp(struct vn_cs_decoder *dec, VkSemaphoreWa
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSemaphores)[i]); vn_decode_VkSemaphore_lookup(dec, &((VkSemaphore *)val->pSemaphores)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->semaphoreCount);
val->pSemaphores = NULL; val->pSemaphores = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -195,7 +195,7 @@ vn_decode_VkSemaphoreWaitInfo_self_temp(struct vn_cs_decoder *dec, VkSemaphoreWa
if (!val->pValues) return; if (!val->pValues) return;
vn_decode_uint64_t_array(dec, (uint64_t *)val->pValues, array_size); vn_decode_uint64_t_array(dec, (uint64_t *)val->pValues, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->semaphoreCount);
val->pValues = NULL; val->pValues = NULL;
} }
} }

@ -37,7 +37,7 @@ vn_decode_VkShaderModuleCreateInfo_self_temp(struct vn_cs_decoder *dec, VkShader
if (!val->pCode) return; if (!val->pCode) return;
vn_decode_uint32_t_array(dec, (uint32_t *)val->pCode, array_size); vn_decode_uint32_t_array(dec, (uint32_t *)val->pCode, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->codeSize / 4);
val->pCode = NULL; val->pCode = NULL;
} }
} }

@ -263,7 +263,7 @@ vn_decode_VkImageFormatListCreateInfo_self_temp(struct vn_cs_decoder *dec, VkIma
if (!val->pViewFormats) return; if (!val->pViewFormats) return;
vn_decode_VkFormat_array(dec, (VkFormat *)val->pViewFormats, array_size); vn_decode_VkFormat_array(dec, (VkFormat *)val->pViewFormats, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, val->viewFormatCount);
val->pViewFormats = NULL; val->pViewFormats = NULL;
} }
} }

@ -330,7 +330,7 @@ static inline void vn_decode_vkExecuteCommandStreamsMESA_args_temp(struct vn_cs_
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkCommandStreamDescriptionMESA_temp(dec, &((VkCommandStreamDescriptionMESA *)args->pStreams)[i]); vn_decode_VkCommandStreamDescriptionMESA_temp(dec, &((VkCommandStreamDescriptionMESA *)args->pStreams)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->streamCount);
args->pStreams = NULL; args->pStreams = NULL;
} }
if (vn_peek_array_size(dec)) { if (vn_peek_array_size(dec)) {
@ -339,7 +339,7 @@ static inline void vn_decode_vkExecuteCommandStreamsMESA_args_temp(struct vn_cs_
if (!args->pReplyPositions) return; if (!args->pReplyPositions) return;
vn_decode_size_t_array(dec, (size_t *)args->pReplyPositions, array_size); vn_decode_size_t_array(dec, (size_t *)args->pReplyPositions, array_size);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pReplyPositions = NULL; args->pReplyPositions = NULL;
} }
vn_decode_uint32_t(dec, &args->dependencyCount); vn_decode_uint32_t(dec, &args->dependencyCount);
@ -350,7 +350,7 @@ static inline void vn_decode_vkExecuteCommandStreamsMESA_args_temp(struct vn_cs_
for (uint32_t i = 0; i < iter_count; i++) for (uint32_t i = 0; i < iter_count; i++)
vn_decode_VkCommandStreamDependencyMESA_temp(dec, &((VkCommandStreamDependencyMESA *)args->pDependencies)[i]); vn_decode_VkCommandStreamDependencyMESA_temp(dec, &((VkCommandStreamDependencyMESA *)args->pDependencies)[i]);
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size(dec, args->dependencyCount);
args->pDependencies = NULL; args->pDependencies = NULL;
} }
vn_decode_VkFlags(dec, &args->flags); vn_decode_VkFlags(dec, &args->flags);
@ -522,7 +522,7 @@ static inline void vn_decode_vkGetVenusExperimentalFeatureData100000MESA_args_te
args->pData = vn_cs_decoder_alloc_temp(dec, array_size); args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!args->pData) return; if (!args->pData) return;
} else { } else {
vn_decode_array_size(dec, 0); vn_decode_array_size_unchecked(dec);
args->pData = NULL; args->pData = NULL;
} }
} }

Loading…
Cancel
Save