Skip to content

Commit

Permalink
Relax command buffe validity check in vulkan state writer
Browse files Browse the repository at this point in the history
  • Loading branch information
panos-lunarg committed Nov 1, 2024
1 parent 23dbad8 commit 07c875a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions framework/encode/vulkan_state_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm>
#include <array>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -4189,21 +4195,21 @@ 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:
return (state_table.GetDescriptorSetWrapper(handle_id) != nullptr);
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:
Expand Down

0 comments on commit 07c875a

Please sign in to comment.