Skip to content

Commit

Permalink
fixes #1422:gfxrecon-replay to create --screenshot-dir if it doesn't …
Browse files Browse the repository at this point in the history
…exist (#1425)
  • Loading branch information
yaman-lunarg authored Feb 22, 2024
1 parent b78f35e commit 55519c1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions framework/decode/vulkan_replay_consumer_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,25 @@ void VulkanReplayConsumerBase::InitializeScreenshotHandler()

if (!options_.screenshot_dir.empty())
{
if (util::filepath::Exists(options_.screenshot_dir))
{
if (!util::filepath::IsDirectory(options_.screenshot_dir))
{
GFXRECON_WRITE_CONSOLE("Error while creating directory %s: Already exists as file",
options_.screenshot_dir.c_str());
exit(-1);
}
}
else
{
int32_t result = gfxrecon::util::platform::MakeDirectory(options_.screenshot_dir.c_str());
if (result < 0)
{
GFXRECON_WRITE_CONSOLE("Error while creating directory %s: Could not open",
options_.screenshot_dir.c_str());
exit(-1);
}
}
screenshot_file_prefix_ = util::filepath::Join(options_.screenshot_dir, screenshot_file_prefix_);
}

Expand Down

0 comments on commit 55519c1

Please sign in to comment.