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

@ -162,7 +162,7 @@ public:
VK_CHECK_RESULT(vkAllocateMemory(device, &memAllocInfo, nullptr, &tex->deviceMemory));
VK_CHECK_RESULT(vkBindImageMemory(device, tex->image, tex->deviceMemory, 0));
VkCommandBuffer layoutCmd = VulkanExampleBase::createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
VkCommandBuffer layoutCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
tex->imageLayout = VK_IMAGE_LAYOUT_GENERAL;
vks::tools::setImageLayout(
@ -172,7 +172,7 @@ public:
VK_IMAGE_LAYOUT_UNDEFINED,
tex->imageLayout);
VulkanExampleBase::flushCommandBuffer(layoutCmd, queue, true);
vulkanDevice->flushCommandBuffer(layoutCmd, queue, true);
// Create sampler
VkSamplerCreateInfo sampler = vks::initializers::samplerCreateInfo();
@ -337,11 +337,11 @@ public:
storageBufferSize);
// Copy to staging buffer
VkCommandBuffer copyCmd = VulkanExampleBase::createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
VkCommandBuffer copyCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
VkBufferCopy copyRegion = {};
copyRegion.size = storageBufferSize;
vkCmdCopyBuffer(copyCmd, stagingBuffer.buffer, compute.storageBuffers.spheres.buffer, 1, &copyRegion);
VulkanExampleBase::flushCommandBuffer(copyCmd, queue, true);
vulkanDevice->flushCommandBuffer(copyCmd, queue, true);
stagingBuffer.destroy();
@ -372,10 +372,10 @@ public:
storageBufferSize);
// Copy to staging buffer
copyCmd = VulkanExampleBase::createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
copyCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
copyRegion.size = storageBufferSize;
vkCmdCopyBuffer(copyCmd, stagingBuffer.buffer, compute.storageBuffers.planes.buffer, 1, &copyRegion);
VulkanExampleBase::flushCommandBuffer(copyCmd, queue, true);
vulkanDevice->flushCommandBuffer(copyCmd, queue, true);
stagingBuffer.destroy();
}