| 
1 | 1 | /*  | 
2 | 2 | * Vulkan Example - Multi threaded command buffer generation and rendering  | 
3 | 3 | *  | 
4 |  | -* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de  | 
 | 4 | +* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de  | 
5 | 5 | *  | 
6 | 6 | * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)  | 
7 | 7 | */  | 
@@ -329,7 +329,7 @@ class VulkanExample : public VulkanExampleBase  | 
329 | 329 | 
 
  | 
330 | 330 | 		VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();  | 
331 | 331 | 
 
  | 
332 |  | -		VkClearValue clearValues[2];  | 
 | 332 | +		VkClearValue clearValues[2]{};  | 
333 | 333 | 		clearValues[0].color = defaultClearColor;  | 
334 | 334 | 		clearValues[1].depthStencil = { 1.0f, 0 };  | 
335 | 335 | 
 
  | 
@@ -369,7 +369,7 @@ class VulkanExample : public VulkanExampleBase  | 
369 | 369 | 		{  | 
370 | 370 | 			for (uint32_t i = 0; i < numObjectsPerThread; i++)  | 
371 | 371 | 			{  | 
372 |  | -				threadPool.threads[t]->addJob([=] { threadRenderCode(t, i, inheritanceInfo); });  | 
 | 372 | +				threadPool.threads[t]->addJob([=, this] { threadRenderCode(t, i, inheritanceInfo); });  | 
373 | 373 | 			}  | 
374 | 374 | 		}  | 
375 | 375 | 
 
  | 
@@ -428,7 +428,7 @@ class VulkanExample : public VulkanExampleBase  | 
428 | 428 | 		VkPipelineMultisampleStateCreateInfo multisampleState = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0);  | 
429 | 429 | 		std::vector<VkDynamicState> dynamicStateEnables = {VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR};  | 
430 | 430 | 		VkPipelineDynamicStateCreateInfo dynamicState = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables);  | 
431 |  | -		std::array<VkPipelineShaderStageCreateInfo, 2> shaderStages;  | 
 | 431 | +		std::array<VkPipelineShaderStageCreateInfo, 2> shaderStages{};  | 
432 | 432 | 
 
  | 
433 | 433 | 		VkGraphicsPipelineCreateInfo pipelineCI = vks::initializers::pipelineCreateInfo(pipelineLayout, renderPass, 0);  | 
434 | 434 | 		pipelineCI.pInputAssemblyState = &inputAssemblyState;  | 
 | 
0 commit comments