Skip to content

Commit 12c6467

Browse files
committed
Make image in loop a referene
1 parent ca42702 commit 12c6467

26 files changed

+26
-26
lines changed

attachments/07_image_views.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class HelloTriangleApplication
277277
assert(swapChainImageViews.empty());
278278

279279
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
280-
for (auto image : swapChainImages)
280+
for (auto& image : swapChainImages)
281281
{
282282
imageViewCreateInfo.image = image;
283283
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/08_graphics_pipeline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class HelloTriangleApplication
278278
assert(swapChainImageViews.empty());
279279

280280
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
281-
for (auto image : swapChainImages)
281+
for (auto& image : swapChainImages)
282282
{
283283
imageViewCreateInfo.image = image;
284284
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/09_shader_modules.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class HelloTriangleApplication
288288
assert(swapChainImageViews.empty());
289289

290290
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
291-
for (auto image : swapChainImages)
291+
for (auto& image : swapChainImages)
292292
{
293293
imageViewCreateInfo.image = image;
294294
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/10_fixed_functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ class HelloTriangleApplication
290290
assert(swapChainImageViews.empty());
291291

292292
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
293-
for (auto image : swapChainImages)
293+
for (auto& image : swapChainImages)
294294
{
295295
imageViewCreateInfo.image = image;
296296
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/12_graphics_pipeline_complete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class HelloTriangleApplication
291291
assert(swapChainImageViews.empty());
292292

293293
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
294-
for (auto image : swapChainImages)
294+
for (auto& image : swapChainImages)
295295
{
296296
imageViewCreateInfo.image = image;
297297
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/14_command_buffers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class HelloTriangleApplication
295295
assert(swapChainImageViews.empty());
296296

297297
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
298-
for (auto image : swapChainImages)
298+
for (auto& image : swapChainImages)
299299
{
300300
imageViewCreateInfo.image = image;
301301
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/16_frames_in_flight.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class HelloTriangleApplication
308308
assert(swapChainImageViews.empty());
309309

310310
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
311-
for (auto image : swapChainImages)
311+
for (auto& image : swapChainImages)
312312
{
313313
imageViewCreateInfo.image = image;
314314
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/17_swap_chain_recreation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class HelloTriangleApplication
341341
assert(swapChainImageViews.empty());
342342

343343
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
344-
for (auto image : swapChainImages)
344+
for (auto& image : swapChainImages)
345345
{
346346
imageViewCreateInfo.image = image;
347347
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/19_vertex_buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class HelloTriangleApplication
362362
assert(swapChainImageViews.empty());
363363

364364
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
365-
for (auto image : swapChainImages)
365+
for (auto& image : swapChainImages)
366366
{
367367
imageViewCreateInfo.image = image;
368368
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

attachments/20_staging_buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class HelloTriangleApplication
362362
assert(swapChainImageViews.empty());
363363

364364
vk::ImageViewCreateInfo imageViewCreateInfo{.viewType = vk::ImageViewType::e2D, .format = swapChainSurfaceFormat.format, .subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1}};
365-
for (auto image : swapChainImages)
365+
for (auto& image : swapChainImages)
366366
{
367367
imageViewCreateInfo.image = image;
368368
swapChainImageViews.emplace_back(device, imageViewCreateInfo);

0 commit comments

Comments
 (0)