diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 5a307847..87b3fde0 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -334,8 +334,7 @@ void VulkanExampleBase::renderLoop() if (wl_display_dispatch_pending(display) == -1) return; #endif - - benchmark.run([=] { render(); }, vulkanDevice->properties); + benchmark.run([=, this] { render(); }, vulkanDevice->properties); vkDeviceWaitIdle(device); if (!benchmark.filename.empty()) { benchmark.saveResults(); diff --git a/examples/multithreading/multithreading.cpp b/examples/multithreading/multithreading.cpp index 78904d0c..8f5d7bc1 100644 --- a/examples/multithreading/multithreading.cpp +++ b/examples/multithreading/multithreading.cpp @@ -1,7 +1,7 @@ /* * Vulkan Example - Multi threaded command buffer generation and rendering * -* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -329,7 +329,7 @@ public: VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo(); - VkClearValue clearValues[2]; + VkClearValue clearValues[2]{}; clearValues[0].color = defaultClearColor; clearValues[1].depthStencil = { 1.0f, 0 }; @@ -369,7 +369,7 @@ public: { for (uint32_t i = 0; i < numObjectsPerThread; i++) { - threadPool.threads[t]->addJob([=] { threadRenderCode(t, i, inheritanceInfo); }); + threadPool.threads[t]->addJob([=, this] { threadRenderCode(t, i, inheritanceInfo); }); } } @@ -428,7 +428,7 @@ public: VkPipelineMultisampleStateCreateInfo multisampleState = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0); std::vector dynamicStateEnables = {VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR}; VkPipelineDynamicStateCreateInfo dynamicState = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables); - std::array shaderStages; + std::array shaderStages{}; VkGraphicsPipelineCreateInfo pipelineCI = vks::initializers::pipelineCreateInfo(pipelineLayout, renderPass, 0); pipelineCI.pInputAssemblyState = &inputAssemblyState;