summaryrefslogtreecommitdiff
path: root/tools/gfx/vulkan/vk-query.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /tools/gfx/vulkan/vk-query.cpp
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'tools/gfx/vulkan/vk-query.cpp')
-rw-r--r--tools/gfx/vulkan/vk-query.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/gfx/vulkan/vk-query.cpp b/tools/gfx/vulkan/vk-query.cpp
index ccdb84647..694896966 100644
--- a/tools/gfx/vulkan/vk-query.cpp
+++ b/tools/gfx/vulkan/vk-query.cpp
@@ -19,9 +19,7 @@ Result QueryPoolImpl::init(const IQueryPool::Desc& desc, DeviceImpl* device)
createInfo.queryCount = (uint32_t)desc.count;
switch (desc.type)
{
- case QueryType::Timestamp:
- createInfo.queryType = VK_QUERY_TYPE_TIMESTAMP;
- break;
+ case QueryType::Timestamp: createInfo.queryType = VK_QUERY_TYPE_TIMESTAMP; break;
case QueryType::AccelerationStructureCompactedSize:
createInfo.queryType = VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR;
break;
@@ -31,8 +29,7 @@ Result QueryPoolImpl::init(const IQueryPool::Desc& desc, DeviceImpl* device)
case QueryType::AccelerationStructureCurrentSize:
// Vulkan does not support CurrentSize query, will not create actual pools here.
return SLANG_OK;
- default:
- return SLANG_E_INVALID_ARG;
+ default: return SLANG_E_INVALID_ARG;
}
SLANG_VK_RETURN_ON_FAIL(
m_device->m_api.vkCreateQueryPool(m_device->m_api.m_device, &createInfo, nullptr, &m_pool));
@@ -67,12 +64,18 @@ Result QueryPoolImpl::getResult(GfxIndex index, GfxCount count, uint64_t* data)
}
void _writeTimestamp(
- VulkanApi* api, VkCommandBuffer vkCmdBuffer, IQueryPool* queryPool, SlangInt index)
+ VulkanApi* api,
+ VkCommandBuffer vkCmdBuffer,
+ IQueryPool* queryPool,
+ SlangInt index)
{
auto queryPoolImpl = static_cast<QueryPoolImpl*>(queryPool);
api->vkCmdResetQueryPool(vkCmdBuffer, queryPoolImpl->m_pool, (uint32_t)index, 1);
api->vkCmdWriteTimestamp(
- vkCmdBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, queryPoolImpl->m_pool, (uint32_t)index);
+ vkCmdBuffer,
+ VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
+ queryPoolImpl->m_pool,
+ (uint32_t)index);
}
} // namespace vk