General code cleanup

Fixes #442, Closes #379
This commit is contained in:
saschawillems 2018-04-13 18:06:30 +02:00
parent bfb4b7607a
commit 1b8343d67b
19 changed files with 7 additions and 45 deletions

View file

@ -194,8 +194,7 @@ public:
VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
VkClearValue clearValues[2];
clearValues[0].color = defaultClearColor;
clearValues[0].color = { { 0.0f, 0.0f, 0.0f, 0.0f } };;
clearValues[0].color = { { 0.0f, 0.0f, 0.0f, 0.0f } };
clearValues[1].depthStencil = { 1.0f, 0 };
VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
@ -207,7 +206,6 @@ public:
VkViewport viewport;
VkRect2D scissor;
VkDeviceSize offsets[1] = { 0 };
for (int32_t i = 0; i < drawCmdBuffers.size(); ++i)
{
@ -818,8 +816,7 @@ public:
shaderStages[1] = loadShader(getAssetPath() + "shaders/hdr/composition.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
pipelineCreateInfo.layout = pipelineLayouts.composition;
pipelineCreateInfo.renderPass = renderPass;
rasterizationState.cullMode = VK_CULL_MODE_BACK_BIT;
rasterizationState.cullMode = VK_CULL_MODE_NONE;
rasterizationState.cullMode = VK_CULL_MODE_FRONT_BIT;
colorBlendState.attachmentCount = 1;
colorBlendState.pAttachments = blendAttachmentStates.data();
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.composition));
@ -846,6 +843,7 @@ public:
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.bloom[0]));
// Second blur pass (into separate framebuffer)
rasterizationState.cullMode = VK_CULL_MODE_BACK_BIT;
pipelineCreateInfo.renderPass = filterPass.renderPass;
dir = 0;
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.bloom[1]));
@ -871,7 +869,6 @@ public:
vertexInputState.vertexAttributeDescriptionCount = static_cast<uint32_t>(vertexInputAttributes.size());
vertexInputState.pVertexAttributeDescriptions = vertexInputAttributes.data();
pipelineCreateInfo.renderPass = renderPass;
pipelineCreateInfo.pVertexInputState = &vertexInputState;
// Skybox pipeline (background cube)
@ -900,7 +897,7 @@ public:
depthStencilState.depthWriteEnable = VK_TRUE;
depthStencilState.depthTestEnable = VK_TRUE;
// Flip cull mode
rasterizationState.cullMode = VK_CULL_MODE_NONE;
rasterizationState.cullMode = VK_CULL_MODE_FRONT_BIT;
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.reflect));
}