Skip to content

Commit

Permalink
clang-format files changed in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlunarg committed Jan 29, 2025
1 parent 48fc791 commit 451565e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
26 changes: 10 additions & 16 deletions framework/decode/dx12_dump_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,12 @@ enum class Dx12DumpResourceType : uint32_t
};

const uint64_t modifiableTransitionStates =
D3D12_RESOURCE_STATE_RENDER_TARGET |
D3D12_RESOURCE_STATE_DEPTH_WRITE |
D3D12_RESOURCE_STATE_STREAM_OUT |
D3D12_RESOURCE_STATE_COPY_DEST |
D3D12_RESOURCE_STATE_RESOLVE_DEST |
D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE |
D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE |
D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE |
D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE |
D3D12_RESOURCE_STATE_RENDER_TARGET | D3D12_RESOURCE_STATE_DEPTH_WRITE | D3D12_RESOURCE_STATE_STREAM_OUT |
D3D12_RESOURCE_STATE_COPY_DEST | D3D12_RESOURCE_STATE_RESOLVE_DEST |
D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE | D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE |
D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE | D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE |
D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE;


struct CopyResourceData
{
// Allow default constructor, disallow copy constructor.
Expand Down Expand Up @@ -166,9 +160,9 @@ class Dx12DumpResourcesDelegate

virtual void BeginDumpResources(const std::string& dump_resources_output_dir,
const std::string& capture_file_name,
const TrackDumpResources& track_dump_resources) = 0;
virtual void DumpResource(CopyResourceDataPtr resource_data) = 0;
virtual void EndDumpResources() = 0;
const TrackDumpResources& track_dump_resources) = 0;
virtual void DumpResource(CopyResourceDataPtr resource_data) = 0;
virtual void EndDumpResources() = 0;
virtual void WriteSingleData(const std::vector<std::pair<std::string, int32_t>>& json_path,
const std::string& key,
uint64_t value) = 0;
Expand All @@ -181,7 +175,7 @@ class Dx12DumpResourcesDelegate
virtual void WriteNote(const std::vector<std::pair<std::string, int32_t>>& json_path, const std::string& value) = 0;
virtual void WriteRootParameterInfo(const std::vector<std::pair<std::string, int32_t>>& json_path,
uint32_t root_parameter_index,
const TrackRootParameter& root_parameter) = 0;
const TrackRootParameter& root_parameter) = 0;
virtual void WriteNotFoundView(const std::vector<std::pair<std::string, int32_t>>& json_path,
format::HandleId heap_id,
uint32_t heap_index) = 0;
Expand Down Expand Up @@ -405,8 +399,8 @@ class Dx12DumpResources
std::unordered_set<format::HandleId> modifiableResources_;

public:
void ModifiableResourceAdd(format::HandleId resource){modifiableResources_.insert(resource);}
void ModifiableResourceRemove(format::HandleId resource){modifiableResources_.erase(resource);}
void ModifiableResourceAdd(format::HandleId resource) { modifiableResources_.insert(resource); }
void ModifiableResourceRemove(format::HandleId resource) { modifiableResources_.erase(resource); }
};

GFXRECON_END_NAMESPACE(decode)
Expand Down
8 changes: 4 additions & 4 deletions framework/decode/dx12_replay_consumer_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void Dx12ReplayConsumerBase::ApplyBatchedResourceInitInfo(
// 2. One ExecuteCommandLists could work for only one swapchain buffer.
// 3. The current back buffer index has to match the swapchain buffer.
// 4. After ExecuteCommandLists, the current back buffer index has to back init.
// 5. It shouldn't change resource states until all Presnt are done since Present require
// 5. It shouldn't change resource states until all Presnt are done since Present require
// D3D12_RESOURCE_STATE_PRESENT. The before_states supposes to be PRESENT.

// Although it has only one swapchain mostly, it probably has a plural in some cases.
Expand All @@ -404,7 +404,7 @@ void Dx12ReplayConsumerBase::ApplyBatchedResourceInitInfo(
auto swapchain = reinterpret_cast<IDXGISwapChain3*>(swapchain_info->object);
swapchain_infos[swapchain] = swapchain_extra_info;

for (auto &state : resource_info.second->before_states)
for (auto& state : resource_info.second->before_states)
{
if (state.states != D3D12_RESOURCE_STATE_PRESENT)
{
Expand Down Expand Up @@ -4556,7 +4556,7 @@ void Dx12ReplayConsumerBase::PreCall_ID3D12GraphicsCommandList_ResourceBarrier(
}
if (state.transition.StateAfter & modifiableTransitionStates)
{
dump_resources_->ModifiableResourceAdd(barriers[i].Transition->pResource);
dump_resources_->ModifiableResourceAdd(barriers[i].Transition->pResource);
}
else
{
Expand Down Expand Up @@ -4641,7 +4641,7 @@ void Dx12ReplayConsumerBase::PostCall_ID3D12Device_CreateShaderResourceView(
}
else
{
srv_info.desc = *(pDesc->GetMetaStructPointer()->decoded_value);
srv_info.desc = *(pDesc->GetMetaStructPointer()->decoded_value);
srv_info.is_desc_null = false;

if (options_.enable_dump_resources)
Expand Down
6 changes: 4 additions & 2 deletions tools/replay/replay_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const char kOptions[] =
"--dump-resources-dump-depth-attachment,--dump-"
"resources-dump-vertex-index-buffers,--dump-resources-json-output-per-command,--dump-resources-dump-immutable-"
"resources,--dump-resources-dump-all-image-subresources,--dump-resources-dump-raw-images,--dump-resources-dump-"
"separate-alpha,,--dump-resources-modifiable-state-only,--pbi-all,--preload-measurement-range, --add-new-pipeline-caches";
"separate-alpha,,--dump-resources-modifiable-state-only,--pbi-all,--preload-measurement-range, "
"--add-new-pipeline-caches";
const char kArguments[] =
"--log-level,--log-file,--gpu,--gpu-group,--pause-frame,--wsi,--surface-index,-m|--memory-translation,"
"--replace-shaders,--screenshots,--denied-messages,--allowed-messages,--screenshot-format,--"
Expand Down Expand Up @@ -379,7 +380,8 @@ static void PrintUsage(const char* exe_name)
GFXRECON_WRITE_CONSOLE(" \t\tDirectory to write dump resources output files.");
GFXRECON_WRITE_CONSOLE(" \t\tDefault is the current working directory.");
GFXRECON_WRITE_CONSOLE(" --dump-resources-modifiable-state-only");
GFXRECON_WRITE_CONSOLE(" \t\tOnly dump resources that are in a modifiable state set by D3D12 ResourceBarrier")
GFXRECON_WRITE_CONSOLE(
" \t\tOnly dump resources that are in a modifiable state set by D3D12 ResourceBarrier")
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions tools/tool_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ const char kScreenshotFormatPng[] = "png";
const char kDefaultScreenshotDir[] = "/sdcard";
const char kDefaultDumpResourcesDir[] = "/sdcard";
#else
const char kDefaultScreenshotDir[] = "";
const char kDefaultDumpResourcesDir[] = "";
const char kDefaultScreenshotDir[] = "";
const char kDefaultDumpResourcesDir[] = "";
const bool kDefaultDumpResourcesModifiableStateOnly = false;
#endif

Expand Down

0 comments on commit 451565e

Please sign in to comment.