Changed command buffer static default initializer 44/319544/2
authorDavid Steele <david.steele@samsung.com>
Wed, 12 Feb 2025 14:12:33 +0000 (14:12 +0000)
committerDavid Steele <david.steele@samsung.com>
Wed, 12 Feb 2025 17:56:25 +0000 (17:56 +0000)
Change-Id: I21e31265e1f6d9604762057c0f7385cd02f0fa60

dali/internal/graphics/vulkan-impl/vulkan-command-buffer-impl.cpp

index 9287c98b7fbf52374e4f805d7f2c1bda909f5fcd..15b1024a60d3d5d78b8dd92644408610f1c6e417 100644 (file)
@@ -79,11 +79,16 @@ void CommandBufferImpl::Begin(vk::CommandBufferUsageFlags       usageFlags,
   auto info = vk::CommandBufferBeginInfo{};
 
   static vk::CommandBufferInheritanceInfo defaultInheritanceInfo{};
-  defaultInheritanceInfo.pNext                = nullptr;
-  defaultInheritanceInfo.subpass              = 0;
-  defaultInheritanceInfo.occlusionQueryEnable = false;
-  defaultInheritanceInfo.queryFlags           = static_cast<vk::QueryControlFlags>(0);
-  defaultInheritanceInfo.pipelineStatistics   = static_cast<vk::QueryPipelineStatisticFlags>(0);
+  static bool                             init{false};
+  if(!init)
+  {
+    defaultInheritanceInfo.pNext                = nullptr;
+    defaultInheritanceInfo.subpass              = 0;
+    defaultInheritanceInfo.occlusionQueryEnable = false;
+    defaultInheritanceInfo.queryFlags           = static_cast<vk::QueryControlFlags>(0);
+    defaultInheritanceInfo.pipelineStatistics   = static_cast<vk::QueryPipelineStatisticFlags>(0);
+    init                                        = true;
+  }
 
   if(!inheritanceInfo)
   {