Skip to content

Commit 21be913

Browse files
authored
Stall during pipeline creation in benchmark mode for graphicspipelinelibrary (#1264)
1 parent 439759d commit 21be913

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

examples/graphicspipelinelibrary/graphicspipelinelibrary.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,20 @@ class VulkanExample: public VulkanExampleBase
414414

415415
// Create first pipeline using a background thread
416416
std::thread pipelineGenerationThread(&VulkanExample::threadFn, this);
417-
pipelineGenerationThread.detach();
417+
418+
// Stall in benchmark mode until pipeline creation is finished to measure work more consistently
419+
if (benchmark.active)
420+
pipelineGenerationThread.join();
421+
else
422+
pipelineGenerationThread.detach();
418423

419424
prepared = true;
420425
}
421426

422427
void buildCommandBuffer()
423428
{
424429
VkCommandBuffer cmdBuffer = drawCmdBuffers[currentBuffer];
425-
430+
426431
VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
427432

428433
VkClearValue clearValues[2]{};

0 commit comments

Comments
 (0)