From fdb86bdacbeb252007d3aa0146ec5a9b9ce9e4f0 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Thu, 6 Apr 2023 14:50:51 -0700 Subject: Remove "with_logger" decodes ... to simplify codegen to avoid having various decodes for things that can just be found inside the VkDecoderContext. Bug: b/165022040 Test: ./scripts/generate-vulkan-sources.sh && m Change-Id: I2edbe32a88a00481dc66c977adabe6d0b4c2e7e7 --- registry/vulkan/scripts/cereal/decoder.py | 19 +++++++------------ registry/vulkan/scripts/cereal/subdecode.py | 17 +++++------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/registry/vulkan/scripts/cereal/decoder.py b/registry/vulkan/scripts/cereal/decoder.py index 7131cf51..e082db0c 100644 --- a/registry/vulkan/scripts/cereal/decoder.py +++ b/registry/vulkan/scripts/cereal/decoder.py @@ -337,14 +337,12 @@ def emit_dispatch_call(api, cgen): if delay: cgen.line("};") -def emit_global_state_wrapped_call(api, cgen, logger, context): +def emit_global_state_wrapped_call(api, cgen, context): if api.name in DELAYED_DECODER_DELETES: print("Error: Cannot generate a global state wrapped call that is also a delayed delete (yet)"); raise customParams = ["&m_pool"] + list(map(lambda p: p.paramName, api.parameters)) - if logger: - customParams += ["gfx_logger"] if context: customParams += ["context"] cgen.vkApiCall(api, customPrefix=global_state_prefix, \ @@ -479,7 +477,7 @@ def emit_snapshot(typeInfo, api, cgen): cgen.vkApiCall(apiForSnapshot, customPrefix="m_state->snapshot()->") cgen.endIf() -def emit_decoding(typeInfo, api, cgen, globalWrapped=False, logger=False, context=False): +def emit_decoding(typeInfo, api, cgen, globalWrapped=False, context=False): isAcquire = api.name in RELAXED_APIS emit_decode_parameters(typeInfo, api, cgen, globalWrapped) @@ -487,7 +485,7 @@ def emit_decoding(typeInfo, api, cgen, globalWrapped=False, logger=False, contex emit_seqno_incr(api, cgen) if globalWrapped: - emit_global_state_wrapped_call(api, cgen, logger, context) + emit_global_state_wrapped_call(api, cgen, context) else: emit_dispatch_call(api, cgen) @@ -507,9 +505,6 @@ def emit_default_decoding(typeInfo, api, cgen): def emit_global_state_wrapped_decoding(typeInfo, api, cgen): emit_decoding(typeInfo, api, cgen, globalWrapped=True) -def emit_global_state_wrapped_decoding_with_logger(typeInfo, api, cgen): - emit_decoding(typeInfo, api, cgen, globalWrapped=True, logger=True) - def emit_global_state_wrapped_decoding_with_context(typeInfo, api, cgen): emit_decoding(typeInfo, api, cgen, globalWrapped=True, context=True) @@ -663,8 +658,8 @@ custom_decodes = { "vkCmdExecuteCommands" : emit_global_state_wrapped_decoding, "vkQueueSubmit" : emit_global_state_wrapped_decoding, "vkQueueWaitIdle" : emit_global_state_wrapped_decoding, - "vkBeginCommandBuffer" : emit_global_state_wrapped_decoding_with_logger, - "vkEndCommandBuffer" : emit_global_state_wrapped_decoding_with_logger, + "vkBeginCommandBuffer" : emit_global_state_wrapped_decoding_with_context, + "vkEndCommandBuffer" : emit_global_state_wrapped_decoding_with_context, "vkResetCommandBuffer" : emit_global_state_wrapped_decoding, "vkFreeCommandBuffers" : emit_global_state_wrapped_decoding, "vkCreateCommandPool" : emit_global_state_wrapped_decoding, @@ -713,8 +708,8 @@ custom_decodes = { "vkUpdateDescriptorSetWithTemplateSizedGOOGLE" : emit_global_state_wrapped_decoding, # VK_GOOGLE_gfxstream - "vkBeginCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding_with_logger, - "vkEndCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding_with_logger, + "vkBeginCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding_with_context, + "vkEndCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding_with_context, "vkResetCommandBufferAsyncGOOGLE" : emit_global_state_wrapped_decoding, "vkCommandBufferHostSyncGOOGLE" : emit_global_state_wrapped_decoding, "vkCreateImageWithRequirementsGOOGLE" : emit_global_state_wrapped_decoding, diff --git a/registry/vulkan/scripts/cereal/subdecode.py b/registry/vulkan/scripts/cereal/subdecode.py index a81f7228..b77cad77 100644 --- a/registry/vulkan/scripts/cereal/subdecode.py +++ b/registry/vulkan/scripts/cereal/subdecode.py @@ -261,11 +261,9 @@ def emit_dispatch_call(api, cgen): cgen.stmt("unlock()") -def emit_global_state_wrapped_call(api, cgen, logger=False, context=False): +def emit_global_state_wrapped_call(api, cgen, context=False): customParams = ["pool", "(VkCommandBuffer)(boxed_dispatchHandle)"] + \ list(map(lambda p: p.paramName, api.parameters[1:])) - if logger: - customParams += ["gfx_logger"]; if context: customParams += ["context"]; cgen.vkApiCall(api, customPrefix=global_state_prefix, @@ -282,10 +280,6 @@ def emit_global_state_wrapped_decoding(typeInfo, api, cgen): emit_decode_parameters(typeInfo, api, cgen, globalWrapped=True) emit_global_state_wrapped_call(api, cgen) -def emit_global_state_wrapped_decoding_with_logger(typeInfo, api, cgen): - emit_decode_parameters(typeInfo, api, cgen, globalWrapped=True) - emit_global_state_wrapped_call(api, cgen, logger=True) - def emit_global_state_wrapped_decoding_with_context(typeInfo, api, cgen): emit_decode_parameters(typeInfo, api, cgen, globalWrapped=True) emit_global_state_wrapped_call(api, cgen, context=True) @@ -295,15 +289,15 @@ custom_decodes = { "vkCmdCopyImage": emit_global_state_wrapped_decoding, "vkCmdCopyImageToBuffer": emit_global_state_wrapped_decoding, "vkCmdExecuteCommands": emit_global_state_wrapped_decoding, - "vkBeginCommandBuffer": emit_global_state_wrapped_decoding_with_logger, - "vkEndCommandBuffer": emit_global_state_wrapped_decoding_with_logger, + "vkBeginCommandBuffer": emit_global_state_wrapped_decoding_with_context, + "vkEndCommandBuffer": emit_global_state_wrapped_decoding_with_context, "vkResetCommandBuffer": emit_global_state_wrapped_decoding, "vkCmdPipelineBarrier": emit_global_state_wrapped_decoding, "vkCmdBindPipeline": emit_global_state_wrapped_decoding, "vkCmdBindDescriptorSets": emit_global_state_wrapped_decoding, "vkCmdCopyQueryPoolResults": emit_global_state_wrapped_decoding, - "vkBeginCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding_with_logger, - "vkEndCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding_with_logger, + "vkBeginCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding_with_context, + "vkEndCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding_with_context, "vkResetCommandBufferAsyncGOOGLE": emit_global_state_wrapped_decoding, "vkCommandBufferHostSyncGOOGLE": emit_global_state_wrapped_decoding, } @@ -327,7 +321,6 @@ class VulkanSubDecoder(VulkanWrapperGenerator): self.cgen.beginBlock() # function body - self.cgen.stmt("auto& gfx_logger = *context.gfxApiLogger") self.cgen.stmt("auto& metricsLogger = *context.metricsLogger") self.cgen.stmt("uint32_t count = 0") self.cgen.stmt("unsigned char *buf = (unsigned char *)pData") -- cgit v1.2.3