From f656ca6a13114b8e3519772ae258d3fbb46ce0d7 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 11 Feb 2025 21:57:37 -0800 Subject: [PATCH] venus: sync venus protocol for below extensions VK_EXT_blend_operation_advanced VK_EXT_sample_locations Signed-off-by: Yiwei Zhang Part-of: --- .../venus-protocol/vn_protocol_driver.h | 2 +- .../vn_protocol_driver_command_buffer.h | 254 +++++++ .../vn_protocol_driver_defines.h | 2 + .../vn_protocol_driver_device.h | 700 ++++++++++++++++++ .../venus-protocol/vn_protocol_driver_info.h | 6 +- .../vn_protocol_driver_pipeline.h | 169 ++++- .../vn_protocol_driver_structs.h | 89 +++ 7 files changed, 1217 insertions(+), 5 deletions(-) diff --git a/src/virtio/venus-protocol/vn_protocol_driver.h b/src/virtio/venus-protocol/vn_protocol_driver.h index 6de656b06f4..f486dbdb6e7 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver.h +++ b/src/virtio/venus-protocol/vn_protocol_driver.h @@ -1,4 +1,4 @@ -/* This file is generated by venus-protocol git-ca1e9220. */ +/* This file is generated by venus-protocol git-5cb1399b. */ /* * Copyright 2020 Google LLC diff --git a/src/virtio/venus-protocol/vn_protocol_driver_command_buffer.h b/src/virtio/venus-protocol/vn_protocol_driver_command_buffer.h index f2196c93f51..d480254fe3d 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_command_buffer.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_command_buffer.h @@ -973,6 +973,14 @@ vn_sizeof_VkImageMemoryBarrier_pnext(const void *val) while (pnext) { switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkImageMemoryBarrier_pnext(pnext->pNext); + size += vn_sizeof_VkSampleLocationsInfoEXT_self((const VkSampleLocationsInfoEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: if (!vn_cs_renderer_protocol_has_extension(454 /* VK_EXT_external_memory_acquire_unmodified */)) break; @@ -1026,6 +1034,14 @@ vn_encode_VkImageMemoryBarrier_pnext(struct vn_cs_encoder *enc, const void *val) while (pnext) { switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkImageMemoryBarrier_pnext(enc, pnext->pNext); + vn_encode_VkSampleLocationsInfoEXT_self(enc, (const VkSampleLocationsInfoEXT *)pnext); + return; case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: if (!vn_cs_renderer_protocol_has_extension(454 /* VK_EXT_external_memory_acquire_unmodified */)) break; @@ -1193,6 +1209,125 @@ vn_encode_VkDeviceGroupRenderPassBeginInfo(struct vn_cs_encoder *enc, const VkDe vn_encode_VkDeviceGroupRenderPassBeginInfo_self(enc, val); } +/* struct VkAttachmentSampleLocationsEXT */ + +static inline size_t +vn_sizeof_VkAttachmentSampleLocationsEXT(const VkAttachmentSampleLocationsEXT *val) +{ + size_t size = 0; + size += vn_sizeof_uint32_t(&val->attachmentIndex); + size += vn_sizeof_VkSampleLocationsInfoEXT(&val->sampleLocationsInfo); + return size; +} + +static inline void +vn_encode_VkAttachmentSampleLocationsEXT(struct vn_cs_encoder *enc, const VkAttachmentSampleLocationsEXT *val) +{ + vn_encode_uint32_t(enc, &val->attachmentIndex); + vn_encode_VkSampleLocationsInfoEXT(enc, &val->sampleLocationsInfo); +} + +/* struct VkSubpassSampleLocationsEXT */ + +static inline size_t +vn_sizeof_VkSubpassSampleLocationsEXT(const VkSubpassSampleLocationsEXT *val) +{ + size_t size = 0; + size += vn_sizeof_uint32_t(&val->subpassIndex); + size += vn_sizeof_VkSampleLocationsInfoEXT(&val->sampleLocationsInfo); + return size; +} + +static inline void +vn_encode_VkSubpassSampleLocationsEXT(struct vn_cs_encoder *enc, const VkSubpassSampleLocationsEXT *val) +{ + vn_encode_uint32_t(enc, &val->subpassIndex); + vn_encode_VkSampleLocationsInfoEXT(enc, &val->sampleLocationsInfo); +} + +/* struct VkRenderPassSampleLocationsBeginInfoEXT chain */ + +static inline size_t +vn_sizeof_VkRenderPassSampleLocationsBeginInfoEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkRenderPassSampleLocationsBeginInfoEXT_self(const VkRenderPassSampleLocationsBeginInfoEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_uint32_t(&val->attachmentInitialSampleLocationsCount); + if (val->pAttachmentInitialSampleLocations) { + size += vn_sizeof_array_size(val->attachmentInitialSampleLocationsCount); + for (uint32_t i = 0; i < val->attachmentInitialSampleLocationsCount; i++) + size += vn_sizeof_VkAttachmentSampleLocationsEXT(&val->pAttachmentInitialSampleLocations[i]); + } else { + size += vn_sizeof_array_size(0); + } + size += vn_sizeof_uint32_t(&val->postSubpassSampleLocationsCount); + if (val->pPostSubpassSampleLocations) { + size += vn_sizeof_array_size(val->postSubpassSampleLocationsCount); + for (uint32_t i = 0; i < val->postSubpassSampleLocationsCount; i++) + size += vn_sizeof_VkSubpassSampleLocationsEXT(&val->pPostSubpassSampleLocations[i]); + } else { + size += vn_sizeof_array_size(0); + } + return size; +} + +static inline size_t +vn_sizeof_VkRenderPassSampleLocationsBeginInfoEXT(const VkRenderPassSampleLocationsBeginInfoEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkRenderPassSampleLocationsBeginInfoEXT_pnext(val->pNext); + size += vn_sizeof_VkRenderPassSampleLocationsBeginInfoEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkRenderPassSampleLocationsBeginInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkRenderPassSampleLocationsBeginInfoEXT_self(struct vn_cs_encoder *enc, const VkRenderPassSampleLocationsBeginInfoEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_uint32_t(enc, &val->attachmentInitialSampleLocationsCount); + if (val->pAttachmentInitialSampleLocations) { + vn_encode_array_size(enc, val->attachmentInitialSampleLocationsCount); + for (uint32_t i = 0; i < val->attachmentInitialSampleLocationsCount; i++) + vn_encode_VkAttachmentSampleLocationsEXT(enc, &val->pAttachmentInitialSampleLocations[i]); + } else { + vn_encode_array_size(enc, 0); + } + vn_encode_uint32_t(enc, &val->postSubpassSampleLocationsCount); + if (val->pPostSubpassSampleLocations) { + vn_encode_array_size(enc, val->postSubpassSampleLocationsCount); + for (uint32_t i = 0; i < val->postSubpassSampleLocationsCount; i++) + vn_encode_VkSubpassSampleLocationsEXT(enc, &val->pPostSubpassSampleLocations[i]); + } else { + vn_encode_array_size(enc, 0); + } +} + +static inline void +vn_encode_VkRenderPassSampleLocationsBeginInfoEXT(struct vn_cs_encoder *enc, const VkRenderPassSampleLocationsBeginInfoEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT }); + vn_encode_VkRenderPassSampleLocationsBeginInfoEXT_pnext(enc, val->pNext); + vn_encode_VkRenderPassSampleLocationsBeginInfoEXT_self(enc, val); +} + /* struct VkRenderPassAttachmentBeginInfo chain */ static inline size_t @@ -1276,6 +1411,14 @@ vn_sizeof_VkRenderPassBeginInfo_pnext(const void *val) size += vn_sizeof_VkRenderPassBeginInfo_pnext(pnext->pNext); size += vn_sizeof_VkDeviceGroupRenderPassBeginInfo_self((const VkDeviceGroupRenderPassBeginInfo *)pnext); return size; + case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkRenderPassBeginInfo_pnext(pnext->pNext); + size += vn_sizeof_VkRenderPassSampleLocationsBeginInfoEXT_self((const VkRenderPassSampleLocationsBeginInfoEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -1336,6 +1479,14 @@ vn_encode_VkRenderPassBeginInfo_pnext(struct vn_cs_encoder *enc, const void *val vn_encode_VkRenderPassBeginInfo_pnext(enc, pnext->pNext); vn_encode_VkDeviceGroupRenderPassBeginInfo_self(enc, (const VkDeviceGroupRenderPassBeginInfo *)pnext); return; + case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkRenderPassBeginInfo_pnext(enc, pnext->pNext); + vn_encode_VkRenderPassSampleLocationsBeginInfoEXT_self(enc, (const VkRenderPassSampleLocationsBeginInfoEXT *)pnext); + return; case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -2519,6 +2670,14 @@ vn_sizeof_VkImageMemoryBarrier2_pnext(const void *val) while (pnext) { switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkImageMemoryBarrier2_pnext(pnext->pNext); + size += vn_sizeof_VkSampleLocationsInfoEXT_self((const VkSampleLocationsInfoEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: if (!vn_cs_renderer_protocol_has_extension(454 /* VK_EXT_external_memory_acquire_unmodified */)) break; @@ -2574,6 +2733,14 @@ vn_encode_VkImageMemoryBarrier2_pnext(struct vn_cs_encoder *enc, const void *val while (pnext) { switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkImageMemoryBarrier2_pnext(enc, pnext->pNext); + vn_encode_VkSampleLocationsInfoEXT_self(enc, (const VkSampleLocationsInfoEXT *)pnext); + return; case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: if (!vn_cs_renderer_protocol_has_extension(454 /* VK_EXT_external_memory_acquire_unmodified */)) break; @@ -6418,6 +6585,53 @@ static inline void vn_decode_vkCmdDispatchBase_reply(struct vn_cs_decoder *dec, /* skip groupCountZ */ } +static inline size_t vn_sizeof_vkCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdSetSampleLocationsEXT_EXT; + const VkFlags cmd_flags = 0; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); + + cmd_size += vn_sizeof_VkCommandBuffer(&commandBuffer); + cmd_size += vn_sizeof_simple_pointer(pSampleLocationsInfo); + if (pSampleLocationsInfo) + cmd_size += vn_sizeof_VkSampleLocationsInfoEXT(pSampleLocationsInfo); + + return cmd_size; +} + +static inline void vn_encode_vkCmdSetSampleLocationsEXT(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdSetSampleLocationsEXT_EXT; + + vn_encode_VkCommandTypeEXT(enc, &cmd_type); + vn_encode_VkFlags(enc, &cmd_flags); + + vn_encode_VkCommandBuffer(enc, &commandBuffer); + if (vn_encode_simple_pointer(enc, pSampleLocationsInfo)) + vn_encode_VkSampleLocationsInfoEXT(enc, pSampleLocationsInfo); +} + +static inline size_t vn_sizeof_vkCmdSetSampleLocationsEXT_reply(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdSetSampleLocationsEXT_EXT; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); + + /* skip commandBuffer */ + /* skip pSampleLocationsInfo */ + + return cmd_size; +} + +static inline void vn_decode_vkCmdSetSampleLocationsEXT_reply(struct vn_cs_decoder *dec, VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) +{ + VkCommandTypeEXT command_type; + vn_decode_VkCommandTypeEXT(dec, &command_type); + assert(command_type == VK_COMMAND_TYPE_vkCmdSetSampleLocationsEXT_EXT); + + /* skip commandBuffer */ + /* skip pSampleLocationsInfo */ +} + static inline size_t vn_sizeof_vkCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) { const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdBeginRenderPass2_EXT; @@ -11109,6 +11323,27 @@ static inline void vn_submit_vkCmdDispatchBase(struct vn_ring *vn_ring, VkComman } } +static inline void vn_submit_vkCmdSetSampleLocationsEXT(struct vn_ring *vn_ring, VkCommandFlagsEXT cmd_flags, VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo, struct vn_ring_submit_command *submit) +{ + uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; + void *cmd_data = local_cmd_data; + size_t cmd_size = vn_sizeof_vkCmdSetSampleLocationsEXT(commandBuffer, pSampleLocationsInfo); + if (cmd_size > sizeof(local_cmd_data)) { + cmd_data = malloc(cmd_size); + if (!cmd_data) + cmd_size = 0; + } + const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkCmdSetSampleLocationsEXT_reply(commandBuffer, pSampleLocationsInfo) : 0; + + struct vn_cs_encoder *enc = vn_ring_submit_command_init(vn_ring, submit, cmd_data, cmd_size, reply_size); + if (cmd_size) { + vn_encode_vkCmdSetSampleLocationsEXT(enc, cmd_flags, commandBuffer, pSampleLocationsInfo); + vn_ring_submit_command(vn_ring, submit); + if (cmd_data != local_cmd_data) + free(cmd_data); + } +} + static inline void vn_submit_vkCmdBeginRenderPass2(struct vn_ring *vn_ring, VkCommandFlagsEXT cmd_flags, VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo, struct vn_ring_submit_command *submit) { uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; @@ -13592,6 +13827,25 @@ static inline void vn_async_vkCmdDispatchBase(struct vn_ring *vn_ring, VkCommand vn_submit_vkCmdDispatchBase(vn_ring, 0, commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ, &submit); } +static inline void vn_call_vkCmdSetSampleLocationsEXT(struct vn_ring *vn_ring, VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) +{ + VN_TRACE_FUNC(); + + struct vn_ring_submit_command submit; + vn_submit_vkCmdSetSampleLocationsEXT(vn_ring, VK_COMMAND_GENERATE_REPLY_BIT_EXT, commandBuffer, pSampleLocationsInfo, &submit); + struct vn_cs_decoder *dec = vn_ring_get_command_reply(vn_ring, &submit); + if (dec) { + vn_decode_vkCmdSetSampleLocationsEXT_reply(dec, commandBuffer, pSampleLocationsInfo); + vn_ring_free_command_reply(vn_ring, &submit); + } +} + +static inline void vn_async_vkCmdSetSampleLocationsEXT(struct vn_ring *vn_ring, VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) +{ + struct vn_ring_submit_command submit; + vn_submit_vkCmdSetSampleLocationsEXT(vn_ring, 0, commandBuffer, pSampleLocationsInfo, &submit); +} + static inline void vn_call_vkCmdBeginRenderPass2(struct vn_ring *vn_ring, VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) { VN_TRACE_FUNC(); diff --git a/src/virtio/venus-protocol/vn_protocol_driver_defines.h b/src/virtio/venus-protocol/vn_protocol_driver_defines.h index 36725e592d5..f996a4e885a 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_defines.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_defines.h @@ -335,6 +335,8 @@ typedef enum VkCommandTypeEXT { VK_COMMAND_TYPE_vkCmdEndConditionalRenderingEXT_EXT = 241, VK_COMMAND_TYPE_vkImportFenceFdKHR_EXT = 238, VK_COMMAND_TYPE_vkGetFenceFdKHR_EXT = 239, + VK_COMMAND_TYPE_vkCmdSetSampleLocationsEXT_EXT = 283, + VK_COMMAND_TYPE_vkGetPhysicalDeviceMultisamplePropertiesEXT_EXT = 284, VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT = 187, VK_COMMAND_TYPE_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_EXT = 235, VK_COMMAND_TYPE_vkGetCalibratedTimestampsEXT_EXT = 236, diff --git a/src/virtio/venus-protocol/vn_protocol_driver_device.h b/src/virtio/venus-protocol/vn_protocol_driver_device.h index 8cd937f44df..0421ca0bcdb 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_device.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_device.h @@ -2238,6 +2238,137 @@ vn_encode_VkPhysicalDeviceProtectedMemoryFeatures_partial(struct vn_cs_encoder * vn_encode_VkPhysicalDeviceProtectedMemoryFeatures_self_partial(enc, val); } +/* struct VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT chain */ + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkBool32(&val->advancedBlendCoherentOperations); + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext(val->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(struct vn_cs_encoder *enc, const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkBool32(enc, &val->advancedBlendCoherentOperations); +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(struct vn_cs_encoder *enc, const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT }); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext(enc, val->pNext); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(enc, val); +} + +static inline void +vn_decode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext(struct vn_cs_decoder *dec, const void *val) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + assert(false); +} + +static inline void +vn_decode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(struct vn_cs_decoder *dec, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_VkBool32(dec, &val->advancedBlendCoherentOperations); +} + +static inline void +vn_decode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT(struct vn_cs_decoder *dec, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT); + + assert(val->sType == stype); + vn_decode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext(dec, val->pNext); + vn_decode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self_partial(const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + /* skip val->advancedBlendCoherentOperations */ + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_partial(const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext_partial(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->advancedBlendCoherentOperations */ +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT }); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self_partial(enc, val); +} + /* struct VkPhysicalDeviceMultiDrawFeaturesEXT chain */ static inline size_t @@ -11199,6 +11330,14 @@ vn_sizeof_VkPhysicalDeviceFeatures2_pnext(const void *val) size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceProtectedMemoryFeatures_self((const VkPhysicalDeviceProtectedMemoryFeatures *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self((const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: if (!vn_cs_renderer_protocol_has_extension(393 /* VK_EXT_multi_draw */)) break; @@ -11747,6 +11886,14 @@ vn_encode_VkPhysicalDeviceFeatures2_pnext(struct vn_cs_encoder *enc, const void vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); vn_encode_VkPhysicalDeviceProtectedMemoryFeatures_self(enc, (const VkPhysicalDeviceProtectedMemoryFeatures *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(enc, (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: if (!vn_cs_renderer_protocol_has_extension(393 /* VK_EXT_multi_draw */)) break; @@ -12286,6 +12433,10 @@ vn_decode_VkPhysicalDeviceFeatures2_pnext(struct vn_cs_decoder *dec, const void vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceProtectedMemoryFeatures_self(dec, (VkPhysicalDeviceProtectedMemoryFeatures *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: + vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); + vn_decode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(dec, (VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceMultiDrawFeaturesEXT_self(dec, (VkPhysicalDeviceMultiDrawFeaturesEXT *)pnext); @@ -12611,6 +12762,14 @@ vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(const void *val) size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceProtectedMemoryFeatures_self_partial((const VkPhysicalDeviceProtectedMemoryFeatures *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self_partial((const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: if (!vn_cs_renderer_protocol_has_extension(393 /* VK_EXT_multi_draw */)) break; @@ -13159,6 +13318,14 @@ vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(struct vn_cs_encoder *enc, con vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(enc, pnext->pNext); vn_encode_VkPhysicalDeviceProtectedMemoryFeatures_self_partial(enc, (const VkPhysicalDeviceProtectedMemoryFeatures *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self_partial(enc, (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: if (!vn_cs_renderer_protocol_has_extension(393 /* VK_EXT_multi_draw */)) break; @@ -13792,6 +13959,14 @@ vn_sizeof_VkDeviceCreateInfo_pnext(const void *val) size += vn_sizeof_VkDeviceCreateInfo_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceProtectedMemoryFeatures_self((const VkPhysicalDeviceProtectedMemoryFeatures *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkDeviceCreateInfo_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self((const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: if (!vn_cs_renderer_protocol_has_extension(393 /* VK_EXT_multi_draw */)) break; @@ -14393,6 +14568,14 @@ vn_encode_VkDeviceCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val) vn_encode_VkDeviceCreateInfo_pnext(enc, pnext->pNext); vn_encode_VkPhysicalDeviceProtectedMemoryFeatures_self(enc, (const VkPhysicalDeviceProtectedMemoryFeatures *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkDeviceCreateInfo_pnext(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT_self(enc, (const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: if (!vn_cs_renderer_protocol_has_extension(393 /* VK_EXT_multi_draw */)) break; @@ -15999,6 +16182,262 @@ vn_encode_VkPhysicalDeviceSamplerFilterMinmaxProperties_partial(struct vn_cs_enc vn_encode_VkPhysicalDeviceSamplerFilterMinmaxProperties_self_partial(enc, val); } +/* struct VkPhysicalDeviceSampleLocationsPropertiesEXT chain */ + +static inline size_t +vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_self(const VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkFlags(&val->sampleLocationSampleCounts); + size += vn_sizeof_VkExtent2D(&val->maxSampleLocationGridSize); + size += vn_sizeof_array_size(2); + size += vn_sizeof_float_array(val->sampleLocationCoordinateRange, 2); + size += vn_sizeof_uint32_t(&val->sampleLocationSubPixelBits); + size += vn_sizeof_VkBool32(&val->variableSampleLocations); + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT(const VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext(val->pNext); + size += vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_self(val); + + return size; +} + +static inline void +vn_decode_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext(struct vn_cs_decoder *dec, const void *val) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + assert(false); +} + +static inline void +vn_decode_VkPhysicalDeviceSampleLocationsPropertiesEXT_self(struct vn_cs_decoder *dec, VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_VkFlags(dec, &val->sampleLocationSampleCounts); + vn_decode_VkExtent2D(dec, &val->maxSampleLocationGridSize); + { + const size_t array_size = vn_decode_array_size(dec, 2); + vn_decode_float_array(dec, val->sampleLocationCoordinateRange, array_size); + } + vn_decode_uint32_t(dec, &val->sampleLocationSubPixelBits); + vn_decode_VkBool32(dec, &val->variableSampleLocations); +} + +static inline void +vn_decode_VkPhysicalDeviceSampleLocationsPropertiesEXT(struct vn_cs_decoder *dec, VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT); + + assert(val->sType == stype); + vn_decode_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext(dec, val->pNext); + vn_decode_VkPhysicalDeviceSampleLocationsPropertiesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_self_partial(const VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + /* skip val->sampleLocationSampleCounts */ + size += vn_sizeof_VkExtent2D_partial(&val->maxSampleLocationGridSize); + /* skip val->sampleLocationCoordinateRange */ + /* skip val->sampleLocationSubPixelBits */ + /* skip val->variableSampleLocations */ + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_partial(const VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext_partial(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPhysicalDeviceSampleLocationsPropertiesEXT_self_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->sampleLocationSampleCounts */ + vn_encode_VkExtent2D_partial(enc, &val->maxSampleLocationGridSize); + /* skip val->sampleLocationCoordinateRange */ + /* skip val->sampleLocationSubPixelBits */ + /* skip val->variableSampleLocations */ +} + +static inline void +vn_encode_VkPhysicalDeviceSampleLocationsPropertiesEXT_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceSampleLocationsPropertiesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT }); + vn_encode_VkPhysicalDeviceSampleLocationsPropertiesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkPhysicalDeviceSampleLocationsPropertiesEXT_self_partial(enc, val); +} + +/* struct VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT chain */ + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self(const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_uint32_t(&val->advancedBlendMaxColorAttachments); + size += vn_sizeof_VkBool32(&val->advancedBlendIndependentBlend); + size += vn_sizeof_VkBool32(&val->advancedBlendNonPremultipliedSrcColor); + size += vn_sizeof_VkBool32(&val->advancedBlendNonPremultipliedDstColor); + size += vn_sizeof_VkBool32(&val->advancedBlendCorrelatedOverlap); + size += vn_sizeof_VkBool32(&val->advancedBlendAllOperations); + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext(val->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self(val); + + return size; +} + +static inline void +vn_decode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext(struct vn_cs_decoder *dec, const void *val) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + assert(false); +} + +static inline void +vn_decode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self(struct vn_cs_decoder *dec, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_uint32_t(dec, &val->advancedBlendMaxColorAttachments); + vn_decode_VkBool32(dec, &val->advancedBlendIndependentBlend); + vn_decode_VkBool32(dec, &val->advancedBlendNonPremultipliedSrcColor); + vn_decode_VkBool32(dec, &val->advancedBlendNonPremultipliedDstColor); + vn_decode_VkBool32(dec, &val->advancedBlendCorrelatedOverlap); + vn_decode_VkBool32(dec, &val->advancedBlendAllOperations); +} + +static inline void +vn_decode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT(struct vn_cs_decoder *dec, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT); + + assert(val->sType == stype); + vn_decode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext(dec, val->pNext); + vn_decode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self_partial(const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + /* skip val->advancedBlendMaxColorAttachments */ + /* skip val->advancedBlendIndependentBlend */ + /* skip val->advancedBlendNonPremultipliedSrcColor */ + /* skip val->advancedBlendNonPremultipliedDstColor */ + /* skip val->advancedBlendCorrelatedOverlap */ + /* skip val->advancedBlendAllOperations */ + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_partial(const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext_partial(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->advancedBlendMaxColorAttachments */ + /* skip val->advancedBlendIndependentBlend */ + /* skip val->advancedBlendNonPremultipliedSrcColor */ + /* skip val->advancedBlendNonPremultipliedDstColor */ + /* skip val->advancedBlendCorrelatedOverlap */ + /* skip val->advancedBlendAllOperations */ +} + +static inline void +vn_encode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT }); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self_partial(enc, val); +} + /* struct VkPhysicalDeviceInlineUniformBlockProperties chain */ static inline size_t @@ -19723,6 +20162,22 @@ vn_sizeof_VkPhysicalDeviceProperties2_pnext(const void *val) size += vn_sizeof_VkPhysicalDeviceProperties2_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceSamplerFilterMinmaxProperties_self((const VkPhysicalDeviceSamplerFilterMinmaxProperties *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_self((const VkPhysicalDeviceSampleLocationsPropertiesEXT *)pnext); + return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self((const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: if (!vn_cs_renderer_protocol_has_extension(139 /* VK_EXT_inline_uniform_block */)) break; @@ -19995,6 +20450,14 @@ vn_decode_VkPhysicalDeviceProperties2_pnext(struct vn_cs_decoder *dec, const voi vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceSamplerFilterMinmaxProperties_self(dec, (VkPhysicalDeviceSamplerFilterMinmaxProperties *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: + vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); + vn_decode_VkPhysicalDeviceSampleLocationsPropertiesEXT_self(dec, (VkPhysicalDeviceSampleLocationsPropertiesEXT *)pnext); + break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: + vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); + vn_decode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self(dec, (VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceInlineUniformBlockProperties_self(dec, (VkPhysicalDeviceInlineUniformBlockProperties *)pnext); @@ -20186,6 +20649,22 @@ vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(const void *val) size += vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceSamplerFilterMinmaxProperties_self_partial((const VkPhysicalDeviceSamplerFilterMinmaxProperties *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceSampleLocationsPropertiesEXT_self_partial((const VkPhysicalDeviceSampleLocationsPropertiesEXT *)pnext); + return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self_partial((const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: if (!vn_cs_renderer_protocol_has_extension(139 /* VK_EXT_inline_uniform_block */)) break; @@ -20468,6 +20947,22 @@ vn_encode_VkPhysicalDeviceProperties2_pnext_partial(struct vn_cs_encoder *enc, c vn_encode_VkPhysicalDeviceProperties2_pnext_partial(enc, pnext->pNext); vn_encode_VkPhysicalDeviceSamplerFilterMinmaxProperties_self_partial(enc, (const VkPhysicalDeviceSamplerFilterMinmaxProperties *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceProperties2_pnext_partial(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceSampleLocationsPropertiesEXT_self_partial(enc, (const VkPhysicalDeviceSampleLocationsPropertiesEXT *)pnext); + return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceProperties2_pnext_partial(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT_self_partial(enc, (const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: if (!vn_cs_renderer_protocol_has_extension(139 /* VK_EXT_inline_uniform_block */)) break; @@ -23379,6 +23874,114 @@ vn_encode_VkPhysicalDeviceGroupProperties_partial(struct vn_cs_encoder *enc, con vn_encode_VkPhysicalDeviceGroupProperties_self_partial(enc, val); } +/* struct VkMultisamplePropertiesEXT chain */ + +static inline size_t +vn_sizeof_VkMultisamplePropertiesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkMultisamplePropertiesEXT_self(const VkMultisamplePropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkExtent2D(&val->maxSampleLocationGridSize); + return size; +} + +static inline size_t +vn_sizeof_VkMultisamplePropertiesEXT(const VkMultisamplePropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkMultisamplePropertiesEXT_pnext(val->pNext); + size += vn_sizeof_VkMultisamplePropertiesEXT_self(val); + + return size; +} + +static inline void +vn_decode_VkMultisamplePropertiesEXT_pnext(struct vn_cs_decoder *dec, const void *val) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + assert(false); +} + +static inline void +vn_decode_VkMultisamplePropertiesEXT_self(struct vn_cs_decoder *dec, VkMultisamplePropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_VkExtent2D(dec, &val->maxSampleLocationGridSize); +} + +static inline void +vn_decode_VkMultisamplePropertiesEXT(struct vn_cs_decoder *dec, VkMultisamplePropertiesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT); + + assert(val->sType == stype); + vn_decode_VkMultisamplePropertiesEXT_pnext(dec, val->pNext); + vn_decode_VkMultisamplePropertiesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkMultisamplePropertiesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkMultisamplePropertiesEXT_self_partial(const VkMultisamplePropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkExtent2D_partial(&val->maxSampleLocationGridSize); + return size; +} + +static inline size_t +vn_sizeof_VkMultisamplePropertiesEXT_partial(const VkMultisamplePropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkMultisamplePropertiesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkMultisamplePropertiesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkMultisamplePropertiesEXT_pnext_partial(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkMultisamplePropertiesEXT_self_partial(struct vn_cs_encoder *enc, const VkMultisamplePropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkExtent2D_partial(enc, &val->maxSampleLocationGridSize); +} + +static inline void +vn_encode_VkMultisamplePropertiesEXT_partial(struct vn_cs_encoder *enc, const VkMultisamplePropertiesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT }); + vn_encode_VkMultisamplePropertiesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkMultisamplePropertiesEXT_self_partial(enc, val); +} + /* struct VkDeviceQueueTimelineInfoMESA chain */ static inline size_t @@ -25596,6 +26199,63 @@ static inline void vn_decode_vkGetDeviceGroupPeerMemoryFeatures_reply(struct vn_ } } +static inline size_t vn_sizeof_vkGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetPhysicalDeviceMultisamplePropertiesEXT_EXT; + const VkFlags cmd_flags = 0; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); + + cmd_size += vn_sizeof_VkPhysicalDevice(&physicalDevice); + cmd_size += vn_sizeof_VkSampleCountFlagBits(&samples); + cmd_size += vn_sizeof_simple_pointer(pMultisampleProperties); + if (pMultisampleProperties) + cmd_size += vn_sizeof_VkMultisamplePropertiesEXT_partial(pMultisampleProperties); + + return cmd_size; +} + +static inline void vn_encode_vkGetPhysicalDeviceMultisamplePropertiesEXT(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetPhysicalDeviceMultisamplePropertiesEXT_EXT; + + vn_encode_VkCommandTypeEXT(enc, &cmd_type); + vn_encode_VkFlags(enc, &cmd_flags); + + vn_encode_VkPhysicalDevice(enc, &physicalDevice); + vn_encode_VkSampleCountFlagBits(enc, &samples); + if (vn_encode_simple_pointer(enc, pMultisampleProperties)) + vn_encode_VkMultisamplePropertiesEXT_partial(enc, pMultisampleProperties); +} + +static inline size_t vn_sizeof_vkGetPhysicalDeviceMultisamplePropertiesEXT_reply(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetPhysicalDeviceMultisamplePropertiesEXT_EXT; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); + + /* skip physicalDevice */ + /* skip samples */ + cmd_size += vn_sizeof_simple_pointer(pMultisampleProperties); + if (pMultisampleProperties) + cmd_size += vn_sizeof_VkMultisamplePropertiesEXT(pMultisampleProperties); + + return cmd_size; +} + +static inline void vn_decode_vkGetPhysicalDeviceMultisamplePropertiesEXT_reply(struct vn_cs_decoder *dec, VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) +{ + VkCommandTypeEXT command_type; + vn_decode_VkCommandTypeEXT(dec, &command_type); + assert(command_type == VK_COMMAND_TYPE_vkGetPhysicalDeviceMultisamplePropertiesEXT_EXT); + + /* skip physicalDevice */ + /* skip samples */ + if (vn_decode_simple_pointer(dec)) { + vn_decode_VkMultisamplePropertiesEXT(dec, pMultisampleProperties); + } else { + pMultisampleProperties = NULL; + } +} + static inline size_t vn_sizeof_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) { const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetDeviceQueue2_EXT; @@ -26543,6 +27203,27 @@ static inline void vn_submit_vkGetDeviceGroupPeerMemoryFeatures(struct vn_ring * } } +static inline void vn_submit_vkGetPhysicalDeviceMultisamplePropertiesEXT(struct vn_ring *vn_ring, VkCommandFlagsEXT cmd_flags, VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties, struct vn_ring_submit_command *submit) +{ + uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; + void *cmd_data = local_cmd_data; + size_t cmd_size = vn_sizeof_vkGetPhysicalDeviceMultisamplePropertiesEXT(physicalDevice, samples, pMultisampleProperties); + if (cmd_size > sizeof(local_cmd_data)) { + cmd_data = malloc(cmd_size); + if (!cmd_data) + cmd_size = 0; + } + const size_t reply_size = cmd_flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT ? vn_sizeof_vkGetPhysicalDeviceMultisamplePropertiesEXT_reply(physicalDevice, samples, pMultisampleProperties) : 0; + + struct vn_cs_encoder *enc = vn_ring_submit_command_init(vn_ring, submit, cmd_data, cmd_size, reply_size); + if (cmd_size) { + vn_encode_vkGetPhysicalDeviceMultisamplePropertiesEXT(enc, cmd_flags, physicalDevice, samples, pMultisampleProperties); + vn_ring_submit_command(vn_ring, submit); + if (cmd_data != local_cmd_data) + free(cmd_data); + } +} + static inline void vn_submit_vkGetDeviceQueue2(struct vn_ring *vn_ring, VkCommandFlagsEXT cmd_flags, VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue, struct vn_ring_submit_command *submit) { uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; @@ -27166,6 +27847,25 @@ static inline void vn_async_vkGetDeviceGroupPeerMemoryFeatures(struct vn_ring *v vn_submit_vkGetDeviceGroupPeerMemoryFeatures(vn_ring, 0, device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures, &submit); } +static inline void vn_call_vkGetPhysicalDeviceMultisamplePropertiesEXT(struct vn_ring *vn_ring, VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) +{ + VN_TRACE_FUNC(); + + struct vn_ring_submit_command submit; + vn_submit_vkGetPhysicalDeviceMultisamplePropertiesEXT(vn_ring, VK_COMMAND_GENERATE_REPLY_BIT_EXT, physicalDevice, samples, pMultisampleProperties, &submit); + struct vn_cs_decoder *dec = vn_ring_get_command_reply(vn_ring, &submit); + if (dec) { + vn_decode_vkGetPhysicalDeviceMultisamplePropertiesEXT_reply(dec, physicalDevice, samples, pMultisampleProperties); + vn_ring_free_command_reply(vn_ring, &submit); + } +} + +static inline void vn_async_vkGetPhysicalDeviceMultisamplePropertiesEXT(struct vn_ring *vn_ring, VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) +{ + struct vn_ring_submit_command submit; + vn_submit_vkGetPhysicalDeviceMultisamplePropertiesEXT(vn_ring, 0, physicalDevice, samples, pMultisampleProperties, &submit); +} + static inline void vn_call_vkGetDeviceQueue2(struct vn_ring *vn_ring, VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) { VN_TRACE_FUNC(); diff --git a/src/virtio/venus-protocol/vn_protocol_driver_info.h b/src/virtio/venus-protocol/vn_protocol_driver_info.h index 429a0120d90..43517ee7823 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_info.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_info.h @@ -19,10 +19,11 @@ struct vn_info_extension { }; /* sorted by extension names for bsearch */ -static const uint32_t _vn_info_extension_count = 118; -static const struct vn_info_extension _vn_info_extensions[118] = { +static const uint32_t _vn_info_extension_count = 120; +static const struct vn_info_extension _vn_info_extensions[120] = { { "VK_EXT_4444_formats", 341, 1 }, { "VK_EXT_attachment_feedback_loop_layout", 340, 2 }, + { "VK_EXT_blend_operation_advanced", 149, 2 }, { "VK_EXT_border_color_swizzle", 412, 1 }, { "VK_EXT_calibrated_timestamps", 185, 2 }, { "VK_EXT_color_write_enable", 382, 1 }, @@ -64,6 +65,7 @@ static const struct vn_info_extension _vn_info_extensions[118] = { { "VK_EXT_queue_family_foreign", 127, 1 }, { "VK_EXT_rasterization_order_attachment_access", 464, 1 }, { "VK_EXT_robustness2", 287, 1 }, + { "VK_EXT_sample_locations", 144, 1 }, { "VK_EXT_sampler_filter_minmax", 131, 2 }, { "VK_EXT_scalar_block_layout", 222, 1 }, { "VK_EXT_separate_stencil_usage", 247, 1 }, diff --git a/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h b/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h index 2a34988dbbf..15d68fd228e 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h @@ -1328,12 +1328,86 @@ vn_encode_VkPipelineRasterizationStateCreateInfo(struct vn_cs_encoder *enc, cons vn_encode_VkPipelineRasterizationStateCreateInfo_self(enc, val); } +/* struct VkPipelineSampleLocationsStateCreateInfoEXT chain */ + +static inline size_t +vn_sizeof_VkPipelineSampleLocationsStateCreateInfoEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPipelineSampleLocationsStateCreateInfoEXT_self(const VkPipelineSampleLocationsStateCreateInfoEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkBool32(&val->sampleLocationsEnable); + size += vn_sizeof_VkSampleLocationsInfoEXT(&val->sampleLocationsInfo); + return size; +} + +static inline size_t +vn_sizeof_VkPipelineSampleLocationsStateCreateInfoEXT(const VkPipelineSampleLocationsStateCreateInfoEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPipelineSampleLocationsStateCreateInfoEXT_pnext(val->pNext); + size += vn_sizeof_VkPipelineSampleLocationsStateCreateInfoEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkPipelineSampleLocationsStateCreateInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPipelineSampleLocationsStateCreateInfoEXT_self(struct vn_cs_encoder *enc, const VkPipelineSampleLocationsStateCreateInfoEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkBool32(enc, &val->sampleLocationsEnable); + vn_encode_VkSampleLocationsInfoEXT(enc, &val->sampleLocationsInfo); +} + +static inline void +vn_encode_VkPipelineSampleLocationsStateCreateInfoEXT(struct vn_cs_encoder *enc, const VkPipelineSampleLocationsStateCreateInfoEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT }); + vn_encode_VkPipelineSampleLocationsStateCreateInfoEXT_pnext(enc, val->pNext); + vn_encode_VkPipelineSampleLocationsStateCreateInfoEXT_self(enc, val); +} + /* struct VkPipelineMultisampleStateCreateInfo chain */ static inline size_t vn_sizeof_VkPipelineMultisampleStateCreateInfo_pnext(const void *val) { - /* no known/supported struct */ + const VkBaseInStructure *pnext = val; + size_t size = 0; + + while (pnext) { + switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPipelineMultisampleStateCreateInfo_pnext(pnext->pNext); + size += vn_sizeof_VkPipelineSampleLocationsStateCreateInfoEXT_self((const VkPipelineSampleLocationsStateCreateInfoEXT *)pnext); + return size; + default: + /* ignore unknown/unsupported struct */ + break; + } + pnext = pnext->pNext; + } + return vn_sizeof_simple_pointer(NULL); } @@ -1372,7 +1446,25 @@ vn_sizeof_VkPipelineMultisampleStateCreateInfo(const VkPipelineMultisampleStateC static inline void vn_encode_VkPipelineMultisampleStateCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val) { - /* no known/supported struct */ + const VkBaseInStructure *pnext = val; + + while (pnext) { + switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(144 /* VK_EXT_sample_locations */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPipelineMultisampleStateCreateInfo_pnext(enc, pnext->pNext); + vn_encode_VkPipelineSampleLocationsStateCreateInfoEXT_self(enc, (const VkPipelineSampleLocationsStateCreateInfoEXT *)pnext); + return; + default: + /* ignore unknown/unsupported struct */ + break; + } + pnext = pnext->pNext; + } + vn_encode_simple_pointer(enc, NULL); } @@ -1532,6 +1624,63 @@ vn_encode_VkPipelineColorBlendAttachmentState(struct vn_cs_encoder *enc, const V vn_encode_VkFlags(enc, &val->colorWriteMask); } +/* struct VkPipelineColorBlendAdvancedStateCreateInfoEXT chain */ + +static inline size_t +vn_sizeof_VkPipelineColorBlendAdvancedStateCreateInfoEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPipelineColorBlendAdvancedStateCreateInfoEXT_self(const VkPipelineColorBlendAdvancedStateCreateInfoEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkBool32(&val->srcPremultiplied); + size += vn_sizeof_VkBool32(&val->dstPremultiplied); + size += vn_sizeof_VkBlendOverlapEXT(&val->blendOverlap); + return size; +} + +static inline size_t +vn_sizeof_VkPipelineColorBlendAdvancedStateCreateInfoEXT(const VkPipelineColorBlendAdvancedStateCreateInfoEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPipelineColorBlendAdvancedStateCreateInfoEXT_pnext(val->pNext); + size += vn_sizeof_VkPipelineColorBlendAdvancedStateCreateInfoEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkPipelineColorBlendAdvancedStateCreateInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPipelineColorBlendAdvancedStateCreateInfoEXT_self(struct vn_cs_encoder *enc, const VkPipelineColorBlendAdvancedStateCreateInfoEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkBool32(enc, &val->srcPremultiplied); + vn_encode_VkBool32(enc, &val->dstPremultiplied); + vn_encode_VkBlendOverlapEXT(enc, &val->blendOverlap); +} + +static inline void +vn_encode_VkPipelineColorBlendAdvancedStateCreateInfoEXT(struct vn_cs_encoder *enc, const VkPipelineColorBlendAdvancedStateCreateInfoEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT }); + vn_encode_VkPipelineColorBlendAdvancedStateCreateInfoEXT_pnext(enc, val->pNext); + vn_encode_VkPipelineColorBlendAdvancedStateCreateInfoEXT_self(enc, val); +} + /* struct VkPipelineColorWriteCreateInfoEXT chain */ static inline size_t @@ -1607,6 +1756,14 @@ vn_sizeof_VkPipelineColorBlendStateCreateInfo_pnext(const void *val) while (pnext) { switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPipelineColorBlendStateCreateInfo_pnext(pnext->pNext); + size += vn_sizeof_VkPipelineColorBlendAdvancedStateCreateInfoEXT_self((const VkPipelineColorBlendAdvancedStateCreateInfoEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: if (!vn_cs_renderer_protocol_has_extension(382 /* VK_EXT_color_write_enable */)) break; @@ -1665,6 +1822,14 @@ vn_encode_VkPipelineColorBlendStateCreateInfo_pnext(struct vn_cs_encoder *enc, c while (pnext) { switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: + if (!vn_cs_renderer_protocol_has_extension(149 /* VK_EXT_blend_operation_advanced */)) + break; + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPipelineColorBlendStateCreateInfo_pnext(enc, pnext->pNext); + vn_encode_VkPipelineColorBlendAdvancedStateCreateInfoEXT_self(enc, (const VkPipelineColorBlendAdvancedStateCreateInfoEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: if (!vn_cs_renderer_protocol_has_extension(382 /* VK_EXT_color_write_enable */)) break; diff --git a/src/virtio/venus-protocol/vn_protocol_driver_structs.h b/src/virtio/venus-protocol/vn_protocol_driver_structs.h index cac5f1159a8..bfc02d70386 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_structs.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_structs.h @@ -844,6 +844,95 @@ vn_encode_VkRect2D_partial(struct vn_cs_encoder *enc, const VkRect2D *val) vn_encode_VkExtent2D_partial(enc, &val->extent); } +/* struct VkSampleLocationEXT */ + +static inline size_t +vn_sizeof_VkSampleLocationEXT(const VkSampleLocationEXT *val) +{ + size_t size = 0; + size += vn_sizeof_float(&val->x); + size += vn_sizeof_float(&val->y); + return size; +} + +static inline void +vn_encode_VkSampleLocationEXT(struct vn_cs_encoder *enc, const VkSampleLocationEXT *val) +{ + vn_encode_float(enc, &val->x); + vn_encode_float(enc, &val->y); +} + +/* struct VkSampleLocationsInfoEXT chain */ + +static inline size_t +vn_sizeof_VkSampleLocationsInfoEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkSampleLocationsInfoEXT_self(const VkSampleLocationsInfoEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkSampleCountFlagBits(&val->sampleLocationsPerPixel); + size += vn_sizeof_VkExtent2D(&val->sampleLocationGridSize); + size += vn_sizeof_uint32_t(&val->sampleLocationsCount); + if (val->pSampleLocations) { + size += vn_sizeof_array_size(val->sampleLocationsCount); + for (uint32_t i = 0; i < val->sampleLocationsCount; i++) + size += vn_sizeof_VkSampleLocationEXT(&val->pSampleLocations[i]); + } else { + size += vn_sizeof_array_size(0); + } + return size; +} + +static inline size_t +vn_sizeof_VkSampleLocationsInfoEXT(const VkSampleLocationsInfoEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkSampleLocationsInfoEXT_pnext(val->pNext); + size += vn_sizeof_VkSampleLocationsInfoEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkSampleLocationsInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkSampleLocationsInfoEXT_self(struct vn_cs_encoder *enc, const VkSampleLocationsInfoEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkSampleCountFlagBits(enc, &val->sampleLocationsPerPixel); + vn_encode_VkExtent2D(enc, &val->sampleLocationGridSize); + vn_encode_uint32_t(enc, &val->sampleLocationsCount); + if (val->pSampleLocations) { + vn_encode_array_size(enc, val->sampleLocationsCount); + for (uint32_t i = 0; i < val->sampleLocationsCount; i++) + vn_encode_VkSampleLocationEXT(enc, &val->pSampleLocations[i]); + } else { + vn_encode_array_size(enc, 0); + } +} + +static inline void +vn_encode_VkSampleLocationsInfoEXT(struct vn_cs_encoder *enc, const VkSampleLocationsInfoEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT }); + vn_encode_VkSampleLocationsInfoEXT_pnext(enc, val->pNext); + vn_encode_VkSampleLocationsInfoEXT_self(enc, val); +} + /* union VkClearColorValue */ static inline size_t