Code cleanup

This commit is contained in:
Sascha Willems 2020-04-20 22:13:51 +02:00
parent 4b9f10d644
commit 53846d8b1d
23 changed files with 54 additions and 104 deletions

View file

@ -204,7 +204,7 @@ public:
VK_CHECK_RESULT(vkAllocateMemory(device, &memAllocInfo, nullptr, &texture.deviceMemory));
VK_CHECK_RESULT(vkBindImageMemory(device, texture.image, texture.deviceMemory, 0));
VkCommandBuffer copyCmd = VulkanExampleBase::createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
VkCommandBuffer copyCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
VkImageSubresourceRange subresourceRange = {};
subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
@ -247,7 +247,7 @@ public:
VK_PIPELINE_STAGE_TRANSFER_BIT,
subresourceRange);
VulkanExampleBase::flushCommandBuffer(copyCmd, queue, true);
vulkanDevice->flushCommandBuffer(copyCmd, queue, true);
// Clean up staging resources
vkFreeMemory(device, stagingMemory, nullptr);
@ -258,7 +258,7 @@ public:
// ---------------------------------------------------------------
// We copy down the whole mip chain doing a blit from mip-1 to mip
// An alternative way would be to always blit from the first mip level and sample that one down
VkCommandBuffer blitCmd = VulkanExampleBase::createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
VkCommandBuffer blitCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
// Copy down mips from n-1 to n
for (int32_t i = 1; i < texture.mipLevels; i++)
@ -336,7 +336,7 @@ public:
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
subresourceRange);
VulkanExampleBase::flushCommandBuffer(blitCmd, queue, true);
vulkanDevice->flushCommandBuffer(blitCmd, queue, true);
// ---------------------------------------------------------------
// Create samplers