diff --git a/framework/encode/vulkan_state_info.h b/framework/encode/vulkan_state_info.h index 779c6d195b..64ff8cdcdb 100644 --- a/framework/encode/vulkan_state_info.h +++ b/framework/encode/vulkan_state_info.h @@ -141,6 +141,69 @@ enum CommandHandleType : uint32_t NumHandleTypes // THIS MUST BE THE LAST ENUM VALUE ! }; +static const char* CommandHandleTypeToStr(CommandHandleType type) +{ + switch (type) + { + case BufferHandle: + return GFXRECON_STR(BufferHandle); + case BufferViewHandle: + return GFXRECON_STR(BufferViewHandle); + case CommandBufferHandle: + return GFXRECON_STR(CommandBufferHandle); + case DescriptorSetHandle: + return GFXRECON_STR(DescriptorSetHandle); + case EventHandle: + return GFXRECON_STR(EventHandle); + case FramebufferHandle: + return GFXRECON_STR(FramebufferHandle); + case ImageHandle: + return GFXRECON_STR(ImageHandle); + case ImageViewHandle: + return GFXRECON_STR(ImageViewHandle); + case PipelineHandle: + return GFXRECON_STR(PipelineHandle); + case PipelineLayoutHandle: + return GFXRECON_STR(PipelineLayoutHandle); + case QueryPoolHandle: + return GFXRECON_STR(QueryPoolHandle); + case RenderPassHandle: + return GFXRECON_STR(RenderPassHandle); + case SamplerHandle: + return GFXRECON_STR(SamplerHandle); + case AccelerationStructureKHRHandle: + return GFXRECON_STR(AccelerationStructureKHRHandle); + case AccelerationStructureNVHandle: + return GFXRECON_STR(AccelerationStructureNVHandle); + case IndirectCommandsLayoutNVHandle: + return GFXRECON_STR(IndirectCommandsLayoutNVHandle); + case DeferredOperationKHRHandle: + return GFXRECON_STR(DeferredOperationKHRHandle); + case MicromapEXTHandle: + return GFXRECON_STR(MicromapEXTHandle); + case OpticalFlowSessionNVHandle: + return GFXRECON_STR(OpticalFlowSessionNVHandle); + case VideoSessionKHRHandle: + return GFXRECON_STR(VideoSessionKHRHandle); + case VideoSessionParametersKHRHandle: + return GFXRECON_STR(VideoSessionParametersKHRHandle); + case ShaderEXTHandle: + return GFXRECON_STR(ShaderEXTHandle); + case DescriptorSetLayoutHandle: + return GFXRECON_STR(DescriptorSetLayoutHandle); + case DescriptorUpdateTemplateHandle: + return GFXRECON_STR(DescriptorUpdateTemplateHandle); + case IndirectCommandsLayoutEXTHandle: + return GFXRECON_STR(IndirectCommandsLayoutEXTHandle); + case IndirectExecutionSetEXTHandle: + return GFXRECON_STR(IndirectExecutionSetEXTHandle); + default: + return "XXXX"; + } + + return "XXXX"; +} + struct ShaderReflectionDescriptorInfo { ShaderReflectionDescriptorInfo( diff --git a/framework/encode/vulkan_state_writer.cpp b/framework/encode/vulkan_state_writer.cpp index fd2356b9b7..fe625282fe 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_LOG_ERROR("%s command buffer % " PRIu64 " will not be dumped", level_str, wrapper->handle_id); + } } void VulkanStateWriter::WriteDescriptorUpdateCommand(format::HandleId device_id, @@ -4174,6 +4180,10 @@ bool VulkanStateWriter::CheckCommandHandles(const vulkan_wrappers::CommandBuffer { if (!CheckCommandHandle(static_cast(i), id, state_table)) { + GFXRECON_LOG_ERROR("%s(): Object %" PRIu64 " of type %s is invalid", + __func__, + id, + CommandHandleTypeToStr(static_cast(i))); return false; } } @@ -4189,9 +4199,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 +4209,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: