Skip to content

Commit

Permalink
Dump all subresources of render target images
Browse files Browse the repository at this point in the history
  • Loading branch information
panos-lunarg committed Aug 28, 2024
1 parent d2196b6 commit 41d8727
Show file tree
Hide file tree
Showing 9 changed files with 1,102 additions and 533 deletions.
10 changes: 10 additions & 0 deletions framework/decode/vulkan_object_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,16 @@ struct RenderPassInfo : public VulkanObjectInfo<VkRenderPass>
std::vector<SubpassReferences> subpass_refs;

std::vector<VkSubpassDependency> dependencies;

// Multiview info
bool has_multiview;

struct
{
std::vector<uint32_t> view_masks;
std::vector<int32_t> view_offsets;
std::vector<uint32_t> correlation_masks;
} multiview;
};

struct DescriptorSetLayoutInfo : public VulkanObjectInfo<VkDescriptorSetLayout>
Expand Down
41 changes: 41 additions & 0 deletions framework/decode/vulkan_replay_consumer_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5157,6 +5157,47 @@ VkResult VulkanReplayConsumerBase::OverrideCreateRenderPass(
render_pass_info->dependencies[i] = create_info->pDependencies[i];
}

// Copy multiview information
const VkBaseInStructure* current = reinterpret_cast<const VkBaseInStructure*>(create_info->pNext);
while (current != nullptr)
{
if (current->sType == VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO)
{
const VkRenderPassMultiviewCreateInfo* mv_ci =
reinterpret_cast<const VkRenderPassMultiviewCreateInfo*>(current);

render_pass_info->has_multiview = true;
if (mv_ci->subpassCount && mv_ci->pViewMasks != nullptr)
{
render_pass_info->multiview.view_masks.resize(mv_ci->subpassCount);
for (uint32_t i = 0; i < mv_ci->subpassCount; ++i)
{
render_pass_info->multiview.view_masks[i] = mv_ci->pViewMasks[i];
}
}

if (mv_ci->dependencyCount && mv_ci->pViewOffsets != nullptr)
{
render_pass_info->multiview.view_offsets.resize(mv_ci->dependencyCount);
for (uint32_t i = 0; i < mv_ci->dependencyCount; ++i)
{
render_pass_info->multiview.view_offsets[i] = mv_ci->pViewOffsets[i];
}
}

if (mv_ci->correlationMaskCount && mv_ci->pCorrelationMasks != nullptr)
{
render_pass_info->multiview.correlation_masks.resize(mv_ci->correlationMaskCount);
for (uint32_t i = 0; i < mv_ci->correlationMaskCount; ++i)
{
render_pass_info->multiview.correlation_masks[i] = mv_ci->pCorrelationMasks[i];
}
}
}

current = current->pNext;
}

return result;
}

Expand Down
2 changes: 0 additions & 2 deletions framework/decode/vulkan_replay_dump_resources_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ VkResult DumpImageToFile(const ImageInfo* image_info,
const uint32_t texel_size = vkuFormatElementSizeWithAspect(image_info->format, aspects[i]);
const uint32_t stride = texel_size * scaled_extent.width;

filename += ImageFileExtension(image_info->format, image_file_format);
if (output_image_format == util::imagewriter::DataFormats::kFormat_ASTC)
{
VKU_FORMAT_INFO format_info = vkuGetFormatInfo(image_info->format);
Expand Down Expand Up @@ -628,7 +627,6 @@ VkResult DumpImageToFile(const ImageInfo* image_info,
const uint32_t texel_size = vkuFormatElementSizeWithAspect(image_info->format, aspect);
const uint32_t stride = texel_size * scaled_extent.width;

filename += ImageFileExtension(image_info->format, image_file_format);
if (output_image_format == util::imagewriter::DataFormats::kFormat_ASTC)
{
VKU_FORMAT_INFO format_info = vkuGetFormatInfo(image_info->format);
Expand Down
820 changes: 546 additions & 274 deletions framework/decode/vulkan_replay_dump_resources_compute_ray_tracing.cpp

Large diffs are not rendered by default.

35 changes: 20 additions & 15 deletions framework/decode/vulkan_replay_dump_resources_compute_ray_tracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ class DispatchTraceRaysDumpingContext
void Release();

private:
std::vector<std::string> GenerateDispatchTraceRaysImageFilename(VkFormat format,
uint32_t levels,
uint32_t layers,
bool is_dispatch,
uint64_t qs_index,
uint64_t bcb_index,
uint64_t cmd_index,
uint32_t desc_set,
uint32_t desc_binding,
uint32_t array_index,
VkShaderStageFlagBits stage,
bool before_cmd,
bool dump_all_subresources) const;
std::string GenerateDispatchTraceRaysImageFilename(VkFormat format,
uint32_t mip,
uint32_t layer,
VkImageAspectFlagBits aspect,
bool is_dispatch,
uint64_t qs_index,
uint64_t bcb_index,
uint64_t cmd_index,
uint32_t desc_set,
uint32_t desc_binding,
uint32_t array_index,
VkShaderStageFlagBits stage,
bool before_cmd) const;

std::string GenerateDispatchTraceRaysBufferFilename(bool is_dispatch,
uint64_t qs_index,
Expand All @@ -143,8 +143,13 @@ class DispatchTraceRaysDumpingContext
VkShaderStageFlagBits stage,
bool before_cmd) const;

std::vector<std::string>
GenerateImageDescriptorFilename(uint64_t bcb_index, uint64_t cmd_index, const ImageInfo* img_info) const;
std::string GenerateImageDescriptorFilename(VkFormat format,
uint32_t mip,
uint32_t layer,
format::HandleId image_id,
VkImageAspectFlagBits aspect,
uint64_t bcb_index,
uint64_t cmd_index) const;

std::string
GenerateBufferDescriptorFilename(uint64_t bcb_index, uint64_t cmd_index, format::HandleId buffer_id) const;
Expand Down
Loading

0 comments on commit 41d8727

Please sign in to comment.