Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use uint32_t instead of size_t for currentFrame
  • Loading branch information
charles-lunarg committed Feb 7, 2022
commit fc68dd568d46d7495208df34b1448a40fa5cab5b
2 changes: 1 addition & 1 deletion code/16_frames_in_flight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

void initWindow() {
glfwInit();
Expand Down
2 changes: 1 addition & 1 deletion code/17_swap_chain_recreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/18_vertex_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/19_vertex_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/20_staging_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/21_index_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/22_descriptor_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/23_descriptor_sets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/24_texture_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/25_sampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/26_texture_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/27_depth_buffering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/28_model_loading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
2 changes: 1 addition & 1 deletion code/29_mipmapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down
4 changes: 1 addition & 3 deletions code/30_multisampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class HelloTriangleApplication {
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;
uint32_t currentFrame = 0;

bool framebufferResized = false;

Expand Down Expand Up @@ -349,8 +349,6 @@ class HelloTriangleApplication {
createColorResources();
createDepthResources();
createFramebuffers();

imagesInFlight.resize(swapChainImages.size(), VK_NULL_HANDLE);
}

void createInstance() {
Expand Down
2 changes: 1 addition & 1 deletion en/03_Drawing_a_triangle/03_Drawing/03_Frames_in_flight.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ To use the right objects every frame, we need to keep track of the current
frame. We will use a frame index for that purpose:

```c++
size_t currentFrame = 0;
uint32_t currentFrame = 0;
```

The `drawFrame` function can now be modified to use the right objects:
Expand Down
1 change: 0 additions & 1 deletion en/03_Drawing_a_triangle/04_Swap_chain_recreation.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ Although many drivers and platforms trigger `VK_ERROR_OUT_OF_DATE_KHR` automatic

```c++
std::vector<VkFence> inFlightFences;
size_t currentFrame = 0;

bool framebufferResized = false;
```
Expand Down