Fix validation error with the GPU profiler

This commit is contained in:
Henrik Rydgård 2022-10-03 12:13:11 +02:00
parent ba78854759
commit 2207c1271a
3 changed files with 7 additions and 2 deletions

View file

@ -110,6 +110,11 @@ VkCommandBuffer FrameData::GetInitCmd(VulkanContext *vulkan) {
if (res != VK_SUCCESS) {
return VK_NULL_HANDLE;
}
// Good spot to reset the query pool.
vkCmdResetQueryPool(initCmd, profile.queryPool, 0, MAX_TIMESTAMP_QUERIES);
vkCmdWriteTimestamp(initCmd, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, profile.queryPool, 0);
hasInitCommands = true;
}
return initCmd;

View file

@ -80,6 +80,8 @@ struct FrameData {
void AcquireNextImage(VulkanContext *vulkan, FrameDataShared &shared);
VkResult QueuePresent(VulkanContext *vulkan, FrameDataShared &shared);
// Generally called from the main thread, unlike most of the rest.
VkCommandBuffer GetInitCmd(VulkanContext *vulkan);
// This will only submit if we are actually recording init commands.

View file

@ -609,8 +609,6 @@ void VulkanRenderManager::BeginFrame(bool enableProfiling, bool enableLogProfile
frameData.profile.timestampDescriptions.push_back("initCmd Begin");
frameData.profile.timestampDescriptions.push_back("initCmd");
VkCommandBuffer initCmd = GetInitCmd();
vkCmdResetQueryPool(initCmd, frameData.profile.queryPool, 0, MAX_TIMESTAMP_QUERIES);
vkCmdWriteTimestamp(initCmd, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, frameData.profile.queryPool, 0);
}
}