diff options
author | bunnei <bunneidev@gmail.com> | 2021-07-30 20:18:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 20:18:52 +0200 |
commit | 7530594602d57f42ba5d10814603d0771909886c (patch) | |
tree | 6d8a35e56cf7bd64e3d3e96b37560ee8d5e5a5b5 /src/video_core/renderer_vulkan/pipeline_statistics.h | |
parent | Merge pull request #6770 from Morph1984/swkbd_buffer_size (diff) | |
parent | renderer_vulkan: Add setting to log pipeline statistics (diff) | |
download | yuzu-7530594602d57f42ba5d10814603d0771909886c.tar yuzu-7530594602d57f42ba5d10814603d0771909886c.tar.gz yuzu-7530594602d57f42ba5d10814603d0771909886c.tar.bz2 yuzu-7530594602d57f42ba5d10814603d0771909886c.tar.lz yuzu-7530594602d57f42ba5d10814603d0771909886c.tar.xz yuzu-7530594602d57f42ba5d10814603d0771909886c.tar.zst yuzu-7530594602d57f42ba5d10814603d0771909886c.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 |