2
3
4
5
9#include "Render/Vulkan/VulkanUtils.h"
22 VK_CHECK(state.m_VkFunc.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(state.m_PhysicalDevice, &count,
nullptr))
24 std::vector<VkTimeDomainEXT> timeDomains;
25 timeDomains.resize(count);
26 VK_CHECK(state.m_VkFunc.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(state.m_PhysicalDevice, &count, timeDomains.data()))
28 bool hasDomain =
false;
32
33
34 std::vector<VkCalibratedTimestampInfoEXT> timestampsInfo;
36 for (
auto& domain : timeDomains)
39
40
41 VkCalibratedTimestampInfoEXT info{};
42 info.sType = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT;
44 info.timeDomain = domain;
47
48
49 timestampsInfo.push_back(info);
53
54
55 std::vector<uint64_t> timestamps;
56 timestamps.resize(count);
59
60
61 std::vector<uint64_t> maxDeviations;
62 maxDeviations.resize(count);
65
66
67 VK_CHECK(state.m_VkFunc.vkGetCalibratedTimestampsEXT(state.m_Device, timestamps.size(), timestampsInfo.data(), timestamps.data(), maxDeviations.data()))
69 std::unordered_map<VkTimeDomainEXT, uint32_t> maps;
70 for (
auto& domain : timeDomains)
75 hasDomain = maps[VK_TIME_DOMAIN_DEVICE_EXT] && maps[VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT];
81 ss <<
"This Device not support VK_TIME_DOMAIN_DEVICE_EXT.";
83 SPICES_CORE_ERROR(ss.str());
87
88
102 if (!m_TracyGPUContext)
104 m_TracyGPUContext = std::make_shared<TracyGPUContext>(state);
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
static std::shared_ptr< TracyGPUContext > m_TracyGPUContext
This Single Instance.
TracyGPUContext(VulkanState &state)
Constructor Function.
VulkanState & m_VulkanState
VulkanState.
static void CreateInstance(VulkanState &state)
Create this Single Instance.
Wapper of Tracy GPU collect features.
This struct contains all Vulkan object in used global.