From 07c875a541ed706861d55fd1b2eedab8bf876ccc Mon Sep 17 00:00:00 2001 From: Panagiotis Apostolou Date: Fri, 1 Nov 2024 11:21:04 +0200 Subject: [PATCH] Relax command buffe validity check in vulkan state writer --- framework/encode/vulkan_state_writer.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/framework/encode/vulkan_state_writer.cpp b/framework/encode/vulkan_state_writer.cpp index fd2356b9b7..8b2545cc4e 100644 --- a/framework/encode/vulkan_state_writer.cpp +++ b/framework/encode/vulkan_state_writer.cpp @@ -30,6 +30,7 @@ #include "format/format_util.h" #include "util/logging.h" #include "custom_vulkan_array_size_2d.h" +#include "vulkan/vulkan_core.h" #include #include @@ -3452,6 +3453,11 @@ void VulkanStateWriter::WriteCommandBufferCommands(const vulkan_wrappers::Comman assert(offset == data_size); } + else + { + const char* level_str = wrapper->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY ? "primary" : "secondary"; + GFXRECON_WRITE_CONSOLE("%s command buffer % " PRIu64 " will not be dumped", level_str, wrapper->handle_id); + } } void VulkanStateWriter::WriteDescriptorUpdateCommand(format::HandleId device_id, @@ -4189,9 +4195,9 @@ bool VulkanStateWriter::CheckCommandHandle(vulkan_state_info::CommandHandleType switch (handle_type) { case vulkan_state_info::CommandHandleType::BufferHandle: - return IsBufferValid(handle_id, state_table); + return (state_table.GetBufferWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::BufferViewHandle: - return IsBufferViewValid(handle_id, state_table); + return (state_table.GetBufferViewWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::CommandBufferHandle: return (state_table.GetCommandBufferWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::DescriptorSetHandle: @@ -4199,11 +4205,11 @@ bool VulkanStateWriter::CheckCommandHandle(vulkan_state_info::CommandHandleType case vulkan_state_info::CommandHandleType::EventHandle: return (state_table.GetEventWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::FramebufferHandle: - return IsFramebufferValid(handle_id, state_table); + return (state_table.GetFramebufferWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::ImageHandle: - return IsImageValid(handle_id, state_table); + return (state_table.GetImageWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::ImageViewHandle: - return IsImageViewValid(handle_id, state_table); + return (state_table.GetImageViewWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::PipelineHandle: return (state_table.GetPipelineWrapper(handle_id) != nullptr); case vulkan_state_info::CommandHandleType::PipelineLayoutHandle: