Typo fixes. Delete irrelevant comments

This commit is contained in:
Henrik Rydgard 2016-03-21 20:23:53 +01:00
parent dff585e440
commit b97e02febe
2 changed files with 4 additions and 6 deletions

View file

@ -635,9 +635,9 @@ VkResult VulkanContext::CreateDevice(int physical_device) {
deviceInfo_.preferredDepthStencilFormat = VK_FORMAT_UNDEFINED;
for (int i = 0; i < ARRAY_SIZE(depthStencilFormats); i++) {
VkFormatProperties props;
vkGetPhysicalDeviceFormatProperties(physical_devices_[0], VK_FORMAT_D24_UNORM_S8_UINT, &props);
vkGetPhysicalDeviceFormatProperties(physical_devices_[0], depthStencilFormats[i], &props);
if (props.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) {
deviceInfo_.preferredDepthStencilFormat = VK_FORMAT_D24_UNORM_S8_UINT;
deviceInfo_.preferredDepthStencilFormat = depthStencilFormats[i];
break;
}
}
@ -787,15 +787,12 @@ void VulkanContext::InitDepthStencilBuffer(VkCommandBuffer cmd) {
&mem_alloc.memoryTypeIndex);
assert(pass);
/* Allocate memory */
res = vkAllocateMemory(device_, &mem_alloc, NULL, &depth.mem);
assert(res == VK_SUCCESS);
/* Bind memory */
res = vkBindImageMemory(device_, depth.image, depth.mem, 0);
assert(res == VK_SUCCESS);
/* Set the image layout to depth stencil optimal */
TransitionImageLayout(cmd, depth.image,
aspectMask,
VK_IMAGE_LAYOUT_UNDEFINED,

View file

@ -80,6 +80,7 @@ public:
assert(samplers_.size() == 0);
assert(pipelineCaches_.size() == 0);
assert(renderPasses_.size() == 0);
assert(framebuffers_.size() == 0);
descPools_ = std::move(del.descPools_);
modules_ = std::move(del.modules_);
buffers_ = std::move(del.buffers_);
@ -137,7 +138,7 @@ public:
for (auto &framebuffer : framebuffers_) {
vkDestroyFramebuffer(device, framebuffer, nullptr);
}
renderPasses_.clear();
framebuffers_.clear();
}
private: