diff --git a/src/venus-protocol/vn_protocol_renderer.h b/src/venus-protocol/vn_protocol_renderer.h index f6a664a..683907f 100644 --- a/src/venus-protocol/vn_protocol_renderer.h +++ b/src/venus-protocol/vn_protocol_renderer.h @@ -1,4 +1,4 @@ -/* This file is generated by venus-protocol git-1975d149. */ +/* This file is generated by venus-protocol git-335af8e9. */ /* * Copyright 2020 Google LLC diff --git a/src/venus-protocol/vn_protocol_renderer_defines.h b/src/venus-protocol/vn_protocol_renderer_defines.h index 6d07f3a..c1e48a6 100644 --- a/src/venus-protocol/vn_protocol_renderer_defines.h +++ b/src/venus-protocol/vn_protocol_renderer_defines.h @@ -21,6 +21,7 @@ #define VK_STRUCTURE_TYPE_RING_CREATE_INFO_MESA ((VkStructureType)1000384000) #define VK_STRUCTURE_TYPE_MEMORY_RESOURCE_PROPERTIES_MESA ((VkStructureType)1000384001) #define VK_STRUCTURE_TYPE_IMPORT_MEMORY_RESOURCE_INFO_MESA ((VkStructureType)1000384002) +#define VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA ((VkStructureType)1000384003) typedef enum VkCommandTypeEXT { VK_COMMAND_TYPE_vkCreateInstance_EXT = 0, @@ -260,6 +261,7 @@ typedef enum VkCommandTypeEXT { VK_COMMAND_TYPE_vkNotifyRingMESA_EXT = 190, VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT = 191, VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT = 192, + VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT = 195, } VkCommandTypeEXT; typedef enum VkCommandFlagBitsEXT { @@ -314,6 +316,16 @@ typedef struct VkImportMemoryResourceInfoMESA { uint32_t resourceId; } VkImportMemoryResourceInfoMESA; +typedef struct VkVenusExperimentalFeatures100000MESA { + VkBool32 memoryResourceAllocationSize; +} VkVenusExperimentalFeatures100000MESA; + +typedef struct VkMemoryResourceAllocationSizeProperties100000MESA { + VkStructureType sType; + void* pNext; + uint64_t allocationSize; +} VkMemoryResourceAllocationSizeProperties100000MESA; + struct vn_command_vkCreateInstance { const VkInstanceCreateInfo* pCreateInfo; const VkAllocationCallbacks* pAllocator; @@ -1765,6 +1777,11 @@ struct vn_command_vkGetMemoryResourcePropertiesMESA { VkResult ret; }; +struct vn_command_vkGetVenusExperimentalFeatureData100000MESA { + size_t* pDataSize; + void* pData; +}; + struct vn_dispatch_context { void *data; void (*debug_log)(struct vn_dispatch_context *ctx, const char *msg); @@ -1967,6 +1984,7 @@ struct vn_dispatch_context { void (*dispatch_vkNotifyRingMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkNotifyRingMESA *args); void (*dispatch_vkWriteRingExtraMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkWriteRingExtraMESA *args); void (*dispatch_vkGetMemoryResourcePropertiesMESA)(struct vn_dispatch_context *ctx, struct vn_command_vkGetMemoryResourcePropertiesMESA *args); + void (*dispatch_vkGetVenusExperimentalFeatureData100000MESA)(struct vn_dispatch_context *ctx, struct vn_command_vkGetVenusExperimentalFeatureData100000MESA *args); }; static inline void vn_dispatch_debug_log(struct vn_dispatch_context *ctx, const char *format, ...) diff --git a/src/venus-protocol/vn_protocol_renderer_dispatches.h b/src/venus-protocol/vn_protocol_renderer_dispatches.h index 4a8d7a7..d45fdc4 100644 --- a/src/venus-protocol/vn_protocol_renderer_dispatches.h +++ b/src/venus-protocol/vn_protocol_renderer_dispatches.h @@ -231,6 +231,7 @@ static inline const char *vn_dispatch_command_name(VkCommandTypeEXT type) case VK_COMMAND_TYPE_vkNotifyRingMESA_EXT: return "vkNotifyRingMESA"; case VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT: return "vkWriteRingExtraMESA"; case VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT: return "vkGetMemoryResourcePropertiesMESA"; + case VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT: return "vkGetVenusExperimentalFeatureData100000MESA"; case VK_COMMAND_TYPE_vkGetDeviceProcAddr_EXT: return "vkGetDeviceProcAddr"; case VK_COMMAND_TYPE_vkGetInstanceProcAddr_EXT: return "vkGetInstanceProcAddr"; case VK_COMMAND_TYPE_vkMapMemory_EXT: return "vkMapMemory"; @@ -241,7 +242,7 @@ static inline const char *vn_dispatch_command_name(VkCommandTypeEXT type) } } -static void (*const vn_dispatch_table[195])(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) = { +static void (*const vn_dispatch_table[196])(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, @@ -431,6 +432,7 @@ static void (*const vn_dispatch_table[195])(struct vn_dispatch_context *ctx, VkC [VK_COMMAND_TYPE_vkNotifyRingMESA_EXT] = vn_dispatch_vkNotifyRingMESA, [VK_COMMAND_TYPE_vkWriteRingExtraMESA_EXT] = vn_dispatch_vkWriteRingExtraMESA, [VK_COMMAND_TYPE_vkGetMemoryResourcePropertiesMESA_EXT] = vn_dispatch_vkGetMemoryResourcePropertiesMESA, + [VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT] = vn_dispatch_vkGetVenusExperimentalFeatureData100000MESA, }; static inline void vn_dispatch_command(struct vn_dispatch_context *ctx) @@ -445,7 +447,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 < 195 && vn_dispatch_table[cmd_type]) + if (cmd_type < 196 && 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-protocol/vn_protocol_renderer_info.h b/src/venus-protocol/vn_protocol_renderer_info.h index e8dcb14..d357e89 100644 --- a/src/venus-protocol/vn_protocol_renderer_info.h +++ b/src/venus-protocol/vn_protocol_renderer_info.h @@ -142,7 +142,7 @@ vn_info_extension_spec_version(const char *name) 1, 1, 3, - 0, + 100000, }; const char **found; diff --git a/src/venus-protocol/vn_protocol_renderer_transport.h b/src/venus-protocol/vn_protocol_renderer_transport.h index cb146cc..c05a6ef 100644 --- a/src/venus-protocol/vn_protocol_renderer_transport.h +++ b/src/venus-protocol/vn_protocol_renderer_transport.h @@ -129,12 +129,81 @@ vn_replace_VkRingCreateInfoMESA_handle(VkRingCreateInfoMESA *val) } while (pnext); } +/* struct VkMemoryResourceAllocationSizeProperties100000MESA chain */ + +static inline void +vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(struct vn_cs_encoder *enc, const void *val) +{ + /* no known/supported struct */ + vn_encode_simple_pointer(enc, NULL); +} + +static inline void +vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self(struct vn_cs_encoder *enc, const VkMemoryResourceAllocationSizeProperties100000MESA *val) +{ + /* skip val->{sType,pNext} */ + vn_encode_uint64_t(enc, &val->allocationSize); +} + +static inline void +vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA(struct vn_cs_encoder *enc, const VkMemoryResourceAllocationSizeProperties100000MESA *val) +{ + assert(val->sType == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA); + vn_encode_VkStructureType(enc, &(VkStructureType){ VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA }); + vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext(enc, val->pNext); + vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self(enc, val); +} + +static inline void * +vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_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_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourceAllocationSizeProperties100000MESA *val) +{ + /* skip val->{sType,pNext} */ + /* skip val->allocationSize */ +} + +static inline void +vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_partial_temp(struct vn_cs_decoder *dec, VkMemoryResourceAllocationSizeProperties100000MESA *val) +{ + VkStructureType stype; + vn_decode_VkStructureType(dec, &stype); + assert(stype == VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA); + + val->sType = stype; + val->pNext = vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_pnext_partial_temp(dec); + vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial_temp(dec, val); +} + /* struct VkMemoryResourcePropertiesMESA chain */ static inline void vn_encode_VkMemoryResourcePropertiesMESA_pnext(struct vn_cs_encoder *enc, const void *val) { - /* no known/supported struct */ + const VkBaseInStructure *pnext = val; + + while (pnext) { + switch ((int32_t)pnext->sType) { + case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA: + vn_encode_simple_pointer(enc, pnext); + vn_encode_VkStructureType(enc, &pnext->sType); + vn_encode_VkMemoryResourcePropertiesMESA_pnext(enc, pnext->pNext); + vn_encode_VkMemoryResourceAllocationSizeProperties100000MESA_self(enc, (const VkMemoryResourceAllocationSizeProperties100000MESA *)pnext); + return; + default: + /* ignore unknown/unsupported struct */ + break; + } + pnext = pnext->pNext; + } + vn_encode_simple_pointer(enc, NULL); } @@ -157,10 +226,30 @@ vn_encode_VkMemoryResourcePropertiesMESA(struct vn_cs_encoder *enc, const VkMemo static inline void * vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(struct vn_cs_decoder *dec) { - /* no known/supported struct */ - if (vn_decode_simple_pointer(dec)) + VkBaseOutStructure *pnext; + VkStructureType stype; + + if (!vn_decode_simple_pointer(dec)) + return NULL; + + vn_decode_VkStructureType(dec, &stype); + switch ((int32_t)stype) { + case VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA: + pnext = vn_cs_decoder_alloc_temp(dec, sizeof(VkMemoryResourceAllocationSizeProperties100000MESA)); + if (pnext) { + pnext->sType = stype; + pnext->pNext = vn_decode_VkMemoryResourcePropertiesMESA_pnext_partial_temp(dec); + vn_decode_VkMemoryResourceAllocationSizeProperties100000MESA_self_partial_temp(dec, (VkMemoryResourceAllocationSizeProperties100000MESA *)pnext); + } + break; + default: + /* unexpected struct */ + pnext = NULL; vn_cs_decoder_set_fatal(dec); - return NULL; + break; + } + + return pnext; } static inline void @@ -408,6 +497,45 @@ static inline void vn_encode_vkGetMemoryResourcePropertiesMESA_reply(struct vn_c vn_encode_VkMemoryResourcePropertiesMESA(enc, args->pMemoryResourceProperties); } +static inline void vn_decode_vkGetVenusExperimentalFeatureData100000MESA_args_temp(struct vn_cs_decoder *dec, struct vn_command_vkGetVenusExperimentalFeatureData100000MESA *args) +{ + if (vn_decode_simple_pointer(dec)) { + args->pDataSize = vn_cs_decoder_alloc_temp(dec, sizeof(*args->pDataSize)); + if (!args->pDataSize) return; + vn_decode_size_t(dec, args->pDataSize); + } else { + args->pDataSize = NULL; + } + if (vn_peek_array_size(dec)) { + const size_t array_size = vn_decode_array_size(dec, *args->pDataSize); + args->pData = vn_cs_decoder_alloc_temp(dec, array_size); + if (!args->pData) return; + } else { + vn_decode_array_size(dec, 0); + args->pData = NULL; + } +} + +static inline void vn_replace_vkGetVenusExperimentalFeatureData100000MESA_args_handle(struct vn_command_vkGetVenusExperimentalFeatureData100000MESA *args) +{ + /* skip args->pDataSize */ + /* skip args->pData */ +} + +static inline void vn_encode_vkGetVenusExperimentalFeatureData100000MESA_reply(struct vn_cs_encoder *enc, const struct vn_command_vkGetVenusExperimentalFeatureData100000MESA *args) +{ + vn_encode_VkCommandTypeEXT(enc, &(VkCommandTypeEXT){VK_COMMAND_TYPE_vkGetVenusExperimentalFeatureData100000MESA_EXT}); + + if (vn_encode_simple_pointer(enc, args->pDataSize)) + vn_encode_size_t(enc, args->pDataSize); + if (args->pData) { + vn_encode_array_size(enc, *args->pDataSize); + vn_encode_blob_array(enc, args->pData, *args->pDataSize); + } else { + vn_encode_array_size(enc, 0); + } +} + static inline void vn_dispatch_vkSetReplyCommandStreamMESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) { struct vn_command_vkSetReplyCommandStreamMESA args; @@ -585,4 +713,25 @@ static inline void vn_dispatch_vkGetMemoryResourcePropertiesMESA(struct vn_dispa vn_cs_decoder_reset_temp_pool(ctx->decoder); } +static inline void vn_dispatch_vkGetVenusExperimentalFeatureData100000MESA(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) +{ + struct vn_command_vkGetVenusExperimentalFeatureData100000MESA args; + + if (!ctx->dispatch_vkGetVenusExperimentalFeatureData100000MESA) { + vn_cs_decoder_set_fatal(ctx->decoder); + return; + } + + vn_decode_vkGetVenusExperimentalFeatureData100000MESA_args_temp(ctx->decoder, &args); + + if (!vn_cs_decoder_get_fatal(ctx->decoder)) + ctx->dispatch_vkGetVenusExperimentalFeatureData100000MESA(ctx, &args); + + + if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) + vn_encode_vkGetVenusExperimentalFeatureData100000MESA_reply(ctx->encoder, &args); + + vn_cs_decoder_reset_temp_pool(ctx->decoder); +} + #endif /* VN_PROTOCOL_RENDERER_TRANSPORT_H */