diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-07-28 00:15:32 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-07-28 02:29:24 +0200 |
commit | 3b006f4fe28006d320c60fd2b4393fd3f27eacd7 (patch) | |
tree | e8704a3796e766a764e2643a2621451a8fe4ea49 /src/video_core/renderer_vulkan/pipeline_statistics.h | |
parent | Merge pull request #6748 from lioncash/engine-init (diff) | |
download | yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.gz yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.bz2 yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.lz yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.xz yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.zst yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/pipeline_statistics.h')
-rw-r--r-- | src/video_core/renderer_vulkan/pipeline_statistics.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/pipeline_statistics.h b/src/video_core/renderer_vulkan/pipeline_statistics.h new file mode 100644 index 000000000..b61840107 --- /dev/null +++ b/src/video_core/renderer_vulkan/pipeline_statistics.h @@ -0,0 +1,40 @@ +// Copyright 2021 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <mutex> +#include <vector> + +#include "common/common_types.h" +#include "video_core/vulkan_common/vulkan_wrapper.h" + +namespace Vulkan { + +class Device; + +class PipelineStatistics { +public: + explicit PipelineStatistics(const Device& device_); + + void Collect(VkPipeline pipeline); + + void Report() const; + +private: + struct Stats { + u64 code_size{}; + u64 register_count{}; + u64 sgpr_count{}; + u64 vgpr_count{}; + u64 branches_count{}; + u64 basic_block_count{}; + }; + + const Device& device; + mutable std::mutex mutex; + std::vector<Stats> collected_stats; +}; + +} // namespace Vulkan |