Compiler warnings

This commit is contained in:
saschawillems 2016-12-23 16:11:38 +01:00
parent 55cbdbeedf
commit c2907f9394
2 changed files with 3 additions and 3 deletions

View file

@ -408,7 +408,7 @@ void VulkanExampleBase::renderLoop()
std::string windowTitle = getWindowTitle();
SetWindowText(window, windowTitle.c_str());
}
lastFPS = roundf(1.0f / frameTimer);
lastFPS = static_cast<uint32_t>(1.0f / frameTimer);
updateTextOverlay();
fpsTimer = 0.0f;
frameCounter = 0;

View file

@ -411,7 +411,7 @@ public:
// We allocate this manually as the alignment of the offset differs between GPUs
// Calculate required alignment depending on device limits
uint32_t uboAlignment = vulkanDevice->properties.limits.minUniformBufferOffsetAlignment;
size_t uboAlignment = vulkanDevice->properties.limits.minUniformBufferOffsetAlignment;
dynamicAlignment = (sizeof(glm::mat4) / uboAlignment) * uboAlignment + ((sizeof(glm::mat4) % uboAlignment) > 0 ? uboAlignment : 0);
size_t bufferSize = OBJECT_INSTANCES * dynamicAlignment;
@ -473,7 +473,7 @@ public:
}
// Dynamic ubo with per-object model matrices indexed by offsets in the command buffer
uint32_t dim = pow(OBJECT_INSTANCES, (1.0 / 3.0));
uint32_t dim = static_cast<uint32_t>(pow(OBJECT_INSTANCES, (1.0f / 3.0f)));
glm::vec3 offset(5.0f);
for (uint32_t x = 0; x < dim; x++)