Skip to content

Commit 422d54e

Browse files
committed
Do not shadow loop variable
Fixes SaschaWillems#1207
1 parent 84d4a70 commit 422d54e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/descriptorindexing/descriptorindexing.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Relevant code parts are marked with [POI]
99
*
10-
* Copyright (C) 2021-2023 Sascha Willems - www.saschawillems.de
10+
* Copyright (C) 2021-2025 Sascha Willems - www.saschawillems.de
1111
*
1212
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
1313
*/
@@ -112,11 +112,11 @@ class VulkanExample : public VulkanExampleBase
112112
const int32_t dim = 3;
113113
const size_t bufferSize = dim * dim * 4;
114114
std::vector<uint8_t> texture(bufferSize);
115-
for (size_t i = 0; i < dim * dim; i++) {
116-
texture[i * 4] = rndDist(rndEngine);
117-
texture[i * 4 + 1] = rndDist(rndEngine);
118-
texture[i * 4 + 2] = rndDist(rndEngine);
119-
texture[i * 4 + 3] = 255;
115+
for (size_t j = 0; j < dim * dim; j++) {
116+
texture[j * 4] = rndDist(rndEngine);
117+
texture[j * 4 + 1] = rndDist(rndEngine);
118+
texture[j * 4 + 2] = rndDist(rndEngine);
119+
texture[j * 4 + 3] = 255;
120120
}
121121
textures[i].fromBuffer(texture.data(), bufferSize, VK_FORMAT_R8G8B8A8_UNORM, dim, dim, vulkanDevice, queue, VK_FILTER_NEAREST);
122122
}

0 commit comments

Comments
 (0)