Skip to content

Commit cf01437

Browse files
committed
Remov no-longer used code
Cleanup
1 parent 6e9e9a7 commit cf01437

12 files changed

Lines changed: 9 additions & 20 deletions

File tree

base/VulkanInitializers.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ namespace vks
160160

161161
inline VkSubmitInfo submitInfo()
162162
{
163-
VkSubmitInfo submitInfo {};
164-
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
165-
return submitInfo;
163+
return { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO };
166164
}
167165

168166
inline VkViewport viewport(

base/VulkanUIOverlay.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ namespace vks
338338
buffers[currentBuffer].vertexBuffer.destroy();
339339
VK_CHECK_RESULT(device->createBuffer(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &buffers[currentBuffer].vertexBuffer, vertexBufferSize));
340340
buffers[currentBuffer].vertexCount = imDrawData->TotalVtxCount;
341-
//buffers[currentBuffer].vertexBuffer.unmap();
342341
buffers[currentBuffer].vertexBuffer.map();
343342
}
344343

examples/computecloth/computecloth.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class VulkanExample : public VulkanExampleBase
112112
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
113113
camera.setRotation(glm::vec3(-30.0f, -45.0f, 0.0f));
114114
camera.setTranslation(glm::vec3(0.0f, 0.0f, -5.0f));
115-
settings.overlay = false;
116115
}
117116

118117
~VulkanExample()
@@ -628,7 +627,7 @@ class VulkanExample : public VulkanExampleBase
628627
buildGraphicsCommandBuffer();
629628

630629
VkPipelineStageFlags waitDstStageMask[2] = {
631-
submitPipelineStages, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT
630+
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT
632631
};
633632
VkSemaphore waitSemaphores[2] = {
634633
semaphores.presentComplete, compute.semaphores[currentBuffer].complete
@@ -637,6 +636,7 @@ class VulkanExample : public VulkanExampleBase
637636
semaphores.renderComplete, compute.semaphores[currentBuffer].ready
638637
};
639638

639+
VkSubmitInfo submitInfo = vks::initializers::submitInfo();
640640
submitInfo.waitSemaphoreCount = 2;
641641
submitInfo.pWaitDstStageMask = waitDstStageMask;
642642
submitInfo.pWaitSemaphores = waitSemaphores;

examples/dynamicrendering/dynamicrendering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class VulkanExample : public VulkanExampleBase
201201
prepareUniformBuffers();
202202
setupDescriptors();
203203
preparePipelines();
204-
buildCommandBuffers();
205204
prepared = true;
206205
}
207206

examples/dynamicrenderingmultisampling/dynamicrenderingmultisampling.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ class VulkanExample : public VulkanExampleBase
283283
prepareUniformBuffers();
284284
setupDescriptors();
285285
preparePipelines();
286-
buildCommandBuffers();
287286
prepared = true;
288287
}
289288

examples/imgui/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class ImGUI {
1717
private:
1818
// Vulkan resources for rendering the UI
1919
struct Buffers {
20-
vks::Buffer vertexBuffer;
21-
vks::Buffer indexBuffer;
20+
vks::Buffer vertexBuffer{ VK_NULL_HANDLE };
21+
vks::Buffer indexBuffer{ VK_NULL_HANDLE };
2222
int32_t vertexCount = 0;
2323
int32_t indexCount = 0;
2424
};

examples/indirectdraw/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ To use a buffer for indirect draw commands you need to specify the ```VK_BUFFER_
7575
### Rendering
7676
If the [`multiDrawIndirect`](http://vulkan.gpuinfo.org/listreports.php?feature=multiDrawIndirect) is supported, we can issue all indirect draws with one single draw call:
7777
```cpp
78-
void buildCommandBuffers()
78+
void buildCommandBuffer()
7979
{
8080
...
8181
for (int32_t i = 0; i < drawCmdBuffers.size(); ++i)
8282
{
83-
vkCmdDrawIndexedIndirect(drawCmdBuffers[i], indirectCommandsBuffer.buffer, 0, indirectDrawCount, sizeof(VkDrawIndexedIndirectCommand));
83+
vkCmdDrawIndexedIndirect(cmdBuffer, indirectCommandsBuffer.buffer, 0, indirectDrawCount, sizeof(VkDrawIndexedIndirectCommand));
8484
}
8585
}
8686
```
@@ -92,7 +92,7 @@ for (auto indirectCmd : indirectCommands)
9292
{
9393
for (uint32_t j = 0; j < indirectCmd.instanceCount; j++)
9494
{
95-
vkCmdDrawIndexed(drawCmdBuffers[i], indirectCmd.indexCount, 1, indirectCmd.firstIndex, 0, indirectCmd.firstInstance + j);
95+
vkCmdDrawIndexed(cmdBuffer, indirectCmd.indexCount, 1, indirectCmd.firstIndex, 0, indirectCmd.firstInstance + j);
9696
}
9797
}
9898
```
@@ -101,7 +101,7 @@ If the GPU does not support ```multiDrawIndirect``` we have to issue the indirec
101101
```cpp
102102
for (auto j = 0; j < indirectCommands.size(); j++)
103103
{
104-
vkCmdDrawIndexedIndirect(drawCmdBuffers[i], indirectCommandsBuffer.buffer, j * sizeof(VkDrawIndexedIndirectCommand), 1, sizeof(VkDrawIndexedIndirectCommand));
104+
vkCmdDrawIndexedIndirect(cmdBuffer, indirectCommandsBuffer.buffer, j * sizeof(VkDrawIndexedIndirectCommand), 1, sizeof(VkDrawIndexedIndirectCommand));
105105
}
106106
```
107107

examples/oit/oit.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ class VulkanExample : public VulkanExampleBase
432432
prepareGeometryPass();
433433
setupDescriptors();
434434
preparePipelines();
435-
buildCommandBuffers();
436435
prepared = true;
437436
}
438437

@@ -570,7 +569,6 @@ class VulkanExample : public VulkanExampleBase
570569
vkResetDescriptorPool(device, descriptorPool, 0);
571570
updateDescriptors();
572571
resized = false;
573-
buildCommandBuffers();
574572
}
575573

576574
void destroyGeometryPass()

examples/parallaxmapping/parallaxmapping.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ class VulkanExample : public VulkanExampleBase
115115
VkDescriptorSetLayoutCreateInfo descriptorLayout = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
116116
VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout));
117117

118-
// Set
119118
// Sets per frame, just like the buffers themselves
120119
// Images do not need to be duplicated per frame, we reuse the same one for each frame
121120
VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayout, 1);

examples/pushconstants/pushconstants.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ class VulkanExample : public VulkanExampleBase
178178
prepareUniformBuffers();
179179
setupDescriptors();
180180
preparePipelines();
181-
buildCommandBuffers();
182181
prepared = true;
183182
}
184183

0 commit comments

Comments
 (0)