vkr: NULL-check loop variables

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
macos/master
Chia-I Wu 3 years ago
parent 248a49f97b
commit 8d413c4d66
  1. 2
      src/venus-protocol/vn_protocol_renderer.h
  2. 10
      src/venus-protocol/vn_protocol_renderer_command_buffer.h
  3. 10
      src/venus-protocol/vn_protocol_renderer_descriptor_set.h
  4. 80
      src/venus-protocol/vn_protocol_renderer_device.h
  5. 20
      src/venus-protocol/vn_protocol_renderer_image.h
  6. 20
      src/venus-protocol/vn_protocol_renderer_instance.h
  7. 6
      src/venus-protocol/vn_protocol_renderer_pipeline_cache.h
  8. 6
      src/venus-protocol/vn_protocol_renderer_transport.h

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

@ -1190,10 +1190,10 @@ static inline void vn_decode_vkAllocateCommandBuffers_args_temp(struct vn_cs_dec
args->pAllocateInfo = NULL;
}
if (vn_peek_array_size(dec)) {
args->pCommandBuffers = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCommandBuffers) * args->pAllocateInfo->commandBufferCount);
args->pCommandBuffers = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pCommandBuffers) * (args->pAllocateInfo ? args->pAllocateInfo->commandBufferCount : 0));
if (!args->pCommandBuffers) return;
vn_decode_array_size(dec, args->pAllocateInfo->commandBufferCount);
for (uint32_t i = 0; i < args->pAllocateInfo->commandBufferCount; i++)
vn_decode_array_size(dec, (args->pAllocateInfo ? args->pAllocateInfo->commandBufferCount : 0));
for (uint32_t i = 0; i < (args->pAllocateInfo ? args->pAllocateInfo->commandBufferCount : 0); i++)
vn_decode_VkCommandBuffer_temp(dec, &args->pCommandBuffers[i]);
} else {
vn_decode_array_size(dec, 0);
@ -1217,8 +1217,8 @@ static inline void vn_encode_vkAllocateCommandBuffers_reply(struct vn_cs_encoder
/* skip args->device */
/* skip args->pAllocateInfo */
if (args->pCommandBuffers) {
vn_encode_array_size(enc, args->pAllocateInfo->commandBufferCount);
for (uint32_t i = 0; i < args->pAllocateInfo->commandBufferCount; i++)
vn_encode_array_size(enc, (args->pAllocateInfo ? args->pAllocateInfo->commandBufferCount : 0));
for (uint32_t i = 0; i < (args->pAllocateInfo ? args->pAllocateInfo->commandBufferCount : 0); i++)
vn_encode_VkCommandBuffer(enc, &args->pCommandBuffers[i]);
} else {
vn_encode_array_size(enc, 0);

@ -402,10 +402,10 @@ static inline void vn_decode_vkAllocateDescriptorSets_args_temp(struct vn_cs_dec
args->pAllocateInfo = NULL;
}
if (vn_peek_array_size(dec)) {
args->pDescriptorSets = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorSets) * args->pAllocateInfo->descriptorSetCount);
args->pDescriptorSets = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDescriptorSets) * (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0));
if (!args->pDescriptorSets) return;
vn_decode_array_size(dec, args->pAllocateInfo->descriptorSetCount);
for (uint32_t i = 0; i < args->pAllocateInfo->descriptorSetCount; i++)
vn_decode_array_size(dec, (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0));
for (uint32_t i = 0; i < (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0); i++)
vn_decode_VkDescriptorSet(dec, &args->pDescriptorSets[i]);
} else {
vn_decode_array_size(dec, 0);
@ -429,8 +429,8 @@ static inline void vn_encode_vkAllocateDescriptorSets_reply(struct vn_cs_encoder
/* skip args->device */
/* skip args->pAllocateInfo */
if (args->pDescriptorSets) {
vn_encode_array_size(enc, args->pAllocateInfo->descriptorSetCount);
for (uint32_t i = 0; i < args->pAllocateInfo->descriptorSetCount; i++)
vn_encode_array_size(enc, (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0));
for (uint32_t i = 0; i < (args->pAllocateInfo ? args->pAllocateInfo->descriptorSetCount : 0); i++)
vn_encode_VkDescriptorSet(enc, &args->pDescriptorSets[i]);
} else {
vn_encode_array_size(enc, 0);

@ -7426,10 +7426,10 @@ static inline void vn_decode_vkEnumeratePhysicalDevices_args_temp(struct vn_cs_d
args->pPhysicalDeviceCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pPhysicalDevices = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPhysicalDevices) * *args->pPhysicalDeviceCount);
args->pPhysicalDevices = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPhysicalDevices) * (args->pPhysicalDeviceCount ? *args->pPhysicalDeviceCount : 0));
if (!args->pPhysicalDevices) return;
vn_decode_array_size(dec, *args->pPhysicalDeviceCount);
for (uint32_t i = 0; i < *args->pPhysicalDeviceCount; i++)
vn_decode_array_size(dec, (args->pPhysicalDeviceCount ? *args->pPhysicalDeviceCount : 0));
for (uint32_t i = 0; i < (args->pPhysicalDeviceCount ? *args->pPhysicalDeviceCount : 0); i++)
vn_decode_VkPhysicalDevice_temp(dec, &args->pPhysicalDevices[i]);
} else {
vn_decode_array_size(dec, 0);
@ -7453,8 +7453,8 @@ static inline void vn_encode_vkEnumeratePhysicalDevices_reply(struct vn_cs_encod
if (vn_encode_simple_pointer(enc, args->pPhysicalDeviceCount))
vn_encode_uint32_t(enc, args->pPhysicalDeviceCount);
if (args->pPhysicalDevices) {
vn_encode_array_size(enc, *args->pPhysicalDeviceCount);
for (uint32_t i = 0; i < *args->pPhysicalDeviceCount; i++)
vn_encode_array_size(enc, (args->pPhysicalDeviceCount ? *args->pPhysicalDeviceCount : 0));
for (uint32_t i = 0; i < (args->pPhysicalDeviceCount ? *args->pPhysicalDeviceCount : 0); i++)
vn_encode_VkPhysicalDevice(enc, &args->pPhysicalDevices[i]);
} else {
vn_encode_array_size(enc, 0);
@ -7499,10 +7499,10 @@ static inline void vn_decode_vkGetPhysicalDeviceQueueFamilyProperties_args_temp(
args->pQueueFamilyPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pQueueFamilyProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pQueueFamilyProperties) * *args->pQueueFamilyPropertyCount);
args->pQueueFamilyProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pQueueFamilyProperties) * (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0));
if (!args->pQueueFamilyProperties) return;
vn_decode_array_size(dec, *args->pQueueFamilyPropertyCount);
for (uint32_t i = 0; i < *args->pQueueFamilyPropertyCount; i++)
vn_decode_array_size(dec, (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0));
for (uint32_t i = 0; i < (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0); i++)
vn_decode_VkQueueFamilyProperties_partial_temp(dec, &args->pQueueFamilyProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -7525,8 +7525,8 @@ static inline void vn_encode_vkGetPhysicalDeviceQueueFamilyProperties_reply(stru
if (vn_encode_simple_pointer(enc, args->pQueueFamilyPropertyCount))
vn_encode_uint32_t(enc, args->pQueueFamilyPropertyCount);
if (args->pQueueFamilyProperties) {
vn_encode_array_size(enc, *args->pQueueFamilyPropertyCount);
for (uint32_t i = 0; i < *args->pQueueFamilyPropertyCount; i++)
vn_encode_array_size(enc, (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0));
for (uint32_t i = 0; i < (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0); i++)
vn_encode_VkQueueFamilyProperties(enc, &args->pQueueFamilyProperties[i]);
} else {
vn_encode_array_size(enc, 0);
@ -7740,10 +7740,10 @@ static inline void vn_decode_vkEnumerateDeviceLayerProperties_args_temp(struct v
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * (args->pPropertyCount ? *args->pPropertyCount : 0));
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_array_size(dec, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_decode_VkLayerProperties_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -7767,8 +7767,8 @@ static inline void vn_encode_vkEnumerateDeviceLayerProperties_reply(struct vn_cs
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_array_size(enc, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_encode_VkLayerProperties(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);
@ -7795,10 +7795,10 @@ static inline void vn_decode_vkEnumerateDeviceExtensionProperties_args_temp(stru
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * (args->pPropertyCount ? *args->pPropertyCount : 0));
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_array_size(dec, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_decode_VkExtensionProperties_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -7824,8 +7824,8 @@ static inline void vn_encode_vkEnumerateDeviceExtensionProperties_reply(struct v
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_array_size(enc, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_encode_VkExtensionProperties(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);
@ -7899,10 +7899,10 @@ static inline void vn_decode_vkGetPhysicalDeviceSparseImageFormatProperties_args
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * (args->pPropertyCount ? *args->pPropertyCount : 0));
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_array_size(dec, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_decode_VkSparseImageFormatProperties_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -7935,8 +7935,8 @@ static inline void vn_encode_vkGetPhysicalDeviceSparseImageFormatProperties_repl
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_array_size(enc, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_encode_VkSparseImageFormatProperties(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);
@ -8076,10 +8076,10 @@ static inline void vn_decode_vkGetPhysicalDeviceQueueFamilyProperties2_args_temp
args->pQueueFamilyPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pQueueFamilyProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pQueueFamilyProperties) * *args->pQueueFamilyPropertyCount);
args->pQueueFamilyProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pQueueFamilyProperties) * (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0));
if (!args->pQueueFamilyProperties) return;
vn_decode_array_size(dec, *args->pQueueFamilyPropertyCount);
for (uint32_t i = 0; i < *args->pQueueFamilyPropertyCount; i++)
vn_decode_array_size(dec, (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0));
for (uint32_t i = 0; i < (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0); i++)
vn_decode_VkQueueFamilyProperties2_partial_temp(dec, &args->pQueueFamilyProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -8102,8 +8102,8 @@ static inline void vn_encode_vkGetPhysicalDeviceQueueFamilyProperties2_reply(str
if (vn_encode_simple_pointer(enc, args->pQueueFamilyPropertyCount))
vn_encode_uint32_t(enc, args->pQueueFamilyPropertyCount);
if (args->pQueueFamilyProperties) {
vn_encode_array_size(enc, *args->pQueueFamilyPropertyCount);
for (uint32_t i = 0; i < *args->pQueueFamilyPropertyCount; i++)
vn_encode_array_size(enc, (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0));
for (uint32_t i = 0; i < (args->pQueueFamilyPropertyCount ? *args->pQueueFamilyPropertyCount : 0); i++)
vn_encode_VkQueueFamilyProperties2(enc, &args->pQueueFamilyProperties[i]);
} else {
vn_encode_array_size(enc, 0);
@ -8155,10 +8155,10 @@ static inline void vn_decode_vkGetPhysicalDeviceSparseImageFormatProperties2_arg
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * (args->pPropertyCount ? *args->pPropertyCount : 0));
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_array_size(dec, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_decode_VkSparseImageFormatProperties2_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -8184,8 +8184,8 @@ static inline void vn_encode_vkGetPhysicalDeviceSparseImageFormatProperties2_rep
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_array_size(enc, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_encode_VkSparseImageFormatProperties2(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);
@ -8314,10 +8314,10 @@ static inline void vn_decode_vkEnumeratePhysicalDeviceGroups_args_temp(struct vn
args->pPhysicalDeviceGroupCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pPhysicalDeviceGroupProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPhysicalDeviceGroupProperties) * *args->pPhysicalDeviceGroupCount);
args->pPhysicalDeviceGroupProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pPhysicalDeviceGroupProperties) * (args->pPhysicalDeviceGroupCount ? *args->pPhysicalDeviceGroupCount : 0));
if (!args->pPhysicalDeviceGroupProperties) return;
vn_decode_array_size(dec, *args->pPhysicalDeviceGroupCount);
for (uint32_t i = 0; i < *args->pPhysicalDeviceGroupCount; i++)
vn_decode_array_size(dec, (args->pPhysicalDeviceGroupCount ? *args->pPhysicalDeviceGroupCount : 0));
for (uint32_t i = 0; i < (args->pPhysicalDeviceGroupCount ? *args->pPhysicalDeviceGroupCount : 0); i++)
vn_decode_VkPhysicalDeviceGroupProperties_partial_temp(dec, &args->pPhysicalDeviceGroupProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -8341,8 +8341,8 @@ static inline void vn_encode_vkEnumeratePhysicalDeviceGroups_reply(struct vn_cs_
if (vn_encode_simple_pointer(enc, args->pPhysicalDeviceGroupCount))
vn_encode_uint32_t(enc, args->pPhysicalDeviceGroupCount);
if (args->pPhysicalDeviceGroupProperties) {
vn_encode_array_size(enc, *args->pPhysicalDeviceGroupCount);
for (uint32_t i = 0; i < *args->pPhysicalDeviceGroupCount; i++)
vn_encode_array_size(enc, (args->pPhysicalDeviceGroupCount ? *args->pPhysicalDeviceGroupCount : 0));
for (uint32_t i = 0; i < (args->pPhysicalDeviceGroupCount ? *args->pPhysicalDeviceGroupCount : 0); i++)
vn_encode_VkPhysicalDeviceGroupProperties(enc, &args->pPhysicalDeviceGroupProperties[i]);
} else {
vn_encode_array_size(enc, 0);

@ -1140,10 +1140,10 @@ static inline void vn_decode_vkGetImageSparseMemoryRequirements_args_temp(struct
args->pSparseMemoryRequirementCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pSparseMemoryRequirements = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSparseMemoryRequirements) * *args->pSparseMemoryRequirementCount);
args->pSparseMemoryRequirements = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSparseMemoryRequirements) * (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0));
if (!args->pSparseMemoryRequirements) return;
vn_decode_array_size(dec, *args->pSparseMemoryRequirementCount);
for (uint32_t i = 0; i < *args->pSparseMemoryRequirementCount; i++)
vn_decode_array_size(dec, (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0));
for (uint32_t i = 0; i < (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0); i++)
vn_decode_VkSparseImageMemoryRequirements_partial_temp(dec, &args->pSparseMemoryRequirements[i]);
} else {
vn_decode_array_size(dec, 0);
@ -1168,8 +1168,8 @@ static inline void vn_encode_vkGetImageSparseMemoryRequirements_reply(struct vn_
if (vn_encode_simple_pointer(enc, args->pSparseMemoryRequirementCount))
vn_encode_uint32_t(enc, args->pSparseMemoryRequirementCount);
if (args->pSparseMemoryRequirements) {
vn_encode_array_size(enc, *args->pSparseMemoryRequirementCount);
for (uint32_t i = 0; i < *args->pSparseMemoryRequirementCount; i++)
vn_encode_array_size(enc, (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0));
for (uint32_t i = 0; i < (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0); i++)
vn_encode_VkSparseImageMemoryRequirements(enc, &args->pSparseMemoryRequirements[i]);
} else {
vn_encode_array_size(enc, 0);
@ -1379,10 +1379,10 @@ static inline void vn_decode_vkGetImageSparseMemoryRequirements2_args_temp(struc
args->pSparseMemoryRequirementCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pSparseMemoryRequirements = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSparseMemoryRequirements) * *args->pSparseMemoryRequirementCount);
args->pSparseMemoryRequirements = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pSparseMemoryRequirements) * (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0));
if (!args->pSparseMemoryRequirements) return;
vn_decode_array_size(dec, *args->pSparseMemoryRequirementCount);
for (uint32_t i = 0; i < *args->pSparseMemoryRequirementCount; i++)
vn_decode_array_size(dec, (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0));
for (uint32_t i = 0; i < (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0); i++)
vn_decode_VkSparseImageMemoryRequirements2_partial_temp(dec, &args->pSparseMemoryRequirements[i]);
} else {
vn_decode_array_size(dec, 0);
@ -1408,8 +1408,8 @@ static inline void vn_encode_vkGetImageSparseMemoryRequirements2_reply(struct vn
if (vn_encode_simple_pointer(enc, args->pSparseMemoryRequirementCount))
vn_encode_uint32_t(enc, args->pSparseMemoryRequirementCount);
if (args->pSparseMemoryRequirements) {
vn_encode_array_size(enc, *args->pSparseMemoryRequirementCount);
for (uint32_t i = 0; i < *args->pSparseMemoryRequirementCount; i++)
vn_encode_array_size(enc, (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0));
for (uint32_t i = 0; i < (args->pSparseMemoryRequirementCount ? *args->pSparseMemoryRequirementCount : 0); i++)
vn_encode_VkSparseImageMemoryRequirements2(enc, &args->pSparseMemoryRequirements[i]);
} else {
vn_encode_array_size(enc, 0);

@ -297,10 +297,10 @@ static inline void vn_decode_vkEnumerateInstanceLayerProperties_args_temp(struct
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * (args->pPropertyCount ? *args->pPropertyCount : 0));
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_array_size(dec, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_decode_VkLayerProperties_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -322,8 +322,8 @@ static inline void vn_encode_vkEnumerateInstanceLayerProperties_reply(struct vn_
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_array_size(enc, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_encode_VkLayerProperties(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);
@ -349,10 +349,10 @@ static inline void vn_decode_vkEnumerateInstanceExtensionProperties_args_temp(st
args->pPropertyCount = NULL;
}
if (vn_peek_array_size(dec)) {
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * *args->pPropertyCount);
args->pProperties = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pProperties) * (args->pPropertyCount ? *args->pPropertyCount : 0));
if (!args->pProperties) return;
vn_decode_array_size(dec, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_decode_array_size(dec, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_decode_VkExtensionProperties_partial_temp(dec, &args->pProperties[i]);
} else {
vn_decode_array_size(dec, 0);
@ -376,8 +376,8 @@ static inline void vn_encode_vkEnumerateInstanceExtensionProperties_reply(struct
if (vn_encode_simple_pointer(enc, args->pPropertyCount))
vn_encode_uint32_t(enc, args->pPropertyCount);
if (args->pProperties) {
vn_encode_array_size(enc, *args->pPropertyCount);
for (uint32_t i = 0; i < *args->pPropertyCount; i++)
vn_encode_array_size(enc, (args->pPropertyCount ? *args->pPropertyCount : 0));
for (uint32_t i = 0; i < (args->pPropertyCount ? *args->pPropertyCount : 0); i++)
vn_encode_VkExtensionProperties(enc, &args->pProperties[i]);
} else {
vn_encode_array_size(enc, 0);

@ -163,7 +163,7 @@ static inline void vn_decode_vkGetPipelineCacheData_args_temp(struct vn_cs_decod
args->pDataSize = NULL;
}
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, *args->pDataSize);
const size_t array_size = vn_decode_array_size(dec, (args->pDataSize ? *args->pDataSize : 0));
args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!args->pData) return;
} else {
@ -190,8 +190,8 @@ static inline void vn_encode_vkGetPipelineCacheData_reply(struct vn_cs_encoder *
if (vn_encode_simple_pointer(enc, args->pDataSize))
vn_encode_size_t(enc, args->pDataSize);
if (args->pData) {
vn_encode_array_size(enc, *args->pDataSize);
vn_encode_blob_array(enc, args->pData, *args->pDataSize);
vn_encode_array_size(enc, (args->pDataSize ? *args->pDataSize : 0));
vn_encode_blob_array(enc, args->pData, (args->pDataSize ? *args->pDataSize : 0));
} else {
vn_encode_array_size(enc, 0);
}

@ -510,7 +510,7 @@ static inline void vn_decode_vkGetVenusExperimentalFeatureData100000MESA_args_te
args->pDataSize = NULL;
}
if (vn_peek_array_size(dec)) {
const size_t array_size = vn_decode_array_size(dec, *args->pDataSize);
const size_t array_size = vn_decode_array_size(dec, (args->pDataSize ? *args->pDataSize : 0));
args->pData = vn_cs_decoder_alloc_temp(dec, array_size);
if (!args->pData) return;
} else {
@ -532,8 +532,8 @@ static inline void vn_encode_vkGetVenusExperimentalFeatureData100000MESA_reply(s
if (vn_encode_simple_pointer(enc, args->pDataSize))
vn_encode_size_t(enc, args->pDataSize);
if (args->pData) {
vn_encode_array_size(enc, *args->pDataSize);
vn_encode_blob_array(enc, args->pData, *args->pDataSize);
vn_encode_array_size(enc, (args->pDataSize ? *args->pDataSize : 0));
vn_encode_blob_array(enc, args->pData, (args->pDataSize ? *args->pDataSize : 0));
} else {
vn_encode_array_size(enc, 0);
}

Loading…
Cancel
Save