Constructor Function.
- Parameters
-
This vector is essential to vkGetCalibratedTimestampsEXT, and only need to be registered once.
Initialize in-scope time stamp info variable.
Push-back timestamp info to timestamps info vector.
timestamps vector.
max deviations vector.
Get calibrated timestamps.
Create Context and set name.
This vector is essential to vkGetCalibratedTimestampsEXT, and only need to be registered once.
Initialize in-scope time stamp info variable.
Push-back timestamp info to timestamps info vector.
timestamps vector.
max deviations vector.
Get calibrated timestamps.
Create Context and set name.
Definition at line 15 of file TracyProfilerWrapper.cpp.
18 {
20
22 VK_CHECK(state.m_VkFunc.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(state.m_PhysicalDevice, &
count,
nullptr))
23
24 std::vector<VkTimeDomainEXT> timeDomains;
25 timeDomains.resize(
count);
26 VK_CHECK(state.m_VkFunc.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(state.m_PhysicalDevice, &
count, timeDomains.data()))
27
28 bool hasDomain = false;
30 {
34 std::vector<VkCalibratedTimestampInfoEXT> timestampsInfo;
35
36 for (auto& domain : timeDomains)
37 {
41 VkCalibratedTimestampInfoEXT info{};
42 info.sType = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT;
43 info.pNext = nullptr;
44 info.timeDomain = domain;
45
49 timestampsInfo.push_back(info);
50 }
51
55 std::vector<uint64_t> timestamps;
56 timestamps.resize(
count);
57
61 std::vector<uint64_t> maxDeviations;
62 maxDeviations.resize(
count);
63
67 VK_CHECK(state.m_VkFunc.vkGetCalibratedTimestampsEXT(state.m_Device, timestamps.size(), timestampsInfo.data(), timestamps.data(), maxDeviations.data()))
68
69 std::unordered_map<VkTimeDomainEXT, uint32_t> maps;
70 for (auto& domain : timeDomains)
71 {
72 maps[domain] = 1;
73 }
74
75 hasDomain = maps[VK_TIME_DOMAIN_DEVICE_EXT] && maps[VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT];
76 }
77
78 if (!hasDomain)
79 {
80 std::stringstream ss;
81 ss << "This Device not support VK_TIME_DOMAIN_DEVICE_EXT.";
82
83 SPICES_CORE_ERROR(ss.str());
84 }
85
89#ifdef TRACY_ENABLE
90
91
92
93
94#endif
95
96 }
#define SPICES_PROFILE_ZONE
#define VK_CHECK(expr)
Vulkan Check macro. Verify Vulkan API Effectiveness.
tracy::VkCtx * m_Context
Tracy Vulkan Context.
VulkanState & m_VulkanState
VulkanState.
constexpr int count
Calculate count that meets requirement.
References m_VulkanState, and TracyGPUContext().
Referenced by TracyGPUContext().