diff options
author | Juston Li <justonli@google.com> | 2023-09-12 13:38:25 -0700 |
---|---|---|
committer | Juston Li <justonli@google.com> | 2023-09-12 15:56:46 -0700 |
commit | 29c0555207bca142e7a4372c5490e4bac0633b09 (patch) | |
tree | c511978fa343f6f4eb527d95b2a6dcc2a01e0382 | |
parent | 7c00966bff993da03edf6bae59aca5843babf628 (diff) |
vkr: sync protocol for VK_EXT_vertex_input_dynamic_state
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1236>
7 files changed, 372 insertions, 6 deletions
diff --git a/src/venus/venus-protocol/vn_protocol_renderer.h b/src/venus/venus-protocol/vn_protocol_renderer.h index 8c92b02..4ad4a07 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer.h +++ b/src/venus/venus-protocol/vn_protocol_renderer.h @@ -1,4 +1,4 @@ -/* This file is generated by venus-protocol git-d6bf073e. */ +/* This file is generated by venus-protocol git-bf4748e6. */ /* * Copyright 2020 Google LLC diff --git a/src/venus/venus-protocol/vn_protocol_renderer_command_buffer.h b/src/venus/venus-protocol/vn_protocol_renderer_command_buffer.h index ff2764f..31aebf7 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_command_buffer.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_command_buffer.h @@ -2130,6 +2130,132 @@ vn_replace_VkResolveImageInfo2_handle(VkResolveImageInfo2 *val) } while (pnext); } +/* struct VkVertexInputBindingDescription2EXT chain */ + +static inline void * +vn_decode_VkVertexInputBindingDescription2EXT_pnext_temp(struct vn_cs_decoder *dec) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + vn_cs_decoder_set_fatal(dec); + return NULL; +} + +static inline void +vn_decode_VkVertexInputBindingDescription2EXT_self_temp(struct vn_cs_decoder *dec, VkVertexInputBindingDescription2EXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_uint32_t(dec, &val->binding); + vn_decode_uint32_t(dec, &val->stride); + vn_decode_VkVertexInputRate(dec, &val->inputRate); + vn_decode_uint32_t(dec, &val->divisor); +} + +static inline void +vn_decode_VkVertexInputBindingDescription2EXT_temp(struct vn_cs_decoder *dec, VkVertexInputBindingDescription2EXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + if (stype != VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT) + vn_cs_decoder_set_fatal(dec); + + val->sType = stype; + val->pNext = vn_decode_VkVertexInputBindingDescription2EXT_pnext_temp(dec); + vn_decode_VkVertexInputBindingDescription2EXT_self_temp(dec, val); +} + +static inline void +vn_replace_VkVertexInputBindingDescription2EXT_handle_self(VkVertexInputBindingDescription2EXT *val) +{ + /* skip val->sType */ + /* skip val->pNext */ + /* skip val->binding */ + /* skip val->stride */ + /* skip val->inputRate */ + /* skip val->divisor */ +} + +static inline void +vn_replace_VkVertexInputBindingDescription2EXT_handle(VkVertexInputBindingDescription2EXT *val) +{ + struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val; + + do { + switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT: + vn_replace_VkVertexInputBindingDescription2EXT_handle_self((VkVertexInputBindingDescription2EXT *)pnext); + break; + default: + /* ignore unknown/unsupported struct */ + break; + } + pnext = pnext->pNext; + } while (pnext); +} + +/* struct VkVertexInputAttributeDescription2EXT chain */ + +static inline void * +vn_decode_VkVertexInputAttributeDescription2EXT_pnext_temp(struct vn_cs_decoder *dec) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + vn_cs_decoder_set_fatal(dec); + return NULL; +} + +static inline void +vn_decode_VkVertexInputAttributeDescription2EXT_self_temp(struct vn_cs_decoder *dec, VkVertexInputAttributeDescription2EXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_uint32_t(dec, &val->location); + vn_decode_uint32_t(dec, &val->binding); + vn_decode_VkFormat(dec, &val->format); + vn_decode_uint32_t(dec, &val->offset); +} + +static inline void +vn_decode_VkVertexInputAttributeDescription2EXT_temp(struct vn_cs_decoder *dec, VkVertexInputAttributeDescription2EXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + if (stype != VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT) + vn_cs_decoder_set_fatal(dec); + + val->sType = stype; + val->pNext = vn_decode_VkVertexInputAttributeDescription2EXT_pnext_temp(dec); + vn_decode_VkVertexInputAttributeDescription2EXT_self_temp(dec, val); +} + +static inline void +vn_replace_VkVertexInputAttributeDescription2EXT_handle_self(VkVertexInputAttributeDescription2EXT *val) +{ + /* skip val->sType */ + /* skip val->pNext */ + /* skip val->location */ + /* skip val->binding */ + /* skip val->format */ + /* skip val->offset */ +} + +static inline void +vn_replace_VkVertexInputAttributeDescription2EXT_handle(VkVertexInputAttributeDescription2EXT *val) +{ + struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val; + + do { + switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT: + vn_replace_VkVertexInputAttributeDescription2EXT_handle_self((VkVertexInputAttributeDescription2EXT *)pnext); + break; + default: + /* ignore unknown/unsupported struct */ + break; + } + pnext = pnext->pNext; + } while (pnext); +} + /* struct VkBufferMemoryBarrier2 chain */ static inline void * @@ -5574,6 +5700,59 @@ static inline void vn_encode_vkCmdResolveImage2_reply(struct vn_cs_encoder *enc, /* skip args->pResolveImageInfo */ } +static inline void vn_decode_vkCmdSetVertexInputEXT_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCmdSetVertexInputEXT *args) +{ + vn_decode_VkCommandBuffer_lookup(dec, &args->commandBuffer); + vn_decode_uint32_t(dec, &args->vertexBindingDescriptionCount); + if (vn_peek_array_size(dec)) { + const uint32_t iter_count = vn_decode_array_size(dec, args->vertexBindingDescriptionCount); + args->pVertexBindingDescriptions = vn_cs_decoder_alloc_temp_array(dec, sizeof(*args->pVertexBindingDescriptions), iter_count); + if (!args->pVertexBindingDescriptions) return; + for (uint32_t i = 0; i < iter_count; i++) + vn_decode_VkVertexInputBindingDescription2EXT_temp(dec, &((VkVertexInputBindingDescription2EXT *)args->pVertexBindingDescriptions)[i]); + } else { + vn_decode_array_size(dec, args->vertexBindingDescriptionCount); + args->pVertexBindingDescriptions = NULL; + } + vn_decode_uint32_t(dec, &args->vertexAttributeDescriptionCount); + if (vn_peek_array_size(dec)) { + const uint32_t iter_count = vn_decode_array_size(dec, args->vertexAttributeDescriptionCount); + args->pVertexAttributeDescriptions = vn_cs_decoder_alloc_temp_array(dec, sizeof(*args->pVertexAttributeDescriptions), iter_count); + if (!args->pVertexAttributeDescriptions) return; + for (uint32_t i = 0; i < iter_count; i++) + vn_decode_VkVertexInputAttributeDescription2EXT_temp(dec, &((VkVertexInputAttributeDescription2EXT *)args->pVertexAttributeDescriptions)[i]); + } else { + vn_decode_array_size(dec, args->vertexAttributeDescriptionCount); + args->pVertexAttributeDescriptions = NULL; + } +} + +static inline void vn_replace_vkCmdSetVertexInputEXT_args_handle(struct vn_command_vkCmdSetVertexInputEXT *args) +{ + vn_replace_VkCommandBuffer_handle(&args->commandBuffer); + /* skip args->vertexBindingDescriptionCount */ + if (args->pVertexBindingDescriptions) { + for (uint32_t i = 0; i < args->vertexBindingDescriptionCount; i++) + vn_replace_VkVertexInputBindingDescription2EXT_handle(&((VkVertexInputBindingDescription2EXT *)args->pVertexBindingDescriptions)[i]); + } + /* skip args->vertexAttributeDescriptionCount */ + if (args->pVertexAttributeDescriptions) { + for (uint32_t i = 0; i < args->vertexAttributeDescriptionCount; i++) + vn_replace_VkVertexInputAttributeDescription2EXT_handle(&((VkVertexInputAttributeDescription2EXT *)args->pVertexAttributeDescriptions)[i]); + } +} + +static inline void vn_encode_vkCmdSetVertexInputEXT_reply(struct vn_cs_encoder *enc, const struct vn_command_vkCmdSetVertexInputEXT *args) +{ + vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkCmdSetVertexInputEXT_EXT}); + + /* skip args->commandBuffer */ + /* skip args->vertexBindingDescriptionCount */ + /* skip args->pVertexBindingDescriptions */ + /* skip args->vertexAttributeDescriptionCount */ + /* skip args->pVertexAttributeDescriptions */ +} + static inline void vn_decode_vkCmdSetColorWriteEnableEXT_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkCmdSetColorWriteEnableEXT *args) { vn_decode_VkCommandBuffer_lookup(dec, &args->commandBuffer); @@ -8012,6 +8191,30 @@ static inline void vn_dispatch_vkCmdResolveImage2(struct vn_dispatch_context *ct vn_cs_decoder_reset_temp_pool(ctx->decoder); } +static inline void vn_dispatch_vkCmdSetVertexInputEXT(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) +{ + struct vn_command_vkCmdSetVertexInputEXT args; + + if (!ctx->dispatch_vkCmdSetVertexInputEXT) { + vn_cs_decoder_set_fatal(ctx->decoder); + return; + } + + vn_decode_vkCmdSetVertexInputEXT_args_temp(ctx->decoder, &args); + if (!args.commandBuffer) { + vn_cs_decoder_set_fatal(ctx->decoder); + return; + } + + if (!vn_cs_decoder_get_fatal(ctx->decoder)) + ctx->dispatch_vkCmdSetVertexInputEXT(ctx, &args); + + if ((flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT) && !vn_cs_decoder_get_fatal(ctx->decoder)) + vn_encode_vkCmdSetVertexInputEXT_reply(ctx->encoder, &args); + + vn_cs_decoder_reset_temp_pool(ctx->decoder); +} + static inline void vn_dispatch_vkCmdSetColorWriteEnableEXT(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) { struct vn_command_vkCmdSetColorWriteEnableEXT args; diff --git a/src/venus/venus-protocol/vn_protocol_renderer_defines.h b/src/venus/venus-protocol/vn_protocol_renderer_defines.h index c8f1f93..ed3feb4 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_defines.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_defines.h @@ -341,6 +341,7 @@ typedef enum VkCommandTypeEXT { VK_COMMAND_TYPE_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_EXT = 235, VK_COMMAND_TYPE_vkGetCalibratedTimestampsEXT_EXT = 236, VK_COMMAND_TYPE_vkCmdSetLineStippleEXT_EXT = 237, + VK_COMMAND_TYPE_vkCmdSetVertexInputEXT_EXT = 255, VK_COMMAND_TYPE_vkCmdSetPatchControlPointsEXT_EXT = 233, VK_COMMAND_TYPE_vkCmdSetLogicOpEXT_EXT = 234, VK_COMMAND_TYPE_vkCmdSetColorWriteEnableEXT_EXT = 254, @@ -2138,6 +2139,14 @@ struct vn_command_vkCmdResolveImage2 { const VkResolveImageInfo2* pResolveImageInfo; }; +struct vn_command_vkCmdSetVertexInputEXT { + VkCommandBuffer commandBuffer; + uint32_t vertexBindingDescriptionCount; + const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions; + uint32_t vertexAttributeDescriptionCount; + const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions; +}; + struct vn_command_vkCmdSetColorWriteEnableEXT { VkCommandBuffer commandBuffer; uint32_t attachmentCount; @@ -2506,6 +2515,7 @@ struct vn_dispatch_context { void (*dispatch_vkCmdCopyBufferToImage2)(struct vn_dispatch_context *ctx, struct vn_command_vkCmdCopyBufferToImage2 *args); void (*dispatch_vkCmdCopyImageToBuffer2)(struct vn_dispatch_context *ctx, struct vn_command_vkCmdCopyImageToBuffer2 *args); void (*dispatch_vkCmdResolveImage2)(struct vn_dispatch_context *ctx, struct vn_command_vkCmdResolveImage2 *args); + void (*dispatch_vkCmdSetVertexInputEXT)(struct vn_dispatch_context *ctx, struct vn_command_vkCmdSetVertexInputEXT *args); void (*dispatch_vkCmdSetColorWriteEnableEXT)(struct vn_dispatch_context *ctx, struct vn_command_vkCmdSetColorWriteEnableEXT *args); void (*dispatch_vkCmdSetEvent2)(struct vn_dispatch_context *ctx, struct vn_command_vkCmdSetEvent2 *args); void (*dispatch_vkCmdResetEvent2)(struct vn_dispatch_context *ctx, struct vn_command_vkCmdResetEvent2 *args); diff --git a/src/venus/venus-protocol/vn_protocol_renderer_device.h b/src/venus/venus-protocol/vn_protocol_renderer_device.h index 630dbe8..98b7d2d 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_device.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_device.h @@ -6973,6 +6973,115 @@ vn_replace_VkPhysicalDeviceDepthClipControlFeaturesEXT_handle(VkPhysicalDeviceDe } while (pnext); } +/* struct VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT chain */ + +static inline void +vn_encode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self(struct vn_cs_encoder *enc, const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_VkBool32(enc, &val->vertexInputDynamicState); +} + +static inline void +vn_encode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(struct vn_cs_encoder *enc, const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT }); + vn_encode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_pnext(enc, val->pNext); + vn_encode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self(enc, val); +} + +static inline void * +vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_pnext_temp(struct vn_cs_decoder *dec) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + vn_cs_decoder_set_fatal(dec); + return NULL; +} + +static inline void +vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self_temp(struct vn_cs_decoder *dec, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + vn_decode_VkBool32(dec, &val->vertexInputDynamicState); +} + +static inline void +vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_temp(struct vn_cs_decoder *dec, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + if (stype != VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT) + vn_cs_decoder_set_fatal(dec); + + val->sType = stype; + val->pNext = vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_pnext_temp(dec); + vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self_temp(dec, val); +} + +static inline void * +vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_pnext_partial_temp(struct vn_cs_decoder *dec) +{ + /* no known/supported struct */ + if (vn_decode_simple_pointer(dec)) + vn_cs_decoder_set_fatal(dec); + return NULL; +} + +static inline void +vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self_partial_temp(struct vn_cs_decoder *dec, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->vertexInputDynamicState */ +} + +static inline void +vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_partial_temp(struct vn_cs_decoder *dec, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + if (stype != VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT) + vn_cs_decoder_set_fatal(dec); + + val->sType = stype; + val->pNext = vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_pnext_partial_temp(dec); + vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self_partial_temp(dec, val); +} + +static inline void +vn_replace_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_handle_self(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + /* skip val->sType */ + /* skip val->pNext */ + /* skip val->vertexInputDynamicState */ +} + +static inline void +vn_replace_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_handle(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *val) +{ + struct VkBaseOutStructure *pnext = (struct VkBaseOutStructure *)val; + + do { + switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: + vn_replace_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_handle_self((VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)pnext); + break; + default: + /* ignore unknown/unsupported struct */ + break; + } + pnext = pnext->pNext; + } while (pnext); +} + /* struct VkPhysicalDeviceColorWriteEnableFeaturesEXT chain */ static inline void @@ -8513,6 +8622,12 @@ vn_encode_VkPhysicalDeviceFeatures2_pnext(struct vn_cs_encoder *enc, const void vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); vn_encode_VkPhysicalDeviceDepthClipControlFeaturesEXT_self(enc, (const VkPhysicalDeviceDepthClipControlFeaturesEXT *)pnext); return; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkPhysicalDeviceFeatures2_pnext(enc, pnext->pNext); + vn_encode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self(enc, (const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)pnext); + return; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: vn_encode_simple_pointer(enc, pnext); vn_encode_VkStructureType(enc, &pnext->sType); @@ -9032,6 +9147,14 @@ vn_decode_VkPhysicalDeviceFeatures2_pnext_temp(struct vn_cs_decoder *dec) vn_decode_VkPhysicalDeviceDepthClipControlFeaturesEXT_self_temp(dec, (VkPhysicalDeviceDepthClipControlFeaturesEXT *)pnext); } break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: + pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT)); + if (pnext) { + pnext->sType = stype; + pnext->pNext = vn_decode_VkPhysicalDeviceFeatures2_pnext_temp(dec); + vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self_temp(dec, (VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)pnext); + } + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkPhysicalDeviceColorWriteEnableFeaturesEXT)); if (pnext) { @@ -9577,6 +9700,14 @@ vn_decode_VkPhysicalDeviceFeatures2_pnext_partial_temp(struct vn_cs_decoder *dec vn_decode_VkPhysicalDeviceDepthClipControlFeaturesEXT_self_partial_temp(dec, (VkPhysicalDeviceDepthClipControlFeaturesEXT *)pnext); } break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: + pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT)); + if (pnext) { + pnext->sType = stype; + pnext->pNext = vn_decode_VkPhysicalDeviceFeatures2_pnext_partial_temp(dec); + vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self_partial_temp(dec, (VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)pnext); + } + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkPhysicalDeviceColorWriteEnableFeaturesEXT)); if (pnext) { @@ -9869,6 +10000,9 @@ vn_replace_VkPhysicalDeviceFeatures2_handle(VkPhysicalDeviceFeatures2 *val) case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: vn_replace_VkPhysicalDeviceDepthClipControlFeaturesEXT_handle_self((VkPhysicalDeviceDepthClipControlFeaturesEXT *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: + vn_replace_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_handle_self((VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: vn_replace_VkPhysicalDeviceColorWriteEnableFeaturesEXT_handle_self((VkPhysicalDeviceColorWriteEnableFeaturesEXT *)pnext); break; @@ -10434,6 +10568,14 @@ vn_decode_VkDeviceCreateInfo_pnext_temp(struct vn_cs_decoder *dec) vn_decode_VkPhysicalDeviceDepthClipControlFeaturesEXT_self_temp(dec, (VkPhysicalDeviceDepthClipControlFeaturesEXT *)pnext); } break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: + pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT)); + if (pnext) { + pnext->sType = stype; + pnext->pNext = vn_decode_VkDeviceCreateInfo_pnext_temp(dec); + vn_decode_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_self_temp(dec, (VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)pnext); + } + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkPhysicalDeviceColorWriteEnableFeaturesEXT)); if (pnext) { @@ -10794,6 +10936,9 @@ vn_replace_VkDeviceCreateInfo_handle(VkDeviceCreateInfo *val) case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: vn_replace_VkPhysicalDeviceDepthClipControlFeaturesEXT_handle_self((VkPhysicalDeviceDepthClipControlFeaturesEXT *)pnext); break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: + vn_replace_VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT_handle_self((VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *)pnext); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: vn_replace_VkPhysicalDeviceColorWriteEnableFeaturesEXT_handle_self((VkPhysicalDeviceColorWriteEnableFeaturesEXT *)pnext); break; diff --git a/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h b/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h index 7fe0114..ee7f80d 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h @@ -263,6 +263,7 @@ static inline const char *vn_dispatch_command_name(VkCommandTypeEXT type) case VK_COMMAND_TYPE_vkCmdCopyBufferToImage2_EXT: return "vkCmdCopyBufferToImage2"; case VK_COMMAND_TYPE_vkCmdCopyImageToBuffer2_EXT: return "vkCmdCopyImageToBuffer2"; case VK_COMMAND_TYPE_vkCmdResolveImage2_EXT: return "vkCmdResolveImage2"; + case VK_COMMAND_TYPE_vkCmdSetVertexInputEXT_EXT: return "vkCmdSetVertexInputEXT"; case VK_COMMAND_TYPE_vkCmdSetColorWriteEnableEXT_EXT: return "vkCmdSetColorWriteEnableEXT"; case VK_COMMAND_TYPE_vkCmdSetEvent2_EXT: return "vkCmdSetEvent2"; case VK_COMMAND_TYPE_vkCmdResetEvent2_EXT: return "vkCmdResetEvent2"; @@ -301,7 +302,7 @@ static inline const char *vn_dispatch_command_name(VkCommandTypeEXT type) } } -static void (*const vn_dispatch_table[255])(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) = { +static void (*const vn_dispatch_table[256])(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) = { [VK_COMMAND_TYPE_vkCreateInstance_EXT] = vn_dispatch_vkCreateInstance, [VK_COMMAND_TYPE_vkDestroyInstance_EXT] = vn_dispatch_vkDestroyInstance, [VK_COMMAND_TYPE_vkEnumeratePhysicalDevices_EXT] = vn_dispatch_vkEnumeratePhysicalDevices, @@ -522,6 +523,7 @@ static void (*const vn_dispatch_table[255])(struct vn_dispatch_context *ctx, VkC [VK_COMMAND_TYPE_vkCmdCopyBufferToImage2_EXT] = vn_dispatch_vkCmdCopyBufferToImage2, [VK_COMMAND_TYPE_vkCmdCopyImageToBuffer2_EXT] = vn_dispatch_vkCmdCopyImageToBuffer2, [VK_COMMAND_TYPE_vkCmdResolveImage2_EXT] = vn_dispatch_vkCmdResolveImage2, + [VK_COMMAND_TYPE_vkCmdSetVertexInputEXT_EXT] = vn_dispatch_vkCmdSetVertexInputEXT, [VK_COMMAND_TYPE_vkCmdSetColorWriteEnableEXT_EXT] = vn_dispatch_vkCmdSetColorWriteEnableEXT, [VK_COMMAND_TYPE_vkCmdSetEvent2_EXT] = vn_dispatch_vkCmdSetEvent2, [VK_COMMAND_TYPE_vkCmdResetEvent2_EXT] = vn_dispatch_vkCmdResetEvent2, @@ -559,7 +561,7 @@ static inline void vn_dispatch_command(struct vn_dispatch_context *ctx) #ifdef DEBUG TRACE_SCOPE_SLOW(vn_dispatch_command_name(cmd_type)); #endif - if (cmd_type < 255 && vn_dispatch_table[cmd_type]) + if (cmd_type < 256 && vn_dispatch_table[cmd_type]) vn_dispatch_table[cmd_type](ctx, cmd_flags); else vn_cs_decoder_set_fatal(ctx->decoder); diff --git a/src/venus/venus-protocol/vn_protocol_renderer_info.h b/src/venus/venus-protocol/vn_protocol_renderer_info.h index 8398a35..b2e986c 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_info.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_info.h @@ -12,7 +12,7 @@ struct vn_info_extension_table { union { - bool enabled[110]; + bool enabled[111]; struct { bool EXT_4444_formats; bool EXT_border_color_swizzle; @@ -66,6 +66,7 @@ struct vn_info_extension_table { bool EXT_tooling_info; bool EXT_transform_feedback; bool EXT_vertex_attribute_divisor; + bool EXT_vertex_input_dynamic_state; bool EXT_ycbcr_2plane_444_formats; bool KHR_16bit_storage; bool KHR_8bit_storage; @@ -137,8 +138,8 @@ struct vn_info_extension { }; /* sorted by extension names for bsearch */ -static const uint32_t _vn_info_extension_count = 110; -static const struct vn_info_extension _vn_info_extensions[110] = { +static const uint32_t _vn_info_extension_count = 111; +static const struct vn_info_extension _vn_info_extensions[111] = { { "VK_EXT_4444_formats", 341, 1 }, { "VK_EXT_border_color_swizzle", 412, 1 }, { "VK_EXT_calibrated_timestamps", 185, 2 }, @@ -191,6 +192,7 @@ static const struct vn_info_extension _vn_info_extensions[110] = { { "VK_EXT_tooling_info", 246, 1 }, { "VK_EXT_transform_feedback", 29, 1 }, { "VK_EXT_vertex_attribute_divisor", 191, 3 }, + { "VK_EXT_vertex_input_dynamic_state", 353, 2 }, { "VK_EXT_ycbcr_2plane_444_formats", 331, 1 }, { "VK_KHR_16bit_storage", 84, 1 }, { "VK_KHR_8bit_storage", 178, 1 }, diff --git a/src/venus/venus-protocol/vn_protocol_renderer_util.h b/src/venus/venus-protocol/vn_protocol_renderer_util.h index 1912c35..a98334b 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_util.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_util.h @@ -113,6 +113,7 @@ struct vn_device_proc_table { PFN_vkCmdSetStencilReference CmdSetStencilReference; PFN_vkCmdSetStencilTestEnable CmdSetStencilTestEnable; PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask; + PFN_vkCmdSetVertexInputEXT CmdSetVertexInputEXT; PFN_vkCmdSetViewport CmdSetViewport; PFN_vkCmdSetViewportWithCount CmdSetViewportWithCount; PFN_vkCmdUpdateBuffer CmdUpdateBuffer; @@ -479,6 +480,9 @@ vn_util_init_device_proc_table(VkDevice dev, ext_table->EXT_extended_dynamic_state ? VN_GDPA(dev, vkCmdSetStencilTestEnableEXT) : NULL; proc_table->CmdSetStencilWriteMask = VN_GDPA(dev, vkCmdSetStencilWriteMask); + proc_table->CmdSetVertexInputEXT = + ext_table->EXT_vertex_input_dynamic_state ? VN_GDPA(dev, vkCmdSetVertexInputEXT) : + NULL; proc_table->CmdSetViewport = VN_GDPA(dev, vkCmdSetViewport); proc_table->CmdSetViewportWithCount = api_version >= VK_API_VERSION_1_3 ? VN_GDPA(dev, vkCmdSetViewportWithCount) : |