| 339 | } |
| 340 | |
| 341 | void |
| 342 | Sequence::createTimestampQueryPool(uint32_t totalTimestamps) |
| 343 | { |
| 344 | KP_LOG_DEBUG("Kompute Sequence creating query pool"); |
| 345 | if (!this->isInit()) { |
| 346 | throw std::runtime_error( |
| 347 | "createTimestampQueryPool() called on uninitialized Sequence"); |
| 348 | } |
| 349 | if (!this->mPhysicalDevice) { |
| 350 | throw std::runtime_error("Kompute Sequence physical device is null"); |
| 351 | } |
| 352 | |
| 353 | vk::PhysicalDeviceProperties physicalDeviceProperties = |
| 354 | this->mPhysicalDevice->getProperties(); |
| 355 | |
| 356 | if (physicalDeviceProperties.limits.timestampComputeAndGraphics) { |
| 357 | vk::QueryPoolCreateInfo queryPoolInfo; |
| 358 | queryPoolInfo.setQueryCount(totalTimestamps); |
| 359 | queryPoolInfo.setQueryType(vk::QueryType::eTimestamp); |
| 360 | this->timestampQueryPool = std::make_shared<vk::QueryPool>( |
| 361 | this->mDevice->createQueryPool(queryPoolInfo)); |
| 362 | |
| 363 | KP_LOG_DEBUG("Query pool for timestamps created"); |
| 364 | } else { |
| 365 | throw std::runtime_error("Device does not support timestamps"); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | std::vector<std::uint64_t> |
| 370 | Sequence::getTimestamps() |