Skip to content

Commit f735a89

Browse files
committed
Code cleanup
Fixes some C++2X deprecation warnings
1 parent 878dbc2 commit f735a89

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

base/vulkanexamplebase.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,7 @@ void VulkanExampleBase::renderLoop()
334334
if (wl_display_dispatch_pending(display) == -1)
335335
return;
336336
#endif
337-
338-
benchmark.run([=] { render(); }, vulkanDevice->properties);
337+
benchmark.run([=, this] { render(); }, vulkanDevice->properties);
339338
vkDeviceWaitIdle(device);
340339
if (!benchmark.filename.empty()) {
341340
benchmark.saveResults();

examples/multithreading/multithreading.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Vulkan Example - Multi threaded command buffer generation and rendering
33
*
4-
* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de
4+
* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de
55
*
66
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
77
*/
@@ -329,7 +329,7 @@ class VulkanExample : public VulkanExampleBase
329329

330330
VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
331331

332-
VkClearValue clearValues[2];
332+
VkClearValue clearValues[2]{};
333333
clearValues[0].color = defaultClearColor;
334334
clearValues[1].depthStencil = { 1.0f, 0 };
335335

@@ -369,7 +369,7 @@ class VulkanExample : public VulkanExampleBase
369369
{
370370
for (uint32_t i = 0; i < numObjectsPerThread; i++)
371371
{
372-
threadPool.threads[t]->addJob([=] { threadRenderCode(t, i, inheritanceInfo); });
372+
threadPool.threads[t]->addJob([=, this] { threadRenderCode(t, i, inheritanceInfo); });
373373
}
374374
}
375375

@@ -428,7 +428,7 @@ class VulkanExample : public VulkanExampleBase
428428
VkPipelineMultisampleStateCreateInfo multisampleState = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0);
429429
std::vector<VkDynamicState> dynamicStateEnables = {VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR};
430430
VkPipelineDynamicStateCreateInfo dynamicState = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables);
431-
std::array<VkPipelineShaderStageCreateInfo, 2> shaderStages;
431+
std::array<VkPipelineShaderStageCreateInfo, 2> shaderStages{};
432432

433433
VkGraphicsPipelineCreateInfo pipelineCI = vks::initializers::pipelineCreateInfo(pipelineLayout, renderPass, 0);
434434
pipelineCI.pInputAssemblyState = &inputAssemblyState;

0 commit comments

Comments
 (0)