Skip to content

Commit

Permalink
Fix block index calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
panos-lunarg committed Nov 21, 2024
1 parent 3d082df commit 30acee1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions framework/encode/vulkan_capture_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ void VulkanCaptureManager::WriteAssets(util::FileOutputStream* asset_file_stream
format::ThreadId thread_id)
{
assert(state_tracker_ != nullptr);
uint64_t n_blocks = state_tracker_->WriteAssets(
state_tracker_->WriteAssets(
asset_file_stream, asset_file_name, thread_id, [] { return GetUniqueId(); }, GetCompressor());

common_manager_->IncrementBlockIndex(n_blocks);
}

void VulkanCaptureManager::SetLayerFuncs(PFN_vkCreateInstance create_instance, PFN_vkCreateDevice create_device)
Expand Down
12 changes: 6 additions & 6 deletions framework/encode/vulkan_state_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,8 @@ void VulkanStateWriter::WriteDescriptorSetStateWithAssetFile(const VulkanStateTa
WriteExecuteFromFile(asset_file_name_, 1, offset);
}
}

++blocks_written_;
}
}
});
Expand Down Expand Up @@ -2201,8 +2203,6 @@ void VulkanStateWriter::ProcessBufferMemoryWithAssetFile(const vulkan_wrappers::
WriteExecuteFromFile(asset_file_name_, 1, offset);
}

++blocks_written_;

if (!snapshot_entry.need_staging_copy && memory_wrapper->mapped_data == nullptr)
{
device_table->UnmapMemory(device_wrapper->handle, memory_wrapper->handle);
Expand Down Expand Up @@ -2536,10 +2536,9 @@ void VulkanStateWriter::ProcessImageMemoryWithAssetFile(const vulkan_wrappers::D
upload_cmd.level_count = 0;

output_stream_->Write(&upload_cmd, sizeof(upload_cmd));
++blocks_written_;
}
}

++blocks_written_;
}
}
else
Expand Down Expand Up @@ -3779,9 +3778,8 @@ void VulkanStateWriter::WriteFunctionCall(format::ApiCallId call_id,
{
output_stream_->Write(header_pointer, header_size);
output_stream_->Write(data_pointer, data_size);
++blocks_written_;
}

++blocks_written_;
}

// TODO: This is the same code used by CaptureManager to write command data. It could be moved to a format
Expand Down Expand Up @@ -4336,6 +4334,8 @@ void VulkanStateWriter::WriteExecuteFromFile(const std::string& filename, uint32

output_stream_->Write(&execute_from_file, sizeof(execute_from_file));
output_stream_->Write(relative_file.c_str(), filename_length);

blocks_written_ += n_blocks + 1;
}

GFXRECON_END_NAMESPACE(encode)
Expand Down

0 comments on commit 30acee1

Please sign in to comment.