Skip to content

Commit 261b63f

Browse files
committed
Minor cleanup
1 parent 162c57d commit 261b63f

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

base/VulkanInitializers.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ namespace vks
151151
return fenceCreateInfo;
152152
}
153153

154-
inline VkEventCreateInfo eventCreateInfo()
155-
{
156-
VkEventCreateInfo eventCreateInfo {};
157-
eventCreateInfo.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO;
158-
return eventCreateInfo;
159-
}
160-
161154
inline VkSubmitInfo submitInfo()
162155
{
163156
return { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO };

examples/bloom/bloom.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ class VulkanExample : public VulkanExampleBase
5353
struct {
5454
VkPipelineLayout blur;
5555
VkPipelineLayout scene;
56-
} pipelineLayouts;
56+
} pipelineLayouts{};
5757

5858
struct {
5959
VkPipeline blurVert;
6060
VkPipeline blurHorz;
6161
VkPipeline glowPass;
6262
VkPipeline phongPass;
6363
VkPipeline skyBox;
64-
} pipelines;
64+
} pipelines{};
6565

6666
struct {
6767
VkDescriptorSetLayout blur;
6868
VkDescriptorSetLayout scene;
69-
} descriptorSetLayouts;
69+
} descriptorSetLayouts{};
7070

7171
struct DescriptorSets {
7272
VkDescriptorSet blurVert;
@@ -92,7 +92,7 @@ class VulkanExample : public VulkanExampleBase
9292
VkRenderPass renderPass;
9393
VkSampler sampler;
9494
std::array<FrameBuffer, 2> framebuffers;
95-
} offscreenPass;
95+
} offscreenPass{};
9696

9797
VulkanExample() : VulkanExampleBase()
9898
{
@@ -206,9 +206,10 @@ class VulkanExample : public VulkanExampleBase
206206
depthStencilView.image = frameBuf->depth.image;
207207
VK_CHECK_RESULT(vkCreateImageView(device, &depthStencilView, nullptr, &frameBuf->depth.view));
208208

209-
VkImageView attachments[2];
210-
attachments[0] = frameBuf->color.view;
211-
attachments[1] = frameBuf->depth.view;
209+
VkImageView attachments[2]{
210+
frameBuf->color.view,
211+
frameBuf->depth.view
212+
};
212213

213214
VkFramebufferCreateInfo fbufCreateInfo = vks::initializers::framebufferCreateInfo();
214215
fbufCreateInfo.renderPass = offscreenPass.renderPass;

examples/radialblur/radialblur.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class VulkanExample : public VulkanExampleBase
240240
subpassDescription.pDepthStencilAttachment = &depthReference;
241241

242242
// Use subpass dependencies for layout transitions
243-
std::array<VkSubpassDependency, 2> dependencies;
243+
std::array<VkSubpassDependency, 2> dependencies{};
244244

245245
dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL;
246246
dependencies[0].dstSubpass = 0;
@@ -270,7 +270,7 @@ class VulkanExample : public VulkanExampleBase
270270

271271
VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &offscreenPass.renderPass));
272272

273-
VkImageView attachments[2];
273+
VkImageView attachments[2]{};
274274
attachments[0] = offscreenPass.color.view;
275275
attachments[1] = offscreenPass.depth.view;
276276

@@ -381,7 +381,7 @@ class VulkanExample : public VulkanExampleBase
381381
VkPipelineMultisampleStateCreateInfo multisampleStateCI = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0);
382382
std::vector<VkDynamicState> dynamicStateEnables = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR };
383383
VkPipelineDynamicStateCreateInfo dynamicStateCI = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables);
384-
std::array<VkPipelineShaderStageCreateInfo, 2> shaderStages;
384+
std::array<VkPipelineShaderStageCreateInfo, 2> shaderStages{};
385385

386386
VkGraphicsPipelineCreateInfo pipelineCI = vks::initializers::pipelineCreateInfo(pipelineLayouts.radialBlur, renderPass, 0);
387387
pipelineCI.pInputAssemblyState = &inputAssemblyStateCI;

0 commit comments

Comments
 (0)