Fixed compiler warnings

This commit is contained in:
saschawillems 2017-01-22 12:28:55 +01:00
parent c7303e4e67
commit 8d3fe738c3
3 changed files with 77 additions and 77 deletions

View file

@ -226,9 +226,9 @@ public:
sizeof(float) * 6);
vertices.inputState = vkTools::initializers::pipelineVertexInputStateCreateInfo();
vertices.inputState.vertexBindingDescriptionCount = vertices.bindingDescriptions.size();
vertices.inputState.vertexBindingDescriptionCount = static_cast<uint32_t>(vertices.bindingDescriptions.size());
vertices.inputState.pVertexBindingDescriptions = vertices.bindingDescriptions.data();
vertices.inputState.vertexAttributeDescriptionCount = vertices.attributeDescriptions.size();
vertices.inputState.vertexAttributeDescriptionCount = static_cast<uint32_t>(vertices.attributeDescriptions.size());
vertices.inputState.pVertexAttributeDescriptions = vertices.attributeDescriptions.data();
}
@ -243,7 +243,7 @@ public:
VkDescriptorPoolCreateInfo descriptorPoolInfo =
vkTools::initializers::descriptorPoolCreateInfo(
poolSizes.size(),
static_cast<uint32_t>(poolSizes.size()),
poolSizes.data(),
2);
@ -274,7 +274,7 @@ public:
VkDescriptorSetLayoutCreateInfo descriptorLayout =
vkTools::initializers::descriptorSetLayoutCreateInfo(
setLayoutBindings.data(),
setLayoutBindings.size());
static_cast<uint32_t>(setLayoutBindings.size()));
VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout));
@ -325,7 +325,7 @@ public:
&texDescriptor),
};
vkUpdateDescriptorSets(device, writeDescriptorSets.size(), writeDescriptorSets.data(), 0, NULL);
vkUpdateDescriptorSets(device, static_cast<uint32_t>(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, NULL);
}
void preparePipelines()
@ -375,7 +375,7 @@ public:
VkPipelineDynamicStateCreateInfo dynamicState =
vkTools::initializers::pipelineDynamicStateCreateInfo(
dynamicStateEnables.data(),
dynamicStateEnables.size(),
static_cast<uint32_t>(dynamicStateEnables.size()),
0);
VkPipelineTessellationStateCreateInfo tessellationState =
@ -404,7 +404,7 @@ public:
pipelineCreateInfo.pDepthStencilState = &depthStencilState;
pipelineCreateInfo.pDynamicState = &dynamicState;
pipelineCreateInfo.pTessellationState = &tessellationState;
pipelineCreateInfo.stageCount = shaderStages.size();
pipelineCreateInfo.stageCount = static_cast<uint32_t>(shaderStages.size());
pipelineCreateInfo.pStages = shaderStages.data();
pipelineCreateInfo.renderPass = renderPass;
@ -525,7 +525,7 @@ public:
void changeTessellationLevel(float delta)
{
uboTessControl.tessLevel += delta;
uboTessControl.tessLevel = fmax(1.0, fmin(uboTessControl.tessLevel, 32.0));
uboTessControl.tessLevel = fmax(1.0f, fmin(uboTessControl.tessLevel, 32.0f));
updateUniformBuffers();
updateTextOverlay();
}
@ -557,11 +557,11 @@ public:
{
case KEY_KPADD:
case GAMEPAD_BUTTON_R1:
changeTessellationStrength(0.025);
changeTessellationStrength(0.025f);
break;
case KEY_KPSUB:
case GAMEPAD_BUTTON_L1:
changeTessellationStrength(-0.025);
changeTessellationStrength(-0.025f);
break;
case KEY_D:
case GAMEPAD_BUTTON_A: