From 58182eb096e05d159eda2f5ae48cf50ac2fcde45 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 1 Mar 2022 18:30:36 +0000 Subject: [PATCH] venus: update to latest venus protocol Added the below extension support: - VK_EXT_line_rasterization - VK_EXT_provoking_vertex Signed-off-by: Yiwei Zhang Part-of: --- src/virtio/venus-protocol/vn_protocol_driver.h | 2 +- .../vn_protocol_driver_command_buffer.h | 88 +++ .../venus-protocol/vn_protocol_driver_defines.h | 3 + .../venus-protocol/vn_protocol_driver_device.h | 753 +++++++++++++++++++++ .../venus-protocol/vn_protocol_driver_info.h | 161 ++--- .../venus-protocol/vn_protocol_driver_pipeline.h | 136 ++++ .../venus-protocol/vn_protocol_driver_transport.h | 187 +++++ .../venus-protocol/vn_protocol_driver_types.h | 102 +++ 8 files changed, 1352 insertions(+), 80 deletions(-) diff --git a/src/virtio/venus-protocol/vn_protocol_driver.h b/src/virtio/venus-protocol/vn_protocol_driver.h index edd562d..3189111 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-e0866cb3. */ +/* This file is generated by venus-protocol git-8230786e. */ /* * 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 1bb1f25..6f37738 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_command_buffer.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_command_buffer.h @@ -6361,6 +6361,54 @@ static inline void vn_decode_vkCmdDrawIndirectByteCountEXT_reply(struct vn_cs_de /* skip vertexStride */ } +static inline size_t vn_sizeof_vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdSetLineStippleEXT_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_uint32_t(&lineStippleFactor); + cmd_size += vn_sizeof_uint16_t(&lineStipplePattern); + + return cmd_size; +} + +static inline void vn_encode_vkCmdSetLineStippleEXT(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdSetLineStippleEXT_EXT; + + vn_encode_VkCommandTypeEXT(enc, &cmd_type); + vn_encode_VkFlags(enc, &cmd_flags); + + vn_encode_VkCommandBuffer(enc, &commandBuffer); + vn_encode_uint32_t(enc, &lineStippleFactor); + vn_encode_uint16_t(enc, &lineStipplePattern); +} + +static inline size_t vn_sizeof_vkCmdSetLineStippleEXT_reply(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdSetLineStippleEXT_EXT; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); + + /* skip commandBuffer */ + /* skip lineStippleFactor */ + /* skip lineStipplePattern */ + + return cmd_size; +} + +static inline void vn_decode_vkCmdSetLineStippleEXT_reply(struct vn_cs_decoder *dec, VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) +{ + VkCommandTypeEXT command_type; + vn_decode_VkCommandTypeEXT(dec, &command_type); + assert(command_type == VK_COMMAND_TYPE_vkCmdSetLineStippleEXT_EXT); + + /* skip commandBuffer */ + /* skip lineStippleFactor */ + /* skip lineStipplePattern */ +} + static inline size_t vn_sizeof_vkCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) { const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkCmdSetCullMode_EXT; @@ -9164,6 +9212,27 @@ static inline void vn_submit_vkCmdDrawIndirectByteCountEXT(struct vn_instance *v } } +static inline void vn_submit_vkCmdSetLineStippleEXT(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern, struct vn_instance_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_vkCmdSetLineStippleEXT(commandBuffer, lineStippleFactor, lineStipplePattern); + 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_vkCmdSetLineStippleEXT_reply(commandBuffer, lineStippleFactor, lineStipplePattern) : 0; + + struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); + if (cmd_size) { + vn_encode_vkCmdSetLineStippleEXT(enc, cmd_flags, commandBuffer, lineStippleFactor, lineStipplePattern); + vn_instance_submit_command(vn_instance, submit); + if (cmd_data != local_cmd_data) + free(cmd_data); + } +} + static inline void vn_submit_vkCmdSetCullMode(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkCommandBuffer commandBuffer, VkCullModeFlags cullMode, struct vn_instance_submit_command *submit) { uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; @@ -10984,6 +11053,25 @@ static inline void vn_async_vkCmdDrawIndirectByteCountEXT(struct vn_instance *vn vn_submit_vkCmdDrawIndirectByteCountEXT(vn_instance, 0, commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride, &submit); } +static inline void vn_call_vkCmdSetLineStippleEXT(struct vn_instance *vn_instance, VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) +{ + VN_TRACE_FUNC(); + + struct vn_instance_submit_command submit; + vn_submit_vkCmdSetLineStippleEXT(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, commandBuffer, lineStippleFactor, lineStipplePattern, &submit); + struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); + if (dec) { + vn_decode_vkCmdSetLineStippleEXT_reply(dec, commandBuffer, lineStippleFactor, lineStipplePattern); + vn_instance_free_command_reply(vn_instance, &submit); + } +} + +static inline void vn_async_vkCmdSetLineStippleEXT(struct vn_instance *vn_instance, VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) +{ + struct vn_instance_submit_command submit; + vn_submit_vkCmdSetLineStippleEXT(vn_instance, 0, commandBuffer, lineStippleFactor, lineStipplePattern, &submit); +} + static inline void vn_call_vkCmdSetCullMode(struct vn_instance *vn_instance, VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) { 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 c567108..973eec5 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_defines.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_defines.h @@ -328,6 +328,9 @@ typedef enum VkCommandTypeEXT { VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT = 187, VK_COMMAND_TYPE_vkCmdSetPatchControlPointsEXT_EXT = 233, VK_COMMAND_TYPE_vkCmdSetLogicOpEXT_EXT = 234, + VK_COMMAND_TYPE_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_EXT = 235, + VK_COMMAND_TYPE_vkGetCalibratedTimestampsEXT_EXT = 236, + VK_COMMAND_TYPE_vkCmdSetLineStippleEXT_EXT = 237, VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT = 178, VK_COMMAND_TYPE_vkSeekReplyCommandStreamMESA_EXT = 179, VK_COMMAND_TYPE_vkExecuteCommandStreamsMESA_EXT = 180, diff --git a/src/virtio/venus-protocol/vn_protocol_driver_device.h b/src/virtio/venus-protocol/vn_protocol_driver_device.h index 80bef89..02e59fd 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_device.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_device.h @@ -5008,6 +5008,162 @@ vn_encode_VkPhysicalDeviceSubgroupSizeControlFeatures_partial(struct vn_cs_encod vn_encode_VkPhysicalDeviceSubgroupSizeControlFeatures_self_partial(enc, val); } +/* struct VkPhysicalDeviceLineRasterizationFeaturesEXT chain */ + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkBool32(&val->rectangularLines); + size += vn_sizeof_VkBool32(&val->bresenhamLines); + size += vn_sizeof_VkBool32(&val->smoothLines); + size += vn_sizeof_VkBool32(&val->stippledRectangularLines); + size += vn_sizeof_VkBool32(&val->stippledBresenhamLines); + size += vn_sizeof_VkBool32(&val->stippledSmoothLines); + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT(const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext(val->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(struct vn_cs_encoder *enc, const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkBool32(enc, &val->rectangularLines); + vn_encode_VkBool32(enc, &val->bresenhamLines); + vn_encode_VkBool32(enc, &val->smoothLines); + vn_encode_VkBool32(enc, &val->stippledRectangularLines); + vn_encode_VkBool32(enc, &val->stippledBresenhamLines); + vn_encode_VkBool32(enc, &val->stippledSmoothLines); +} + +static inline void +vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT(struct vn_cs_encoder *enc, const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT }); + vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext(enc, val->pNext); + vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(enc, val); +} + +static inline void +vn_decode_VkPhysicalDeviceLineRasterizationFeaturesEXT_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_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(struct vn_cs_decoder *dec, VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_VkBool32(dec, &val->rectangularLines); + vn_decode_VkBool32(dec, &val->bresenhamLines); + vn_decode_VkBool32(dec, &val->smoothLines); + vn_decode_VkBool32(dec, &val->stippledRectangularLines); + vn_decode_VkBool32(dec, &val->stippledBresenhamLines); + vn_decode_VkBool32(dec, &val->stippledSmoothLines); +} + +static inline void +vn_decode_VkPhysicalDeviceLineRasterizationFeaturesEXT(struct vn_cs_decoder *dec, VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT); + + assert(val->sType == stype); + vn_decode_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext(dec, val->pNext); + vn_decode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_self_partial(const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + /* skip val->rectangularLines */ + /* skip val->bresenhamLines */ + /* skip val->smoothLines */ + /* skip val->stippledRectangularLines */ + /* skip val->stippledBresenhamLines */ + /* skip val->stippledSmoothLines */ + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_partial(const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_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_VkPhysicalDeviceLineRasterizationFeaturesEXT_self_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->rectangularLines */ + /* skip val->bresenhamLines */ + /* skip val->smoothLines */ + /* skip val->stippledRectangularLines */ + /* skip val->stippledBresenhamLines */ + /* skip val->stippledSmoothLines */ +} + +static inline void +vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceLineRasterizationFeaturesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT }); + vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self_partial(enc, val); +} + /* struct VkPhysicalDevicePipelineCreationCacheControlFeatures chain */ static inline size_t @@ -7086,6 +7242,142 @@ vn_encode_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_partial(struct vn_cs_ vn_encode_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self_partial(enc, val); } +/* struct VkPhysicalDeviceProvokingVertexFeaturesEXT chain */ + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkBool32(&val->provokingVertexLast); + size += vn_sizeof_VkBool32(&val->transformFeedbackPreservesProvokingVertex); + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT(const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext(val->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(struct vn_cs_encoder *enc, const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkBool32(enc, &val->provokingVertexLast); + vn_encode_VkBool32(enc, &val->transformFeedbackPreservesProvokingVertex); +} + +static inline void +vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT(struct vn_cs_encoder *enc, const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT }); + vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext(enc, val->pNext); + vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(enc, val); +} + +static inline void +vn_decode_VkPhysicalDeviceProvokingVertexFeaturesEXT_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_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(struct vn_cs_decoder *dec, VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_VkBool32(dec, &val->provokingVertexLast); + vn_decode_VkBool32(dec, &val->transformFeedbackPreservesProvokingVertex); +} + +static inline void +vn_decode_VkPhysicalDeviceProvokingVertexFeaturesEXT(struct vn_cs_decoder *dec, VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT); + + assert(val->sType == stype); + vn_decode_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext(dec, val->pNext); + vn_decode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_self_partial(const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + /* skip val->provokingVertexLast */ + /* skip val->transformFeedbackPreservesProvokingVertex */ + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_partial(const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_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_VkPhysicalDeviceProvokingVertexFeaturesEXT_self_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->provokingVertexLast */ + /* skip val->transformFeedbackPreservesProvokingVertex */ +} + +static inline void +vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceProvokingVertexFeaturesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT }); + vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self_partial(enc, val); +} + /* struct VkPhysicalDeviceShaderIntegerDotProductFeatures chain */ static inline size_t @@ -7520,6 +7812,12 @@ vn_sizeof_VkPhysicalDeviceFeatures2_pnext(const void *val) size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceSubgroupSizeControlFeatures_self((const VkPhysicalDeviceSubgroupSizeControlFeatures *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_self((const VkPhysicalDeviceLineRasterizationFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -7598,6 +7896,12 @@ vn_sizeof_VkPhysicalDeviceFeatures2_pnext(const void *val) size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self((const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_self((const VkPhysicalDeviceProvokingVertexFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -7810,6 +8114,12 @@ vn_encode_VkPhysicalDeviceFeatures2_pnext(struct vn_cs_encoder *enc, const void vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); vn_encode_VkPhysicalDeviceSubgroupSizeControlFeatures_self(enc, (const VkPhysicalDeviceSubgroupSizeControlFeatures *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(enc, (const VkPhysicalDeviceLineRasterizationFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -7888,6 +8198,12 @@ vn_encode_VkPhysicalDeviceFeatures2_pnext(struct vn_cs_encoder *enc, const void vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); vn_encode_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self(enc, (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(enc, (const VkPhysicalDeviceProvokingVertexFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -8051,6 +8367,10 @@ vn_decode_VkPhysicalDeviceFeatures2_pnext(struct vn_cs_decoder *dec, const void vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceSubgroupSizeControlFeatures_self(dec, (VkPhysicalDeviceSubgroupSizeControlFeatures *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: + vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); + vn_decode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(dec, (VkPhysicalDeviceLineRasterizationFeaturesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDevicePipelineCreationCacheControlFeatures_self(dec, (VkPhysicalDevicePipelineCreationCacheControlFeatures *)pnext); @@ -8103,6 +8423,10 @@ vn_decode_VkPhysicalDeviceFeatures2_pnext(struct vn_cs_decoder *dec, const void vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self(dec, (VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: + vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); + vn_decode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(dec, (VkPhysicalDeviceProvokingVertexFeaturesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: vn_decode_VkPhysicalDeviceFeatures2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceShaderIntegerDotProductFeatures_self(dec, (VkPhysicalDeviceShaderIntegerDotProductFeatures *)pnext); @@ -8306,6 +8630,12 @@ vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(const void *val) size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceSubgroupSizeControlFeatures_self_partial((const VkPhysicalDeviceSubgroupSizeControlFeatures *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_self_partial((const VkPhysicalDeviceLineRasterizationFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -8384,6 +8714,12 @@ vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(const void *val) size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self_partial((const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceFeatures2_pnext_partial(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_self_partial((const VkPhysicalDeviceProvokingVertexFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -8596,6 +8932,12 @@ vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(struct vn_cs_encoder *enc, con vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(enc, pnext->pNext); vn_encode_VkPhysicalDeviceSubgroupSizeControlFeatures_self_partial(enc, (const VkPhysicalDeviceSubgroupSizeControlFeatures *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self_partial(enc, (const VkPhysicalDeviceLineRasterizationFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -8674,6 +9016,12 @@ vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(struct vn_cs_encoder *enc, con vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(enc, pnext->pNext); vn_encode_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self_partial(enc, (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceFeatures2_pnext_partial(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self_partial(enc, (const VkPhysicalDeviceProvokingVertexFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -8969,6 +9317,12 @@ vn_sizeof_VkDeviceCreateInfo_pnext(const void *val) size += vn_sizeof_VkDeviceCreateInfo_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceSubgroupSizeControlFeatures_self((const VkPhysicalDeviceSubgroupSizeControlFeatures *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkDeviceCreateInfo_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationFeaturesEXT_self((const VkPhysicalDeviceLineRasterizationFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -9047,6 +9401,12 @@ vn_sizeof_VkDeviceCreateInfo_pnext(const void *val) size += vn_sizeof_VkDeviceCreateInfo_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self((const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkDeviceCreateInfo_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexFeaturesEXT_self((const VkPhysicalDeviceProvokingVertexFeaturesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -9310,6 +9670,12 @@ vn_encode_VkDeviceCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val) vn_encode_VkDeviceCreateInfo_pnext(enc, pnext->pNext); vn_encode_VkPhysicalDeviceSubgroupSizeControlFeatures_self(enc, (const VkPhysicalDeviceSubgroupSizeControlFeatures *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkDeviceCreateInfo_pnext(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceLineRasterizationFeaturesEXT_self(enc, (const VkPhysicalDeviceLineRasterizationFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -9388,6 +9754,12 @@ vn_encode_VkDeviceCreateInfo_pnext(struct vn_cs_encoder *enc, const void *val) vn_encode_VkDeviceCreateInfo_pnext(enc, pnext->pNext); vn_encode_VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT_self(enc, (const VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkDeviceCreateInfo_pnext(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceProvokingVertexFeaturesEXT_self(enc, (const VkPhysicalDeviceProvokingVertexFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -11648,6 +12020,114 @@ vn_encode_VkPhysicalDeviceSubgroupSizeControlProperties_partial(struct vn_cs_enc vn_encode_VkPhysicalDeviceSubgroupSizeControlProperties_self_partial(enc, val); } +/* struct VkPhysicalDeviceLineRasterizationPropertiesEXT chain */ + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_self(const VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_uint32_t(&val->lineSubPixelPrecisionBits); + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT(const VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_pnext(val->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_self(val); + + return size; +} + +static inline void +vn_decode_VkPhysicalDeviceLineRasterizationPropertiesEXT_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_VkPhysicalDeviceLineRasterizationPropertiesEXT_self(struct vn_cs_decoder *dec, VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_uint32_t(dec, &val->lineSubPixelPrecisionBits); +} + +static inline void +vn_decode_VkPhysicalDeviceLineRasterizationPropertiesEXT(struct vn_cs_decoder *dec, VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT); + + assert(val->sType == stype); + vn_decode_VkPhysicalDeviceLineRasterizationPropertiesEXT_pnext(dec, val->pNext); + vn_decode_VkPhysicalDeviceLineRasterizationPropertiesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_self_partial(const VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + /* skip val->lineSubPixelPrecisionBits */ + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_partial(const VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceLineRasterizationPropertiesEXT_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_VkPhysicalDeviceLineRasterizationPropertiesEXT_self_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->lineSubPixelPrecisionBits */ +} + +static inline void +vn_encode_VkPhysicalDeviceLineRasterizationPropertiesEXT_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceLineRasterizationPropertiesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT }); + vn_encode_VkPhysicalDeviceLineRasterizationPropertiesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkPhysicalDeviceLineRasterizationPropertiesEXT_self_partial(enc, val); +} + /* struct VkPhysicalDeviceVulkan11Properties chain */ static inline size_t @@ -12536,6 +13016,118 @@ vn_encode_VkPhysicalDeviceCustomBorderColorPropertiesEXT_partial(struct vn_cs_en vn_encode_VkPhysicalDeviceCustomBorderColorPropertiesEXT_self_partial(enc, val); } +/* struct VkPhysicalDeviceProvokingVertexPropertiesEXT chain */ + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_self(const VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkBool32(&val->provokingVertexModePerPipeline); + size += vn_sizeof_VkBool32(&val->transformFeedbackPreservesTriangleFanProvokingVertex); + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT(const VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_pnext(val->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_self(val); + + return size; +} + +static inline void +vn_decode_VkPhysicalDeviceProvokingVertexPropertiesEXT_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_VkPhysicalDeviceProvokingVertexPropertiesEXT_self(struct vn_cs_decoder *dec, VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_VkBool32(dec, &val->provokingVertexModePerPipeline); + vn_decode_VkBool32(dec, &val->transformFeedbackPreservesTriangleFanProvokingVertex); +} + +static inline void +vn_decode_VkPhysicalDeviceProvokingVertexPropertiesEXT(struct vn_cs_decoder *dec, VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT); + + assert(val->sType == stype); + vn_decode_VkPhysicalDeviceProvokingVertexPropertiesEXT_pnext(dec, val->pNext); + vn_decode_VkPhysicalDeviceProvokingVertexPropertiesEXT_self(dec, val); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_pnext_partial(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_self_partial(const VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + /* skip val->provokingVertexModePerPipeline */ + /* skip val->transformFeedbackPreservesTriangleFanProvokingVertex */ + return size; +} + +static inline size_t +vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_partial(const VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_pnext_partial(val->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_self_partial(val); + + return size; +} + +static inline void +vn_encode_VkPhysicalDeviceProvokingVertexPropertiesEXT_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_VkPhysicalDeviceProvokingVertexPropertiesEXT_self_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->provokingVertexModePerPipeline */ + /* skip val->transformFeedbackPreservesTriangleFanProvokingVertex */ +} + +static inline void +vn_encode_VkPhysicalDeviceProvokingVertexPropertiesEXT_partial(struct vn_cs_encoder *enc, const VkPhysicalDeviceProvokingVertexPropertiesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT }); + vn_encode_VkPhysicalDeviceProvokingVertexPropertiesEXT_pnext_partial(enc, val->pNext); + vn_encode_VkPhysicalDeviceProvokingVertexPropertiesEXT_self_partial(enc, val); +} + /* struct VkPhysicalDeviceShaderIntegerDotProductProperties chain */ static inline size_t @@ -12872,6 +13464,12 @@ vn_sizeof_VkPhysicalDeviceProperties2_pnext(const void *val) size += vn_sizeof_VkPhysicalDeviceProperties2_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceSubgroupSizeControlProperties_self((const VkPhysicalDeviceSubgroupSizeControlProperties *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_self((const VkPhysicalDeviceLineRasterizationPropertiesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -12896,6 +13494,12 @@ vn_sizeof_VkPhysicalDeviceProperties2_pnext(const void *val) size += vn_sizeof_VkPhysicalDeviceProperties2_pnext(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceCustomBorderColorPropertiesEXT_self((const VkPhysicalDeviceCustomBorderColorPropertiesEXT *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_self((const VkPhysicalDeviceProvokingVertexPropertiesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -13018,6 +13622,10 @@ vn_decode_VkPhysicalDeviceProperties2_pnext(struct vn_cs_decoder *dec, const voi vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceSubgroupSizeControlProperties_self(dec, (VkPhysicalDeviceSubgroupSizeControlProperties *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: + vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); + vn_decode_VkPhysicalDeviceLineRasterizationPropertiesEXT_self(dec, (VkPhysicalDeviceLineRasterizationPropertiesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceVulkan11Properties_self(dec, (VkPhysicalDeviceVulkan11Properties *)pnext); @@ -13034,6 +13642,10 @@ vn_decode_VkPhysicalDeviceProperties2_pnext(struct vn_cs_decoder *dec, const voi vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceCustomBorderColorPropertiesEXT_self(dec, (VkPhysicalDeviceCustomBorderColorPropertiesEXT *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: + vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); + vn_decode_VkPhysicalDeviceProvokingVertexPropertiesEXT_self(dec, (VkPhysicalDeviceProvokingVertexPropertiesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: vn_decode_VkPhysicalDeviceProperties2_pnext(dec, pnext->pNext); vn_decode_VkPhysicalDeviceShaderIntegerDotProductProperties_self(dec, (VkPhysicalDeviceShaderIntegerDotProductProperties *)pnext); @@ -13173,6 +13785,12 @@ vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(const void *val) size += vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceSubgroupSizeControlProperties_self_partial((const VkPhysicalDeviceSubgroupSizeControlProperties *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceLineRasterizationPropertiesEXT_self_partial((const VkPhysicalDeviceLineRasterizationPropertiesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -13197,6 +13815,12 @@ vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(const void *val) size += vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(pnext->pNext); size += vn_sizeof_VkPhysicalDeviceCustomBorderColorPropertiesEXT_self_partial((const VkPhysicalDeviceCustomBorderColorPropertiesEXT *)pnext); return size; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPhysicalDeviceProperties2_pnext_partial(pnext->pNext); + size += vn_sizeof_VkPhysicalDeviceProvokingVertexPropertiesEXT_self_partial((const VkPhysicalDeviceProvokingVertexPropertiesEXT *)pnext); + return size; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: size += vn_sizeof_simple_pointer(pnext); size += vn_sizeof_VkStructureType(&pnext->sType); @@ -13343,6 +13967,12 @@ vn_encode_VkPhysicalDeviceProperties2_pnext_partial(struct vn_cs_encoder *enc, c vn_encode_VkPhysicalDeviceProperties2_pnext_partial(enc, pnext->pNext); vn_encode_VkPhysicalDeviceSubgroupSizeControlProperties_self_partial(enc, (const VkPhysicalDeviceSubgroupSizeControlProperties *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceProperties2_pnext_partial(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceLineRasterizationPropertiesEXT_self_partial(enc, (const VkPhysicalDeviceLineRasterizationPropertiesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -13367,6 +13997,12 @@ vn_encode_VkPhysicalDeviceProperties2_pnext_partial(struct vn_cs_encoder *enc, c vn_encode_VkPhysicalDeviceProperties2_pnext_partial(enc, pnext->pNext); vn_encode_VkPhysicalDeviceCustomBorderColorPropertiesEXT_self_partial(enc, (const VkPhysicalDeviceCustomBorderColorPropertiesEXT *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceProperties2_pnext_partial(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceProvokingVertexPropertiesEXT_self_partial(enc, (const VkPhysicalDeviceProvokingVertexPropertiesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -17864,6 +18500,80 @@ static inline void vn_decode_vkGetDeviceQueue2_reply(struct vn_cs_decoder *dec, } } +static inline size_t vn_sizeof_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_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_simple_pointer(pTimeDomainCount); + if (pTimeDomainCount) + cmd_size += vn_sizeof_uint32_t(pTimeDomainCount); + cmd_size += vn_sizeof_simple_pointer(pTimeDomains); /* out */ + + return cmd_size; +} + +static inline void vn_encode_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_EXT; + + vn_encode_VkCommandTypeEXT(enc, &cmd_type); + vn_encode_VkFlags(enc, &cmd_flags); + + vn_encode_VkPhysicalDevice(enc, &physicalDevice); + if (vn_encode_simple_pointer(enc, pTimeDomainCount)) + vn_encode_uint32_t(enc, pTimeDomainCount); + vn_encode_array_size(enc, pTimeDomains ? (pTimeDomainCount ? *pTimeDomainCount : 0) : 0); /* out */ +} + +static inline size_t vn_sizeof_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_reply(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_EXT; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); + + VkResult ret; + cmd_size += vn_sizeof_VkResult(&ret); + /* skip physicalDevice */ + cmd_size += vn_sizeof_simple_pointer(pTimeDomainCount); + if (pTimeDomainCount) + cmd_size += vn_sizeof_uint32_t(pTimeDomainCount); + if (pTimeDomains) { + cmd_size += vn_sizeof_array_size((pTimeDomainCount ? *pTimeDomainCount : 0)); + cmd_size += vn_sizeof_VkTimeDomainEXT_array(pTimeDomains, (pTimeDomainCount ? *pTimeDomainCount : 0)); + } else { + cmd_size += vn_sizeof_array_size(0); + } + + return cmd_size; +} + +static inline VkResult vn_decode_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_reply(struct vn_cs_decoder *dec, VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) +{ + VkCommandTypeEXT command_type; + vn_decode_VkCommandTypeEXT(dec, &command_type); + assert(command_type == VK_COMMAND_TYPE_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_EXT); + + VkResult ret; + vn_decode_VkResult(dec, &ret); + /* skip physicalDevice */ + if (vn_decode_simple_pointer(dec)) { + vn_decode_uint32_t(dec, pTimeDomainCount); + } else { + pTimeDomainCount = NULL; + } + if (vn_peek_array_size(dec)) { + const size_t array_size = vn_decode_array_size(dec, (pTimeDomainCount ? *pTimeDomainCount : 0)); + vn_decode_VkTimeDomainEXT_array(dec, pTimeDomains, array_size); + } else { + vn_decode_array_size_unchecked(dec); + pTimeDomains = NULL; + } + + return ret; +} + static inline size_t vn_sizeof_vkGetPhysicalDeviceToolProperties(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) { const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetPhysicalDeviceToolProperties_EXT; @@ -18519,6 +19229,27 @@ static inline void vn_submit_vkGetDeviceQueue2(struct vn_instance *vn_instance, } } +static inline void vn_submit_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains, struct vn_instance_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_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(physicalDevice, pTimeDomainCount, pTimeDomains); + 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_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_reply(physicalDevice, pTimeDomainCount, pTimeDomains) : 0; + + struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); + if (cmd_size) { + vn_encode_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(enc, cmd_flags, physicalDevice, pTimeDomainCount, pTimeDomains); + vn_instance_submit_command(vn_instance, submit); + if (cmd_data != local_cmd_data) + free(cmd_data); + } +} + static inline void vn_submit_vkGetPhysicalDeviceToolProperties(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties, struct vn_instance_submit_command *submit) { uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; @@ -19077,6 +19808,28 @@ static inline void vn_async_vkGetDeviceQueue2(struct vn_instance *vn_instance, V vn_submit_vkGetDeviceQueue2(vn_instance, 0, device, pQueueInfo, pQueue, &submit); } +static inline VkResult vn_call_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(struct vn_instance *vn_instance, VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) +{ + VN_TRACE_FUNC(); + + struct vn_instance_submit_command submit; + vn_submit_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, physicalDevice, pTimeDomainCount, pTimeDomains, &submit); + struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); + if (dec) { + const VkResult ret = vn_decode_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_reply(dec, physicalDevice, pTimeDomainCount, pTimeDomains); + vn_instance_free_command_reply(vn_instance, &submit); + return ret; + } else { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } +} + +static inline void vn_async_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(struct vn_instance *vn_instance, VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) +{ + struct vn_instance_submit_command submit; + vn_submit_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(vn_instance, 0, physicalDevice, pTimeDomainCount, pTimeDomains, &submit); +} + static inline VkResult vn_call_vkGetPhysicalDeviceToolProperties(struct vn_instance *vn_instance, VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties) { 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 2eb7f87..02862eb 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_info.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_info.h @@ -38,88 +38,91 @@ vn_info_extension_compare(const void *name, const void *ext) static inline const struct vn_info_extension * vn_info_extension_get(const char *name) { - static const struct vn_info_extension vn_info_extensions[78] = { + static const struct vn_info_extension vn_info_extensions[81] = { { 0, "VK_EXT_4444_formats", 1 }, - { 1, "VK_EXT_command_serialization", 0 }, - { 2, "VK_EXT_custom_border_color", 12 }, - { 3, "VK_EXT_descriptor_indexing", 2 }, - { 4, "VK_EXT_extended_dynamic_state", 1 }, - { 5, "VK_EXT_extended_dynamic_state2", 1 }, - { 6, "VK_EXT_external_memory_dma_buf", 1 }, - { 7, "VK_EXT_host_query_reset", 1 }, - { 8, "VK_EXT_image_drm_format_modifier", 2 }, - { 9, "VK_EXT_image_robustness", 1 }, - { 10, "VK_EXT_inline_uniform_block", 1 }, - { 11, "VK_EXT_pipeline_creation_cache_control", 3 }, - { 12, "VK_EXT_pipeline_creation_feedback", 1 }, - { 13, "VK_EXT_private_data", 1 }, - { 14, "VK_EXT_queue_family_foreign", 1 }, - { 15, "VK_EXT_sampler_filter_minmax", 2 }, - { 16, "VK_EXT_scalar_block_layout", 1 }, - { 17, "VK_EXT_separate_stencil_usage", 1 }, - { 18, "VK_EXT_shader_demote_to_helper_invocation", 1 }, - { 19, "VK_EXT_shader_viewport_index_layer", 1 }, - { 20, "VK_EXT_subgroup_size_control", 2 }, - { 21, "VK_EXT_texel_buffer_alignment", 1 }, - { 22, "VK_EXT_texture_compression_astc_hdr", 1 }, - { 23, "VK_EXT_tooling_info", 1 }, - { 24, "VK_EXT_transform_feedback", 1 }, - { 25, "VK_EXT_ycbcr_2plane_444_formats", 1 }, - { 26, "VK_KHR_16bit_storage", 1 }, - { 27, "VK_KHR_8bit_storage", 1 }, - { 28, "VK_KHR_bind_memory2", 1 }, - { 29, "VK_KHR_buffer_device_address", 1 }, - { 30, "VK_KHR_copy_commands2", 1 }, - { 31, "VK_KHR_create_renderpass2", 1 }, - { 32, "VK_KHR_dedicated_allocation", 3 }, - { 33, "VK_KHR_depth_stencil_resolve", 1 }, - { 34, "VK_KHR_descriptor_update_template", 1 }, - { 35, "VK_KHR_device_group", 4 }, - { 36, "VK_KHR_device_group_creation", 1 }, - { 37, "VK_KHR_draw_indirect_count", 1 }, - { 38, "VK_KHR_driver_properties", 1 }, - { 39, "VK_KHR_dynamic_rendering", 1 }, - { 40, "VK_KHR_external_fence", 1 }, - { 41, "VK_KHR_external_fence_capabilities", 1 }, - { 42, "VK_KHR_external_memory", 1 }, - { 43, "VK_KHR_external_memory_capabilities", 1 }, - { 44, "VK_KHR_external_memory_fd", 1 }, - { 45, "VK_KHR_external_semaphore", 1 }, - { 46, "VK_KHR_external_semaphore_capabilities", 1 }, - { 47, "VK_KHR_format_feature_flags2", 1 }, - { 48, "VK_KHR_get_memory_requirements2", 1 }, - { 49, "VK_KHR_get_physical_device_properties2", 2 }, - { 50, "VK_KHR_image_format_list", 1 }, - { 51, "VK_KHR_imageless_framebuffer", 1 }, - { 52, "VK_KHR_maintenance1", 2 }, - { 53, "VK_KHR_maintenance2", 1 }, - { 54, "VK_KHR_maintenance3", 1 }, - { 55, "VK_KHR_maintenance4", 2 }, - { 56, "VK_KHR_multiview", 1 }, - { 57, "VK_KHR_relaxed_block_layout", 1 }, - { 58, "VK_KHR_sampler_mirror_clamp_to_edge", 3 }, - { 59, "VK_KHR_sampler_ycbcr_conversion", 14 }, - { 60, "VK_KHR_separate_depth_stencil_layouts", 1 }, - { 61, "VK_KHR_shader_atomic_int64", 1 }, - { 62, "VK_KHR_shader_draw_parameters", 1 }, - { 63, "VK_KHR_shader_float16_int8", 1 }, - { 64, "VK_KHR_shader_float_controls", 4 }, - { 65, "VK_KHR_shader_integer_dot_product", 1 }, - { 66, "VK_KHR_shader_non_semantic_info", 1 }, - { 67, "VK_KHR_shader_subgroup_extended_types", 1 }, - { 68, "VK_KHR_shader_terminate_invocation", 1 }, - { 69, "VK_KHR_spirv_1_4", 1 }, - { 70, "VK_KHR_storage_buffer_storage_class", 1 }, - { 71, "VK_KHR_synchronization2", 1 }, - { 72, "VK_KHR_timeline_semaphore", 2 }, - { 73, "VK_KHR_uniform_buffer_standard_layout", 1 }, - { 74, "VK_KHR_variable_pointers", 1 }, - { 75, "VK_KHR_vulkan_memory_model", 3 }, - { 76, "VK_KHR_zero_initialize_workgroup_memory", 1 }, - { 77, "VK_MESA_venus_protocol", 100000 }, + { 1, "VK_EXT_calibrated_timestamps", 2 }, + { 2, "VK_EXT_command_serialization", 0 }, + { 3, "VK_EXT_custom_border_color", 12 }, + { 4, "VK_EXT_descriptor_indexing", 2 }, + { 5, "VK_EXT_extended_dynamic_state", 1 }, + { 6, "VK_EXT_extended_dynamic_state2", 1 }, + { 7, "VK_EXT_external_memory_dma_buf", 1 }, + { 8, "VK_EXT_host_query_reset", 1 }, + { 9, "VK_EXT_image_drm_format_modifier", 2 }, + { 10, "VK_EXT_image_robustness", 1 }, + { 11, "VK_EXT_inline_uniform_block", 1 }, + { 12, "VK_EXT_line_rasterization", 1 }, + { 13, "VK_EXT_pipeline_creation_cache_control", 3 }, + { 14, "VK_EXT_pipeline_creation_feedback", 1 }, + { 15, "VK_EXT_private_data", 1 }, + { 16, "VK_EXT_provoking_vertex", 1 }, + { 17, "VK_EXT_queue_family_foreign", 1 }, + { 18, "VK_EXT_sampler_filter_minmax", 2 }, + { 19, "VK_EXT_scalar_block_layout", 1 }, + { 20, "VK_EXT_separate_stencil_usage", 1 }, + { 21, "VK_EXT_shader_demote_to_helper_invocation", 1 }, + { 22, "VK_EXT_shader_viewport_index_layer", 1 }, + { 23, "VK_EXT_subgroup_size_control", 2 }, + { 24, "VK_EXT_texel_buffer_alignment", 1 }, + { 25, "VK_EXT_texture_compression_astc_hdr", 1 }, + { 26, "VK_EXT_tooling_info", 1 }, + { 27, "VK_EXT_transform_feedback", 1 }, + { 28, "VK_EXT_ycbcr_2plane_444_formats", 1 }, + { 29, "VK_KHR_16bit_storage", 1 }, + { 30, "VK_KHR_8bit_storage", 1 }, + { 31, "VK_KHR_bind_memory2", 1 }, + { 32, "VK_KHR_buffer_device_address", 1 }, + { 33, "VK_KHR_copy_commands2", 1 }, + { 34, "VK_KHR_create_renderpass2", 1 }, + { 35, "VK_KHR_dedicated_allocation", 3 }, + { 36, "VK_KHR_depth_stencil_resolve", 1 }, + { 37, "VK_KHR_descriptor_update_template", 1 }, + { 38, "VK_KHR_device_group", 4 }, + { 39, "VK_KHR_device_group_creation", 1 }, + { 40, "VK_KHR_draw_indirect_count", 1 }, + { 41, "VK_KHR_driver_properties", 1 }, + { 42, "VK_KHR_dynamic_rendering", 1 }, + { 43, "VK_KHR_external_fence", 1 }, + { 44, "VK_KHR_external_fence_capabilities", 1 }, + { 45, "VK_KHR_external_memory", 1 }, + { 46, "VK_KHR_external_memory_capabilities", 1 }, + { 47, "VK_KHR_external_memory_fd", 1 }, + { 48, "VK_KHR_external_semaphore", 1 }, + { 49, "VK_KHR_external_semaphore_capabilities", 1 }, + { 50, "VK_KHR_format_feature_flags2", 1 }, + { 51, "VK_KHR_get_memory_requirements2", 1 }, + { 52, "VK_KHR_get_physical_device_properties2", 2 }, + { 53, "VK_KHR_image_format_list", 1 }, + { 54, "VK_KHR_imageless_framebuffer", 1 }, + { 55, "VK_KHR_maintenance1", 2 }, + { 56, "VK_KHR_maintenance2", 1 }, + { 57, "VK_KHR_maintenance3", 1 }, + { 58, "VK_KHR_maintenance4", 2 }, + { 59, "VK_KHR_multiview", 1 }, + { 60, "VK_KHR_relaxed_block_layout", 1 }, + { 61, "VK_KHR_sampler_mirror_clamp_to_edge", 3 }, + { 62, "VK_KHR_sampler_ycbcr_conversion", 14 }, + { 63, "VK_KHR_separate_depth_stencil_layouts", 1 }, + { 64, "VK_KHR_shader_atomic_int64", 1 }, + { 65, "VK_KHR_shader_draw_parameters", 1 }, + { 66, "VK_KHR_shader_float16_int8", 1 }, + { 67, "VK_KHR_shader_float_controls", 4 }, + { 68, "VK_KHR_shader_integer_dot_product", 1 }, + { 69, "VK_KHR_shader_non_semantic_info", 1 }, + { 70, "VK_KHR_shader_subgroup_extended_types", 1 }, + { 71, "VK_KHR_shader_terminate_invocation", 1 }, + { 72, "VK_KHR_spirv_1_4", 1 }, + { 73, "VK_KHR_storage_buffer_storage_class", 1 }, + { 74, "VK_KHR_synchronization2", 1 }, + { 75, "VK_KHR_timeline_semaphore", 2 }, + { 76, "VK_KHR_uniform_buffer_standard_layout", 1 }, + { 77, "VK_KHR_variable_pointers", 1 }, + { 78, "VK_KHR_vulkan_memory_model", 3 }, + { 79, "VK_KHR_zero_initialize_workgroup_memory", 1 }, + { 80, "VK_MESA_venus_protocol", 100000 }, }; - return bsearch(name, vn_info_extensions, 78, + return bsearch(name, vn_info_extensions, 81, sizeof(*vn_info_extensions), vn_info_extension_compare); } diff --git a/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h b/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h index 3e6115b..d609e58 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_pipeline.h @@ -702,6 +702,118 @@ vn_encode_VkPipelineRasterizationStateStreamCreateInfoEXT(struct vn_cs_encoder * vn_encode_VkPipelineRasterizationStateStreamCreateInfoEXT_self(enc, val); } +/* struct VkPipelineRasterizationLineStateCreateInfoEXT chain */ + +static inline size_t +vn_sizeof_VkPipelineRasterizationLineStateCreateInfoEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPipelineRasterizationLineStateCreateInfoEXT_self(const VkPipelineRasterizationLineStateCreateInfoEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkLineRasterizationModeEXT(&val->lineRasterizationMode); + size += vn_sizeof_VkBool32(&val->stippledLineEnable); + size += vn_sizeof_uint32_t(&val->lineStippleFactor); + size += vn_sizeof_uint16_t(&val->lineStipplePattern); + return size; +} + +static inline size_t +vn_sizeof_VkPipelineRasterizationLineStateCreateInfoEXT(const VkPipelineRasterizationLineStateCreateInfoEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPipelineRasterizationLineStateCreateInfoEXT_pnext(val->pNext); + size += vn_sizeof_VkPipelineRasterizationLineStateCreateInfoEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkPipelineRasterizationLineStateCreateInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPipelineRasterizationLineStateCreateInfoEXT_self(struct vn_cs_encoder *enc, const VkPipelineRasterizationLineStateCreateInfoEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkLineRasterizationModeEXT(enc, &val->lineRasterizationMode); + vn_encode_VkBool32(enc, &val->stippledLineEnable); + vn_encode_uint32_t(enc, &val->lineStippleFactor); + vn_encode_uint16_t(enc, &val->lineStipplePattern); +} + +static inline void +vn_encode_VkPipelineRasterizationLineStateCreateInfoEXT(struct vn_cs_encoder *enc, const VkPipelineRasterizationLineStateCreateInfoEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT }); + vn_encode_VkPipelineRasterizationLineStateCreateInfoEXT_pnext(enc, val->pNext); + vn_encode_VkPipelineRasterizationLineStateCreateInfoEXT_self(enc, val); +} + +/* struct VkPipelineRasterizationProvokingVertexStateCreateInfoEXT chain */ + +static inline size_t +vn_sizeof_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_self(const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkProvokingVertexModeEXT(&val->provokingVertexMode); + return size; +} + +static inline size_t +vn_sizeof_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_pnext(val->pNext); + size += vn_sizeof_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_self(struct vn_cs_encoder *enc, const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkProvokingVertexModeEXT(enc, &val->provokingVertexMode); +} + +static inline void +vn_encode_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT(struct vn_cs_encoder *enc, const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT }); + vn_encode_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_pnext(enc, val->pNext); + vn_encode_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_self(enc, val); +} + /* struct VkPipelineRasterizationStateCreateInfo chain */ static inline size_t @@ -718,6 +830,18 @@ vn_sizeof_VkPipelineRasterizationStateCreateInfo_pnext(const void *val) size += vn_sizeof_VkPipelineRasterizationStateCreateInfo_pnext(pnext->pNext); size += vn_sizeof_VkPipelineRasterizationStateStreamCreateInfoEXT_self((const VkPipelineRasterizationStateStreamCreateInfoEXT *)pnext); return size; + case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPipelineRasterizationStateCreateInfo_pnext(pnext->pNext); + size += vn_sizeof_VkPipelineRasterizationLineStateCreateInfoEXT_self((const VkPipelineRasterizationLineStateCreateInfoEXT *)pnext); + return size; + case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: + size += vn_sizeof_simple_pointer(pnext); + size += vn_sizeof_VkStructureType(&pnext->sType); + size += vn_sizeof_VkPipelineRasterizationStateCreateInfo_pnext(pnext->pNext); + size += vn_sizeof_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_self((const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *)pnext); + return size; default: /* ignore unknown/unsupported struct */ break; @@ -772,6 +896,18 @@ vn_encode_VkPipelineRasterizationStateCreateInfo_pnext(struct vn_cs_encoder *enc vn_encode_VkPipelineRasterizationStateCreateInfo_pnext(enc, pnext->pNext); vn_encode_VkPipelineRasterizationStateStreamCreateInfoEXT_self(enc, (const VkPipelineRasterizationStateStreamCreateInfoEXT *)pnext); return; + case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPipelineRasterizationStateCreateInfo_pnext(enc, pnext->pNext); + vn_encode_VkPipelineRasterizationLineStateCreateInfoEXT_self(enc, (const VkPipelineRasterizationLineStateCreateInfoEXT *)pnext); + return; + case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPipelineRasterizationStateCreateInfo_pnext(enc, pnext->pNext); + vn_encode_VkPipelineRasterizationProvokingVertexStateCreateInfoEXT_self(enc, (const VkPipelineRasterizationProvokingVertexStateCreateInfoEXT *)pnext); + return; default: /* ignore unknown/unsupported struct */ break; diff --git a/src/virtio/venus-protocol/vn_protocol_driver_transport.h b/src/virtio/venus-protocol/vn_protocol_driver_transport.h index 9794f77..2dd6782 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_transport.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_transport.h @@ -18,6 +18,59 @@ * vkGetMemoryFdPropertiesKHR */ +/* struct VkCalibratedTimestampInfoEXT chain */ + +static inline size_t +vn_sizeof_VkCalibratedTimestampInfoEXT_pnext(const void *val) +{ + /* no known/supported struct */ + return vn_sizeof_simple_pointer(NULL); +} + +static inline size_t +vn_sizeof_VkCalibratedTimestampInfoEXT_self(const VkCalibratedTimestampInfoEXT *val) +{ + size_t size = 0; + /* skip val->{sType,pNext} */ + size += vn_sizeof_VkTimeDomainEXT(&val->timeDomain); + return size; +} + +static inline size_t +vn_sizeof_VkCalibratedTimestampInfoEXT(const VkCalibratedTimestampInfoEXT *val) +{ + size_t size = 0; + + size += vn_sizeof_VkStructureType(&val->sType); + size += vn_sizeof_VkCalibratedTimestampInfoEXT_pnext(val->pNext); + size += vn_sizeof_VkCalibratedTimestampInfoEXT_self(val); + + return size; +} + +static inline void +vn_encode_VkCalibratedTimestampInfoEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkCalibratedTimestampInfoEXT_self(struct vn_cs_encoder *enc, const VkCalibratedTimestampInfoEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkTimeDomainEXT(enc, &val->timeDomain); +} + +static inline void +vn_encode_VkCalibratedTimestampInfoEXT(struct vn_cs_encoder *enc, const VkCalibratedTimestampInfoEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT }); + vn_encode_VkCalibratedTimestampInfoEXT_pnext(enc, val->pNext); + vn_encode_VkCalibratedTimestampInfoEXT_self(enc, val); +} + /* struct VkCommandStreamDescriptionMESA */ static inline size_t @@ -416,6 +469,97 @@ vn_encode_VkMemoryResourcePropertiesMESA_partial(struct vn_cs_encoder *enc, cons vn_encode_VkMemoryResourcePropertiesMESA_self_partial(enc, val); } +static inline size_t vn_sizeof_vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetCalibratedTimestampsEXT_EXT; + const VkFlags cmd_flags = 0; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type) + vn_sizeof_VkFlags(&cmd_flags); + + cmd_size += vn_sizeof_VkDevice(&device); + cmd_size += vn_sizeof_uint32_t(×tampCount); + if (pTimestampInfos) { + cmd_size += vn_sizeof_array_size(timestampCount); + for (uint32_t i = 0; i < timestampCount; i++) + cmd_size += vn_sizeof_VkCalibratedTimestampInfoEXT(&pTimestampInfos[i]); + } else { + cmd_size += vn_sizeof_array_size(0); + } + cmd_size += vn_sizeof_simple_pointer(pTimestamps); /* out */ + cmd_size += vn_sizeof_simple_pointer(pMaxDeviation); /* out */ + + return cmd_size; +} + +static inline void vn_encode_vkGetCalibratedTimestampsEXT(struct vn_cs_encoder *enc, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetCalibratedTimestampsEXT_EXT; + + vn_encode_VkCommandTypeEXT(enc, &cmd_type); + vn_encode_VkFlags(enc, &cmd_flags); + + vn_encode_VkDevice(enc, &device); + vn_encode_uint32_t(enc, ×tampCount); + if (pTimestampInfos) { + vn_encode_array_size(enc, timestampCount); + for (uint32_t i = 0; i < timestampCount; i++) + vn_encode_VkCalibratedTimestampInfoEXT(enc, &pTimestampInfos[i]); + } else { + vn_encode_array_size(enc, 0); + } + vn_encode_array_size(enc, pTimestamps ? timestampCount : 0); /* out */ + vn_encode_simple_pointer(enc, pMaxDeviation); /* out */ +} + +static inline size_t vn_sizeof_vkGetCalibratedTimestampsEXT_reply(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) +{ + const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkGetCalibratedTimestampsEXT_EXT; + size_t cmd_size = vn_sizeof_VkCommandTypeEXT(&cmd_type); + + VkResult ret; + cmd_size += vn_sizeof_VkResult(&ret); + /* skip device */ + /* skip timestampCount */ + /* skip pTimestampInfos */ + if (pTimestamps) { + cmd_size += vn_sizeof_array_size(timestampCount); + cmd_size += vn_sizeof_uint64_t_array(pTimestamps, timestampCount); + } else { + cmd_size += vn_sizeof_array_size(0); + } + cmd_size += vn_sizeof_simple_pointer(pMaxDeviation); + if (pMaxDeviation) + cmd_size += vn_sizeof_uint64_t(pMaxDeviation); + + return cmd_size; +} + +static inline VkResult vn_decode_vkGetCalibratedTimestampsEXT_reply(struct vn_cs_decoder *dec, VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) +{ + VkCommandTypeEXT command_type; + vn_decode_VkCommandTypeEXT(dec, &command_type); + assert(command_type == VK_COMMAND_TYPE_vkGetCalibratedTimestampsEXT_EXT); + + VkResult ret; + vn_decode_VkResult(dec, &ret); + /* skip device */ + /* skip timestampCount */ + /* skip pTimestampInfos */ + if (vn_peek_array_size(dec)) { + const size_t array_size = vn_decode_array_size(dec, timestampCount); + vn_decode_uint64_t_array(dec, pTimestamps, array_size); + } else { + vn_decode_array_size_unchecked(dec); + pTimestamps = NULL; + } + if (vn_decode_simple_pointer(dec)) { + vn_decode_uint64_t(dec, pMaxDeviation); + } else { + pMaxDeviation = NULL; + } + + return ret; +} + static inline size_t vn_sizeof_vkSetReplyCommandStreamMESA(const VkCommandStreamDescriptionMESA* pStream) { const VkCommandTypeEXT cmd_type = VK_COMMAND_TYPE_vkSetReplyCommandStreamMESA_EXT; @@ -903,6 +1047,27 @@ static inline void vn_decode_vkGetVenusExperimentalFeatureData100000MESA_reply(s } } +static inline void vn_submit_vkGetCalibratedTimestampsEXT(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation, struct vn_instance_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_vkGetCalibratedTimestampsEXT(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation); + 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_vkGetCalibratedTimestampsEXT_reply(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation) : 0; + + struct vn_cs_encoder *enc = vn_instance_submit_command_init(vn_instance, submit, cmd_data, cmd_size, reply_size); + if (cmd_size) { + vn_encode_vkGetCalibratedTimestampsEXT(enc, cmd_flags, device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation); + vn_instance_submit_command(vn_instance, submit); + if (cmd_data != local_cmd_data) + free(cmd_data); + } +} + static inline void vn_submit_vkSetReplyCommandStreamMESA(struct vn_instance *vn_instance, VkCommandFlagsEXT cmd_flags, const VkCommandStreamDescriptionMESA* pStream, struct vn_instance_submit_command *submit) { uint8_t local_cmd_data[VN_SUBMIT_LOCAL_CMD_SIZE]; @@ -1092,6 +1257,28 @@ static inline void vn_submit_vkGetVenusExperimentalFeatureData100000MESA(struct } } +static inline VkResult vn_call_vkGetCalibratedTimestampsEXT(struct vn_instance *vn_instance, VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) +{ + VN_TRACE_FUNC(); + + struct vn_instance_submit_command submit; + vn_submit_vkGetCalibratedTimestampsEXT(vn_instance, VK_COMMAND_GENERATE_REPLY_BIT_EXT, device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation, &submit); + struct vn_cs_decoder *dec = vn_instance_get_command_reply(vn_instance, &submit); + if (dec) { + const VkResult ret = vn_decode_vkGetCalibratedTimestampsEXT_reply(dec, device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation); + vn_instance_free_command_reply(vn_instance, &submit); + return ret; + } else { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } +} + +static inline void vn_async_vkGetCalibratedTimestampsEXT(struct vn_instance *vn_instance, VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) +{ + struct vn_instance_submit_command submit; + vn_submit_vkGetCalibratedTimestampsEXT(vn_instance, 0, device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation, &submit); +} + static inline void vn_call_vkSetReplyCommandStreamMESA(struct vn_instance *vn_instance, const VkCommandStreamDescriptionMESA* pStream) { VN_TRACE_FUNC(); diff --git a/src/virtio/venus-protocol/vn_protocol_driver_types.h b/src/virtio/venus-protocol/vn_protocol_driver_types.h index 48f04d3..092cc4a 100644 --- a/src/virtio/venus-protocol/vn_protocol_driver_types.h +++ b/src/virtio/venus-protocol/vn_protocol_driver_types.h @@ -420,6 +420,27 @@ vn_decode_uint8_t_array(struct vn_cs_decoder *dec, uint8_t *val, uint32_t count) vn_decode(dec, (size + 3) & ~3, val, size); } +/* uint16_t */ + +static inline size_t +vn_sizeof_uint16_t(const uint16_t *val) +{ + assert(sizeof(*val) == 2); + return 4; +} + +static inline void +vn_encode_uint16_t(struct vn_cs_encoder *enc, const uint16_t *val) +{ + vn_encode(enc, 4, val, sizeof(*val)); +} + +static inline void +vn_decode_uint16_t(struct vn_cs_decoder *dec, uint16_t *val) +{ + vn_decode(dec, 4, val, sizeof(*val)); +} + /* typedef uint32_t VkSampleMask */ static inline size_t @@ -2838,6 +2859,45 @@ vn_decode_VkPointClippingBehavior(struct vn_cs_decoder *dec, VkPointClippingBeha vn_decode_int32_t(dec, (int32_t *)val); } +/* enum VkTimeDomainEXT */ + +static inline size_t +vn_sizeof_VkTimeDomainEXT(const VkTimeDomainEXT *val) +{ + assert(sizeof(*val) == sizeof(int32_t)); + return vn_sizeof_int32_t((const int32_t *)val); +} + +static inline void +vn_encode_VkTimeDomainEXT(struct vn_cs_encoder *enc, const VkTimeDomainEXT *val) +{ + vn_encode_int32_t(enc, (const int32_t *)val); +} + +static inline void +vn_decode_VkTimeDomainEXT(struct vn_cs_decoder *dec, VkTimeDomainEXT *val) +{ + vn_decode_int32_t(dec, (int32_t *)val); +} + +static inline size_t +vn_sizeof_VkTimeDomainEXT_array(const VkTimeDomainEXT *val, uint32_t count) +{ + return vn_sizeof_int32_t_array((const int32_t *)val, count); +} + +static inline void +vn_encode_VkTimeDomainEXT_array(struct vn_cs_encoder *enc, const VkTimeDomainEXT *val, uint32_t count) +{ + vn_encode_int32_t_array(enc, (const int32_t *)val, count); +} + +static inline void +vn_decode_VkTimeDomainEXT_array(struct vn_cs_decoder *dec, VkTimeDomainEXT *val, uint32_t count) +{ + vn_decode_int32_t_array(dec, (int32_t *)val, count); +} + /* enum VkSemaphoreType */ static inline size_t @@ -2859,6 +2919,48 @@ vn_decode_VkSemaphoreType(struct vn_cs_decoder *dec, VkSemaphoreType *val) vn_decode_int32_t(dec, (int32_t *)val); } +/* enum VkLineRasterizationModeEXT */ + +static inline size_t +vn_sizeof_VkLineRasterizationModeEXT(const VkLineRasterizationModeEXT *val) +{ + assert(sizeof(*val) == sizeof(int32_t)); + return vn_sizeof_int32_t((const int32_t *)val); +} + +static inline void +vn_encode_VkLineRasterizationModeEXT(struct vn_cs_encoder *enc, const VkLineRasterizationModeEXT *val) +{ + vn_encode_int32_t(enc, (const int32_t *)val); +} + +static inline void +vn_decode_VkLineRasterizationModeEXT(struct vn_cs_decoder *dec, VkLineRasterizationModeEXT *val) +{ + vn_decode_int32_t(dec, (int32_t *)val); +} + +/* enum VkProvokingVertexModeEXT */ + +static inline size_t +vn_sizeof_VkProvokingVertexModeEXT(const VkProvokingVertexModeEXT *val) +{ + assert(sizeof(*val) == sizeof(int32_t)); + return vn_sizeof_int32_t((const int32_t *)val); +} + +static inline void +vn_encode_VkProvokingVertexModeEXT(struct vn_cs_encoder *enc, const VkProvokingVertexModeEXT *val) +{ + vn_encode_int32_t(enc, (const int32_t *)val); +} + +static inline void +vn_decode_VkProvokingVertexModeEXT(struct vn_cs_decoder *dec, VkProvokingVertexModeEXT *val) +{ + vn_decode_int32_t(dec, (int32_t *)val); +} + /* enum VkTessellationDomainOrigin */ static inline size_t -- 2.7.4