Skip to content

Commit d9c749c

Browse files
committed
Remove FenceTimeout
Most samples only had a declaratio for it and never used it Other samples inconsistently used FenceTimeout and UINT64_MAX
1 parent 769e70c commit d9c749c

13 files changed

+7
-19
lines changed

attachments/28_model_loading.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import vulkan_hpp;
3737

3838
constexpr uint32_t WIDTH = 800;
3939
constexpr uint32_t HEIGHT = 600;
40-
constexpr uint64_t FenceTimeout = 100000000;
4140
const std::string MODEL_PATH = "models/viking_room.obj";
4241
const std::string TEXTURE_PATH = "textures/viking_room.png";
4342
constexpr int MAX_FRAMES_IN_FLIGHT = 2;

attachments/29_mipmapping.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import vulkan_hpp;
3737

3838
constexpr uint32_t WIDTH = 800;
3939
constexpr uint32_t HEIGHT = 600;
40-
constexpr uint64_t FenceTimeout = 100000000;
4140
const std::string MODEL_PATH = "models/viking_room.obj";
4241
const std::string TEXTURE_PATH = "textures/viking_room.png";
4342
constexpr int MAX_FRAMES_IN_FLIGHT = 2;

attachments/30_multisampling.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import vulkan_hpp;
3737

3838
constexpr uint32_t WIDTH = 800;
3939
constexpr uint32_t HEIGHT = 600;
40-
constexpr uint64_t FenceTimeout = 100000000;
4140
const std::string MODEL_PATH = "models/viking_room.obj";
4241
const std::string TEXTURE_PATH = "textures/viking_room.png";
4342
constexpr int MAX_FRAMES_IN_FLIGHT = 2;

attachments/31_compute_shader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import vulkan_hpp;
3232

3333
constexpr uint32_t WIDTH = 800;
3434
constexpr uint32_t HEIGHT = 600;
35-
constexpr uint64_t FenceTimeout = 100000000;
3635
constexpr uint32_t PARTICLE_COUNT = 8192;
3736

3837
constexpr int MAX_FRAMES_IN_FLIGHT = 2;

attachments/32_ecosystem_utilities.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import vulkan_hpp;
3737

3838
constexpr uint32_t WIDTH = 800;
3939
constexpr uint32_t HEIGHT = 600;
40-
constexpr uint64_t FenceTimeout = 100000000;
4140
const std::string MODEL_PATH = "models/viking_room.obj";
4241
const std::string TEXTURE_PATH = "textures/viking_room.png";
4342
constexpr int MAX_FRAMES_IN_FLIGHT = 2;
@@ -1521,7 +1520,7 @@ class HelloTriangleApplication {
15211520
}
15221521

15231522
void drawFrame() {
1524-
while (vk::Result::eTimeout == device.waitForFences(*inFlightFences[currentFrame], vk::True, FenceTimeout))
1523+
while (vk::Result::eTimeout == device.waitForFences(*inFlightFences[currentFrame], vk::True, UINT64_MAX))
15251524
;
15261525
auto [result, imageIndex] = swapChain.acquireNextImage(UINT64_MAX, *presentCompleteSemaphore[currentFrame], nullptr);
15271526

attachments/33_vulkan_profiles.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import vulkan_hpp;
3838

3939
constexpr uint32_t WIDTH = 800;
4040
constexpr uint32_t HEIGHT = 600;
41-
constexpr uint64_t FenceTimeout = 100000000;
4241
const std::string MODEL_PATH = "models/viking_room.obj";
4342
const std::string TEXTURE_PATH = "textures/viking_room.png";
4443
constexpr int MAX_FRAMES_IN_FLIGHT = 2;
@@ -1520,11 +1519,11 @@ class HelloTriangleApplication {
15201519
}
15211520

15221521
void drawFrame() {
1523-
static_cast<void>(device.waitForFences({*inFlightFences[currentFrame]}, VK_TRUE, FenceTimeout));
1522+
static_cast<void>(device.waitForFences({*inFlightFences[currentFrame]}, VK_TRUE, UINT64_MAX));
15241523

15251524
uint32_t imageIndex;
15261525
try {
1527-
auto [result, idx] = swapChain.acquireNextImage(FenceTimeout, *imageAvailableSemaphores[currentFrame]);
1526+
auto [result, idx] = swapChain.acquireNextImage(UINT64_MAX, *imageAvailableSemaphores[currentFrame]);
15281527
imageIndex = idx;
15291528
} catch (vk::OutOfDateKHRError&) {
15301529
recreateSwapChain();

attachments/34_android.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ import vulkan_hpp;
8686

8787
constexpr uint32_t WIDTH = 800;
8888
constexpr uint32_t HEIGHT = 600;
89-
constexpr uint64_t FenceTimeout = 100000000;
9089
const std::string MODEL_PATH = "models/viking_room.obj";
9190
const std::string TEXTURE_PATH = "textures/viking_room.png";
9291
constexpr int MAX_FRAMES_IN_FLIGHT = 2;
@@ -1256,11 +1255,11 @@ class HelloTriangleApplication {
12561255

12571256
// Draw frame
12581257
void drawFrame() {
1259-
static_cast<void>(device.waitForFences({*inFlightFences[currentFrame]}, VK_TRUE, FenceTimeout));
1258+
static_cast<void>(device.waitForFences({*inFlightFences[currentFrame]}, VK_TRUE, UINT64_MAX));
12601259

12611260
uint32_t imageIndex;
12621261
try {
1263-
auto [result, idx] = swapChain.acquireNextImage(FenceTimeout, *imageAvailableSemaphores[currentFrame]);
1262+
auto [result, idx] = swapChain.acquireNextImage(UINT64_MAX, *imageAvailableSemaphores[currentFrame]);
12641263
imageIndex = idx;
12651264
} catch (vk::OutOfDateKHRError&) {
12661265
recreateSwapChain();

attachments/35_gltf_ktx.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import vulkan_hpp;
7979

8080
constexpr uint32_t WIDTH = 800;
8181
constexpr uint32_t HEIGHT = 600;
82-
constexpr uint64_t FenceTimeout = 100000000;
8382
// Update paths to use glTF model and KTX2 texture
8483
const std::string MODEL_PATH = "models/viking_room.glb";
8584
const std::string TEXTURE_PATH = "textures/viking_room.ktx2";

attachments/36_multiple_objects.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import vulkan_hpp;
7979

8080
constexpr uint32_t WIDTH = 800;
8181
constexpr uint32_t HEIGHT = 600;
82-
constexpr uint64_t FenceTimeout = 100000000;
8382
// Update paths to use glTF model and KTX2 texture
8483
const std::string MODEL_PATH = "models/viking_room.glb";
8584
const std::string TEXTURE_PATH = "textures/viking_room.ktx2";

attachments/37_multithreading.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import vulkan_hpp;
3333

3434
constexpr uint32_t WIDTH = 800;
3535
constexpr uint32_t HEIGHT = 600;
36-
constexpr uint64_t FenceTimeout = 100000000;
3736
constexpr uint32_t PARTICLE_COUNT = 8192;
3837

3938
constexpr int MAX_FRAMES_IN_FLIGHT = 2;

0 commit comments

Comments
 (0)