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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Add extra braces when setting VkClearValue
  • Loading branch information
TestingPlant committed Jul 20, 2021
commit e8ab01a1a565dc2909748bf3b7e1987e0d3cc5e4
2 changes: 1 addition & 1 deletion code/14_command_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/15_hello_triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/16_swap_chain_recreation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/17_vertex_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/18_vertex_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/19_staging_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/20_index_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/21_descriptor_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/22_descriptor_sets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/23_texture_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/24_sampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/25_texture_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.offset = {0, 0};
renderPassInfo.renderArea.extent = swapChainExtent;

VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;

Expand Down
2 changes: 1 addition & 1 deletion code/26_depth_buffering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.extent = swapChainExtent;

std::array<VkClearValue, 2> clearValues{};
clearValues[0].color = {0.0f, 0.0f, 0.0f, 1.0f};
clearValues[0].color = {{0.0f, 0.0f, 0.0f, 1.0f}};
clearValues[1].depthStencil = {1.0f, 0};

renderPassInfo.clearValueCount = static_cast<uint32_t>(clearValues.size());
Expand Down
2 changes: 1 addition & 1 deletion code/27_model_loading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.extent = swapChainExtent;

std::array<VkClearValue, 2> clearValues{};
clearValues[0].color = {0.0f, 0.0f, 0.0f, 1.0f};
clearValues[0].color = {{0.0f, 0.0f, 0.0f, 1.0f}};
clearValues[1].depthStencil = {1.0f, 0};

renderPassInfo.clearValueCount = static_cast<uint32_t>(clearValues.size());
Expand Down
2 changes: 1 addition & 1 deletion code/28_mipmapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ class HelloTriangleApplication {
renderPassInfo.renderArea.extent = swapChainExtent;

std::array<VkClearValue, 2> clearValues{};
clearValues[0].color = {0.0f, 0.0f, 0.0f, 1.0f};
clearValues[0].color = {{0.0f, 0.0f, 0.0f, 1.0f}};
clearValues[1].depthStencil = {1.0f, 0};

renderPassInfo.clearValueCount = static_cast<uint32_t>(clearValues.size());
Expand Down
2 changes: 1 addition & 1 deletion code/29_multisampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ VkSampleCountFlagBits getMaxUsableSampleCount() {
renderPassInfo.renderArea.extent = swapChainExtent;

std::array<VkClearValue, 2> clearValues{};
clearValues[0].color = {0.0f, 0.0f, 0.0f, 1.0f};
clearValues[0].color = {{0.0f, 0.0f, 0.0f, 1.0f}};
clearValues[1].depthStencil = {1.0f, 0};

renderPassInfo.clearValueCount = static_cast<uint32_t>(clearValues.size());
Expand Down
2 changes: 1 addition & 1 deletion en/03_Drawing_a_triangle/03_Drawing/01_Command_buffers.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ region will have undefined values. It should match the size of the attachments
for best performance.

```c++
VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;
```
Expand Down
2 changes: 1 addition & 1 deletion en/07_Depth_buffering.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ create an array of `VkClearValue` structs:

```c++
std::array<VkClearValue, 2> clearValues{};
clearValues[0].color = {0.0f, 0.0f, 0.0f, 1.0f};
clearValues[0].color = {{0.0f, 0.0f, 0.0f, 1.0f}};
clearValues[1].depthStencil = {1.0f, 0};

renderPassInfo.clearValueCount = static_cast<uint32_t>(clearValues.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ chargements et stockages shaders se produiront. Les pixels hors de cette région
doit correspondre à la taille des attachements pour avoir une performance optimale.

```c++
VkClearValue clearColor = {0.0f, 0.0f, 0.0f, 1.0f};
VkClearValue clearColor = {{{0.0f, 0.0f, 0.0f, 1.0f}}};
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;
```
Expand Down
2 changes: 1 addition & 1 deletion fr/07_Buffer_de_profondeur.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ suppression. Allez à `createCommandBuffers` et créez un tableau de `VkClearVal

```c++
std::array<VkClearValue, 2> clearValues{};
clearValues[0].color = {0.0f, 0.0f, 0.0f, 1.0f};
clearValues[0].color = {{0.0f, 0.0f, 0.0f, 1.0f}};
clearValues[1].depthStencil = {1.0f, 0};

renderPassInfo.clearValueCount = static_cast<uint32_t>(clearValues.size());
Expand Down