From 9f6329a0b0a0fa3d48690c0118e16b272cc742b4 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 21 Jul 2021 11:30:07 -0700 Subject: [PATCH] vkr: log VkResult errors on debug builds only VkResult errors are regular runtime errors. The logging is for debug only. Add vn_dispatch_should_log_result to decide whether a VkResult error should be logged. It will greatly reduce the diff size in the future. Silence VK_ERROR_FRAGMENTED_POOL and VK_ERROR_OUT_OF_POOL_MEMORY. Signed-off-by: Chia-I Wu Reviewed-by: Yiwei Zhang --- src/venus-protocol/vn_protocol_renderer.h | 2 +- .../vn_protocol_renderer_buffer.h | 39 ++----- .../vn_protocol_renderer_buffer_view.h | 13 +-- .../vn_protocol_renderer_command_buffer.h | 52 +++------ .../vn_protocol_renderer_command_pool.h | 26 ++--- .../vn_protocol_renderer_defines.h | 14 +++ .../vn_protocol_renderer_descriptor_pool.h | 26 ++--- .../vn_protocol_renderer_descriptor_set.h | 26 ++--- ..._protocol_renderer_descriptor_set_layout.h | 13 +-- ...ocol_renderer_descriptor_update_template.h | 13 +-- .../vn_protocol_renderer_device.h | 104 ++++++------------ .../vn_protocol_renderer_device_memory.h | 39 ++----- .../vn_protocol_renderer_event.h | 52 +++------ .../vn_protocol_renderer_fence.h | 52 +++------ .../vn_protocol_renderer_framebuffer.h | 13 +-- .../vn_protocol_renderer_image.h | 52 +++------ .../vn_protocol_renderer_image_view.h | 13 +-- .../vn_protocol_renderer_instance.h | 52 +++------ .../vn_protocol_renderer_pipeline.h | 26 ++--- .../vn_protocol_renderer_pipeline_cache.h | 39 ++----- .../vn_protocol_renderer_pipeline_layout.h | 13 +-- .../vn_protocol_renderer_query_pool.h | 26 ++--- .../vn_protocol_renderer_queue.h | 39 ++----- .../vn_protocol_renderer_render_pass.h | 26 ++--- .../vn_protocol_renderer_sampler.h | 13 +-- ...otocol_renderer_sampler_ycbcr_conversion.h | 13 +-- .../vn_protocol_renderer_semaphore.h | 52 +++------ .../vn_protocol_renderer_shader_module.h | 13 +-- .../vn_protocol_renderer_transport.h | 13 +-- 29 files changed, 279 insertions(+), 595 deletions(-) diff --git a/src/venus-protocol/vn_protocol_renderer.h b/src/venus-protocol/vn_protocol_renderer.h index f188189..c3f4e22 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-b45cfda5. */ +/* This file is generated by venus-protocol git-086a2445. */ /* * Copyright 2020 Google LLC diff --git a/src/venus-protocol/vn_protocol_renderer_buffer.h b/src/venus-protocol/vn_protocol_renderer_buffer.h index 251ed0e..e68a500 100644 --- a/src/venus-protocol/vn_protocol_renderer_buffer.h +++ b/src/venus-protocol/vn_protocol_renderer_buffer.h @@ -892,15 +892,10 @@ static inline void vn_dispatch_vkBindBufferMemory(struct vn_dispatch_context *ct if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkBindBufferMemory(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkBindBufferMemory returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkBindBufferMemory returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkBindBufferMemory_reply(ctx->encoder, &args); @@ -926,15 +921,10 @@ static inline void vn_dispatch_vkCreateBuffer(struct vn_dispatch_context *ctx, V if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateBuffer(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateBuffer returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateBuffer returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateBuffer_reply(ctx->encoder, &args); @@ -985,15 +975,10 @@ static inline void vn_dispatch_vkBindBufferMemory2(struct vn_dispatch_context *c if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkBindBufferMemory2(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkBindBufferMemory2 returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkBindBufferMemory2 returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkBindBufferMemory2_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_buffer_view.h b/src/venus-protocol/vn_protocol_renderer_buffer_view.h index cf10395..7bfadfc 100644 --- a/src/venus-protocol/vn_protocol_renderer_buffer_view.h +++ b/src/venus-protocol/vn_protocol_renderer_buffer_view.h @@ -165,15 +165,10 @@ static inline void vn_dispatch_vkCreateBufferView(struct vn_dispatch_context *ct if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateBufferView(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateBufferView returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateBufferView returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateBufferView_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_command_buffer.h b/src/venus-protocol/vn_protocol_renderer_command_buffer.h index 3d6f79d..da5f4e0 100644 --- a/src/venus-protocol/vn_protocol_renderer_command_buffer.h +++ b/src/venus-protocol/vn_protocol_renderer_command_buffer.h @@ -3378,15 +3378,10 @@ static inline void vn_dispatch_vkAllocateCommandBuffers(struct vn_dispatch_conte if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkAllocateCommandBuffers(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkAllocateCommandBuffers returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkAllocateCommandBuffers returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkAllocateCommandBuffers_reply(ctx->encoder, &args); @@ -3437,15 +3432,10 @@ static inline void vn_dispatch_vkBeginCommandBuffer(struct vn_dispatch_context * if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkBeginCommandBuffer(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkBeginCommandBuffer returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkBeginCommandBuffer returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkBeginCommandBuffer_reply(ctx->encoder, &args); @@ -3471,15 +3461,10 @@ static inline void vn_dispatch_vkEndCommandBuffer(struct vn_dispatch_context *ct if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEndCommandBuffer(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEndCommandBuffer returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEndCommandBuffer returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEndCommandBuffer_reply(ctx->encoder, &args); @@ -3505,15 +3490,10 @@ static inline void vn_dispatch_vkResetCommandBuffer(struct vn_dispatch_context * if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkResetCommandBuffer(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkResetCommandBuffer returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkResetCommandBuffer returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkResetCommandBuffer_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_command_pool.h b/src/venus-protocol/vn_protocol_renderer_command_pool.h index 10b1229..fbec810 100644 --- a/src/venus-protocol/vn_protocol_renderer_command_pool.h +++ b/src/venus-protocol/vn_protocol_renderer_command_pool.h @@ -206,15 +206,10 @@ static inline void vn_dispatch_vkCreateCommandPool(struct vn_dispatch_context *c if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateCommandPool(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateCommandPool returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateCommandPool returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateCommandPool_reply(ctx->encoder, &args); @@ -265,15 +260,10 @@ static inline void vn_dispatch_vkResetCommandPool(struct vn_dispatch_context *ct if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkResetCommandPool(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkResetCommandPool returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkResetCommandPool returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkResetCommandPool_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_defines.h b/src/venus-protocol/vn_protocol_renderer_defines.h index 5fae4ea..cd0a912 100644 --- a/src/venus-protocol/vn_protocol_renderer_defines.h +++ b/src/venus-protocol/vn_protocol_renderer_defines.h @@ -2002,4 +2002,18 @@ static inline void vn_dispatch_debug_log(struct vn_dispatch_context *ctx, const va_end(va); } +static inline bool vn_dispatch_should_log_result(VkResult result) +{ + switch (result) { + case VK_ERROR_FORMAT_NOT_SUPPORTED: + case VK_ERROR_FRAGMENTED_POOL: + case VK_ERROR_OUT_OF_POOL_MEMORY: + /* do not log errors that apps normally handle properly */ + return false; + default: + /* log all other errors */ + return result < VK_SUCCESS; + } +} + #endif /* VN_PROTOCOL_RENDERER_DEFINES_H */ diff --git a/src/venus-protocol/vn_protocol_renderer_descriptor_pool.h b/src/venus-protocol/vn_protocol_renderer_descriptor_pool.h index 1b141fa..6a0b1c4 100644 --- a/src/venus-protocol/vn_protocol_renderer_descriptor_pool.h +++ b/src/venus-protocol/vn_protocol_renderer_descriptor_pool.h @@ -215,15 +215,10 @@ static inline void vn_dispatch_vkCreateDescriptorPool(struct vn_dispatch_context if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateDescriptorPool(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateDescriptorPool returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateDescriptorPool returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateDescriptorPool_reply(ctx->encoder, &args); @@ -274,15 +269,10 @@ static inline void vn_dispatch_vkResetDescriptorPool(struct vn_dispatch_context if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkResetDescriptorPool(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkResetDescriptorPool returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkResetDescriptorPool returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkResetDescriptorPool_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_descriptor_set.h b/src/venus-protocol/vn_protocol_renderer_descriptor_set.h index a207fec..559e963 100644 --- a/src/venus-protocol/vn_protocol_renderer_descriptor_set.h +++ b/src/venus-protocol/vn_protocol_renderer_descriptor_set.h @@ -547,15 +547,10 @@ static inline void vn_dispatch_vkAllocateDescriptorSets(struct vn_dispatch_conte if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkAllocateDescriptorSets(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkAllocateDescriptorSets returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkAllocateDescriptorSets returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkAllocateDescriptorSets_reply(ctx->encoder, &args); @@ -581,15 +576,10 @@ static inline void vn_dispatch_vkFreeDescriptorSets(struct vn_dispatch_context * if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkFreeDescriptorSets(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkFreeDescriptorSets returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkFreeDescriptorSets returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkFreeDescriptorSets_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_descriptor_set_layout.h b/src/venus-protocol/vn_protocol_renderer_descriptor_set_layout.h index aa7505c..5312766 100644 --- a/src/venus-protocol/vn_protocol_renderer_descriptor_set_layout.h +++ b/src/venus-protocol/vn_protocol_renderer_descriptor_set_layout.h @@ -479,15 +479,10 @@ static inline void vn_dispatch_vkCreateDescriptorSetLayout(struct vn_dispatch_co if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateDescriptorSetLayout(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateDescriptorSetLayout returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateDescriptorSetLayout returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateDescriptorSetLayout_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_descriptor_update_template.h b/src/venus-protocol/vn_protocol_renderer_descriptor_update_template.h index 23d95a6..ff2f693 100644 --- a/src/venus-protocol/vn_protocol_renderer_descriptor_update_template.h +++ b/src/venus-protocol/vn_protocol_renderer_descriptor_update_template.h @@ -207,15 +207,10 @@ static inline void vn_dispatch_vkCreateDescriptorUpdateTemplate(struct vn_dispat if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateDescriptorUpdateTemplate(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateDescriptorUpdateTemplate returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateDescriptorUpdateTemplate returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateDescriptorUpdateTemplate_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_device.h b/src/venus-protocol/vn_protocol_renderer_device.h index 1f0d295..c0813f8 100644 --- a/src/venus-protocol/vn_protocol_renderer_device.h +++ b/src/venus-protocol/vn_protocol_renderer_device.h @@ -8439,15 +8439,10 @@ static inline void vn_dispatch_vkEnumeratePhysicalDevices(struct vn_dispatch_con if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEnumeratePhysicalDevices(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEnumeratePhysicalDevices returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEnumeratePhysicalDevices returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEnumeratePhysicalDevices_reply(ctx->encoder, &args); @@ -8598,15 +8593,10 @@ static inline void vn_dispatch_vkGetPhysicalDeviceImageFormatProperties(struct v if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetPhysicalDeviceImageFormatProperties(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetPhysicalDeviceImageFormatProperties returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetPhysicalDeviceImageFormatProperties returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetPhysicalDeviceImageFormatProperties_reply(ctx->encoder, &args); @@ -8632,15 +8622,10 @@ static inline void vn_dispatch_vkCreateDevice(struct vn_dispatch_context *ctx, V if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateDevice(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateDevice returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateDevice returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateDevice_reply(ctx->encoder, &args); @@ -8691,15 +8676,10 @@ static inline void vn_dispatch_vkEnumerateDeviceLayerProperties(struct vn_dispat if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEnumerateDeviceLayerProperties(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEnumerateDeviceLayerProperties returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEnumerateDeviceLayerProperties returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEnumerateDeviceLayerProperties_reply(ctx->encoder, &args); @@ -8725,15 +8705,10 @@ static inline void vn_dispatch_vkEnumerateDeviceExtensionProperties(struct vn_di if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEnumerateDeviceExtensionProperties(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEnumerateDeviceExtensionProperties returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEnumerateDeviceExtensionProperties returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEnumerateDeviceExtensionProperties_reply(ctx->encoder, &args); @@ -8784,15 +8759,10 @@ static inline void vn_dispatch_vkDeviceWaitIdle(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkDeviceWaitIdle(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkDeviceWaitIdle returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkDeviceWaitIdle returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkDeviceWaitIdle_reply(ctx->encoder, &args); @@ -8918,15 +8888,10 @@ static inline void vn_dispatch_vkGetPhysicalDeviceImageFormatProperties2(struct if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetPhysicalDeviceImageFormatProperties2(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetPhysicalDeviceImageFormatProperties2 returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetPhysicalDeviceImageFormatProperties2 returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetPhysicalDeviceImageFormatProperties2_reply(ctx->encoder, &args); @@ -9102,15 +9067,10 @@ static inline void vn_dispatch_vkEnumeratePhysicalDeviceGroups(struct vn_dispatc if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEnumeratePhysicalDeviceGroups(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEnumeratePhysicalDeviceGroups returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEnumeratePhysicalDeviceGroups returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEnumeratePhysicalDeviceGroups_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_device_memory.h b/src/venus-protocol/vn_protocol_renderer_device_memory.h index a6831a0..c62f75f 100644 --- a/src/venus-protocol/vn_protocol_renderer_device_memory.h +++ b/src/venus-protocol/vn_protocol_renderer_device_memory.h @@ -839,15 +839,10 @@ static inline void vn_dispatch_vkAllocateMemory(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkAllocateMemory(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkAllocateMemory returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkAllocateMemory returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkAllocateMemory_reply(ctx->encoder, &args); @@ -923,15 +918,10 @@ static inline void vn_dispatch_vkFlushMappedMemoryRanges(struct vn_dispatch_cont if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkFlushMappedMemoryRanges(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkFlushMappedMemoryRanges returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkFlushMappedMemoryRanges returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkFlushMappedMemoryRanges_reply(ctx->encoder, &args); @@ -957,15 +947,10 @@ static inline void vn_dispatch_vkInvalidateMappedMemoryRanges(struct vn_dispatch if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkInvalidateMappedMemoryRanges(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkInvalidateMappedMemoryRanges returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkInvalidateMappedMemoryRanges returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkInvalidateMappedMemoryRanges_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_event.h b/src/venus-protocol/vn_protocol_renderer_event.h index 7f6a105..de2366b 100644 --- a/src/venus-protocol/vn_protocol_renderer_event.h +++ b/src/venus-protocol/vn_protocol_renderer_event.h @@ -220,15 +220,10 @@ static inline void vn_dispatch_vkCreateEvent(struct vn_dispatch_context *ctx, Vk if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateEvent(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateEvent returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateEvent returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateEvent_reply(ctx->encoder, &args); @@ -279,15 +274,10 @@ static inline void vn_dispatch_vkGetEventStatus(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetEventStatus(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetEventStatus returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetEventStatus returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetEventStatus_reply(ctx->encoder, &args); @@ -313,15 +303,10 @@ static inline void vn_dispatch_vkSetEvent(struct vn_dispatch_context *ctx, VkCom if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkSetEvent(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkSetEvent returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkSetEvent returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkSetEvent_reply(ctx->encoder, &args); @@ -347,15 +332,10 @@ static inline void vn_dispatch_vkResetEvent(struct vn_dispatch_context *ctx, VkC if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkResetEvent(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkResetEvent returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkResetEvent returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkResetEvent_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_fence.h b/src/venus-protocol/vn_protocol_renderer_fence.h index ef1e8f7..fb25dfb 100644 --- a/src/venus-protocol/vn_protocol_renderer_fence.h +++ b/src/venus-protocol/vn_protocol_renderer_fence.h @@ -336,15 +336,10 @@ static inline void vn_dispatch_vkCreateFence(struct vn_dispatch_context *ctx, Vk if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateFence(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateFence returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateFence returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateFence_reply(ctx->encoder, &args); @@ -395,15 +390,10 @@ static inline void vn_dispatch_vkResetFences(struct vn_dispatch_context *ctx, Vk if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkResetFences(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkResetFences returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkResetFences returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkResetFences_reply(ctx->encoder, &args); @@ -429,15 +419,10 @@ static inline void vn_dispatch_vkGetFenceStatus(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetFenceStatus(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetFenceStatus returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetFenceStatus returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetFenceStatus_reply(ctx->encoder, &args); @@ -463,15 +448,10 @@ static inline void vn_dispatch_vkWaitForFences(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkWaitForFences(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkWaitForFences returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkWaitForFences returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkWaitForFences_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_framebuffer.h b/src/venus-protocol/vn_protocol_renderer_framebuffer.h index 0407932..2f3321d 100644 --- a/src/venus-protocol/vn_protocol_renderer_framebuffer.h +++ b/src/venus-protocol/vn_protocol_renderer_framebuffer.h @@ -352,15 +352,10 @@ static inline void vn_dispatch_vkCreateFramebuffer(struct vn_dispatch_context *c if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateFramebuffer(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateFramebuffer returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateFramebuffer returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateFramebuffer_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_image.h b/src/venus-protocol/vn_protocol_renderer_image.h index 7338b39..1b6bb03 100644 --- a/src/venus-protocol/vn_protocol_renderer_image.h +++ b/src/venus-protocol/vn_protocol_renderer_image.h @@ -1490,15 +1490,10 @@ static inline void vn_dispatch_vkBindImageMemory(struct vn_dispatch_context *ctx if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkBindImageMemory(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkBindImageMemory returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkBindImageMemory returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkBindImageMemory_reply(ctx->encoder, &args); @@ -1549,15 +1544,10 @@ static inline void vn_dispatch_vkCreateImage(struct vn_dispatch_context *ctx, Vk if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateImage(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateImage returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateImage returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateImage_reply(ctx->encoder, &args); @@ -1633,15 +1623,10 @@ static inline void vn_dispatch_vkBindImageMemory2(struct vn_dispatch_context *ct if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkBindImageMemory2(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkBindImageMemory2 returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkBindImageMemory2 returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkBindImageMemory2_reply(ctx->encoder, &args); @@ -1717,15 +1702,10 @@ static inline void vn_dispatch_vkGetImageDrmFormatModifierPropertiesEXT(struct v if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetImageDrmFormatModifierPropertiesEXT(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetImageDrmFormatModifierPropertiesEXT returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetImageDrmFormatModifierPropertiesEXT returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetImageDrmFormatModifierPropertiesEXT_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_image_view.h b/src/venus-protocol/vn_protocol_renderer_image_view.h index a7fb710..7aa6be5 100644 --- a/src/venus-protocol/vn_protocol_renderer_image_view.h +++ b/src/venus-protocol/vn_protocol_renderer_image_view.h @@ -258,15 +258,10 @@ static inline void vn_dispatch_vkCreateImageView(struct vn_dispatch_context *ctx if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateImageView(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateImageView returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateImageView returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateImageView_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_instance.h b/src/venus-protocol/vn_protocol_renderer_instance.h index 1d0ed4a..fb50b81 100644 --- a/src/venus-protocol/vn_protocol_renderer_instance.h +++ b/src/venus-protocol/vn_protocol_renderer_instance.h @@ -398,15 +398,10 @@ static inline void vn_dispatch_vkCreateInstance(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateInstance(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateInstance returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateInstance returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateInstance_reply(ctx->encoder, &args); @@ -453,15 +448,10 @@ static inline void vn_dispatch_vkEnumerateInstanceVersion(struct vn_dispatch_con if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEnumerateInstanceVersion(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEnumerateInstanceVersion returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEnumerateInstanceVersion returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEnumerateInstanceVersion_reply(ctx->encoder, &args); @@ -483,15 +473,10 @@ static inline void vn_dispatch_vkEnumerateInstanceLayerProperties(struct vn_disp if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEnumerateInstanceLayerProperties(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEnumerateInstanceLayerProperties returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEnumerateInstanceLayerProperties returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEnumerateInstanceLayerProperties_reply(ctx->encoder, &args); @@ -513,15 +498,10 @@ static inline void vn_dispatch_vkEnumerateInstanceExtensionProperties(struct vn_ if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkEnumerateInstanceExtensionProperties(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkEnumerateInstanceExtensionProperties returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkEnumerateInstanceExtensionProperties returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkEnumerateInstanceExtensionProperties_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_pipeline.h b/src/venus-protocol/vn_protocol_renderer_pipeline.h index 479e847..c965957 100644 --- a/src/venus-protocol/vn_protocol_renderer_pipeline.h +++ b/src/venus-protocol/vn_protocol_renderer_pipeline.h @@ -1482,15 +1482,10 @@ static inline void vn_dispatch_vkCreateGraphicsPipelines(struct vn_dispatch_cont if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateGraphicsPipelines(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateGraphicsPipelines returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateGraphicsPipelines returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateGraphicsPipelines_reply(ctx->encoder, &args); @@ -1516,15 +1511,10 @@ static inline void vn_dispatch_vkCreateComputePipelines(struct vn_dispatch_conte if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateComputePipelines(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateComputePipelines returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateComputePipelines returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateComputePipelines_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_pipeline_cache.h b/src/venus-protocol/vn_protocol_renderer_pipeline_cache.h index 35a04ed..18536ec 100644 --- a/src/venus-protocol/vn_protocol_renderer_pipeline_cache.h +++ b/src/venus-protocol/vn_protocol_renderer_pipeline_cache.h @@ -254,15 +254,10 @@ static inline void vn_dispatch_vkCreatePipelineCache(struct vn_dispatch_context if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreatePipelineCache(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreatePipelineCache returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreatePipelineCache returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreatePipelineCache_reply(ctx->encoder, &args); @@ -313,15 +308,10 @@ static inline void vn_dispatch_vkGetPipelineCacheData(struct vn_dispatch_context if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetPipelineCacheData(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetPipelineCacheData returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetPipelineCacheData returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetPipelineCacheData_reply(ctx->encoder, &args); @@ -347,15 +337,10 @@ static inline void vn_dispatch_vkMergePipelineCaches(struct vn_dispatch_context if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkMergePipelineCaches(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkMergePipelineCaches returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkMergePipelineCaches returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkMergePipelineCaches_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_pipeline_layout.h b/src/venus-protocol/vn_protocol_renderer_pipeline_layout.h index b8a9b9b..0d9734b 100644 --- a/src/venus-protocol/vn_protocol_renderer_pipeline_layout.h +++ b/src/venus-protocol/vn_protocol_renderer_pipeline_layout.h @@ -207,15 +207,10 @@ static inline void vn_dispatch_vkCreatePipelineLayout(struct vn_dispatch_context if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreatePipelineLayout(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreatePipelineLayout returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreatePipelineLayout returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreatePipelineLayout_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_query_pool.h b/src/venus-protocol/vn_protocol_renderer_query_pool.h index 9943081..82c55f9 100644 --- a/src/venus-protocol/vn_protocol_renderer_query_pool.h +++ b/src/venus-protocol/vn_protocol_renderer_query_pool.h @@ -240,15 +240,10 @@ static inline void vn_dispatch_vkCreateQueryPool(struct vn_dispatch_context *ctx if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateQueryPool(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateQueryPool returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateQueryPool returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateQueryPool_reply(ctx->encoder, &args); @@ -299,15 +294,10 @@ static inline void vn_dispatch_vkGetQueryPoolResults(struct vn_dispatch_context if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetQueryPoolResults(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetQueryPoolResults returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetQueryPoolResults returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetQueryPoolResults_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_queue.h b/src/venus-protocol/vn_protocol_renderer_queue.h index 56cb9e0..47bd0d4 100644 --- a/src/venus-protocol/vn_protocol_renderer_queue.h +++ b/src/venus-protocol/vn_protocol_renderer_queue.h @@ -874,15 +874,10 @@ static inline void vn_dispatch_vkQueueSubmit(struct vn_dispatch_context *ctx, Vk if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkQueueSubmit(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkQueueSubmit returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkQueueSubmit returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkQueueSubmit_reply(ctx->encoder, &args); @@ -908,15 +903,10 @@ static inline void vn_dispatch_vkQueueWaitIdle(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkQueueWaitIdle(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkQueueWaitIdle returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkQueueWaitIdle returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkQueueWaitIdle_reply(ctx->encoder, &args); @@ -942,15 +932,10 @@ static inline void vn_dispatch_vkQueueBindSparse(struct vn_dispatch_context *ctx if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkQueueBindSparse(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkQueueBindSparse returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkQueueBindSparse returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkQueueBindSparse_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_render_pass.h b/src/venus-protocol/vn_protocol_renderer_render_pass.h index 402f9de..efb00a5 100644 --- a/src/venus-protocol/vn_protocol_renderer_render_pass.h +++ b/src/venus-protocol/vn_protocol_renderer_render_pass.h @@ -1352,15 +1352,10 @@ static inline void vn_dispatch_vkCreateRenderPass(struct vn_dispatch_context *ct if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateRenderPass(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateRenderPass returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateRenderPass returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateRenderPass_reply(ctx->encoder, &args); @@ -1436,15 +1431,10 @@ static inline void vn_dispatch_vkCreateRenderPass2(struct vn_dispatch_context *c if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateRenderPass2(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateRenderPass2 returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateRenderPass2 returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateRenderPass2_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_sampler.h b/src/venus-protocol/vn_protocol_renderer_sampler.h index 056a50a..2250ead 100644 --- a/src/venus-protocol/vn_protocol_renderer_sampler.h +++ b/src/venus-protocol/vn_protocol_renderer_sampler.h @@ -278,15 +278,10 @@ static inline void vn_dispatch_vkCreateSampler(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateSampler(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateSampler returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateSampler returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateSampler_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_sampler_ycbcr_conversion.h b/src/venus-protocol/vn_protocol_renderer_sampler_ycbcr_conversion.h index 484fd0c..ef406e3 100644 --- a/src/venus-protocol/vn_protocol_renderer_sampler_ycbcr_conversion.h +++ b/src/venus-protocol/vn_protocol_renderer_sampler_ycbcr_conversion.h @@ -171,15 +171,10 @@ static inline void vn_dispatch_vkCreateSamplerYcbcrConversion(struct vn_dispatch if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateSamplerYcbcrConversion(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateSamplerYcbcrConversion returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateSamplerYcbcrConversion returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateSamplerYcbcrConversion_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_semaphore.h b/src/venus-protocol/vn_protocol_renderer_semaphore.h index 07d5458..2c8a87e 100644 --- a/src/venus-protocol/vn_protocol_renderer_semaphore.h +++ b/src/venus-protocol/vn_protocol_renderer_semaphore.h @@ -503,15 +503,10 @@ static inline void vn_dispatch_vkCreateSemaphore(struct vn_dispatch_context *ctx if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateSemaphore(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateSemaphore returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateSemaphore returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateSemaphore_reply(ctx->encoder, &args); @@ -562,15 +557,10 @@ static inline void vn_dispatch_vkGetSemaphoreCounterValue(struct vn_dispatch_con if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetSemaphoreCounterValue(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetSemaphoreCounterValue returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetSemaphoreCounterValue returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetSemaphoreCounterValue_reply(ctx->encoder, &args); @@ -596,15 +586,10 @@ static inline void vn_dispatch_vkWaitSemaphores(struct vn_dispatch_context *ctx, if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkWaitSemaphores(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkWaitSemaphores returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkWaitSemaphores returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkWaitSemaphores_reply(ctx->encoder, &args); @@ -630,15 +615,10 @@ static inline void vn_dispatch_vkSignalSemaphore(struct vn_dispatch_context *ctx if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkSignalSemaphore(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkSignalSemaphore returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkSignalSemaphore returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkSignalSemaphore_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_shader_module.h b/src/venus-protocol/vn_protocol_renderer_shader_module.h index 4a0f569..ec27eec 100644 --- a/src/venus-protocol/vn_protocol_renderer_shader_module.h +++ b/src/venus-protocol/vn_protocol_renderer_shader_module.h @@ -169,15 +169,10 @@ static inline void vn_dispatch_vkCreateShaderModule(struct vn_dispatch_context * if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkCreateShaderModule(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkCreateShaderModule returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkCreateShaderModule returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkCreateShaderModule_reply(ctx->encoder, &args); diff --git a/src/venus-protocol/vn_protocol_renderer_transport.h b/src/venus-protocol/vn_protocol_renderer_transport.h index 7dc0a7e..63e2d14 100644 --- a/src/venus-protocol/vn_protocol_renderer_transport.h +++ b/src/venus-protocol/vn_protocol_renderer_transport.h @@ -704,15 +704,10 @@ static inline void vn_dispatch_vkGetMemoryResourcePropertiesMESA(struct vn_dispa if (!vn_cs_decoder_get_fatal(ctx->decoder)) ctx->dispatch_vkGetMemoryResourcePropertiesMESA(ctx, &args); - if (!vn_cs_decoder_get_fatal(ctx->decoder) && args.ret < VK_SUCCESS) { - switch (args.ret) { - case VK_ERROR_FORMAT_NOT_SUPPORTED: - break; - default: - vn_dispatch_debug_log(ctx, "vkGetMemoryResourcePropertiesMESA returned %d", args.ret); - break; - } - } +#ifdef DEBUG + if (!vn_cs_decoder_get_fatal(ctx->decoder) && vn_dispatch_should_log_result(args.ret)) + vn_dispatch_debug_log(ctx, "vkGetMemoryResourcePropertiesMESA returned %d", args.ret); +#endif if (!vn_cs_decoder_get_fatal(ctx->decoder) && (flags & VK_COMMAND_GENERATE_REPLY_BIT_EXT)) vn_encode_vkGetMemoryResourcePropertiesMESA_reply(ctx->encoder, &args);