Initial layout barrier was not submitted

This commit is contained in:
saschawillems 2016-05-14 15:49:01 +02:00
parent 779739fa45
commit a72df2bec9
2 changed files with 12 additions and 4 deletions

View file

@ -8,7 +8,7 @@ if %ERRORLEVEL% EQU 0 (
xcopy "..\..\data\shaders\computeshader\*.spv" "assets\shaders\computeshader" /Y
mkdir "assets\textures"
xcopy "..\..\data\textures\igor_and_pal_rgba.ktx" "assets\textures" /Y
xcopy "..\..\data\textures\vulkan_space_rgba8.ktx" "assets\textures" /Y
mkdir "res\drawable"

View file

@ -57,7 +57,7 @@ public:
// Compute pipelines are separated from
// graphics pipelines in Vulkan
std::vector<VkPipeline> compute;
uint32_t computeIndex = 1;
uint32_t computeIndex = 0;
} pipelines;
int vertexBufferSize;
@ -147,8 +147,16 @@ public:
err = vkBindImageMemory(device, tex->image, tex->deviceMemory, 0);
assert(!err);
tex->imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
vkTools::setImageLayout(setupCmdBuffer, tex->image, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, tex->imageLayout);
VkCommandBuffer layoutCmd = VulkanExampleBase::createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
tex->imageLayout = VK_IMAGE_LAYOUT_GENERAL;
vkTools::setImageLayout(
layoutCmd, tex->image,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_LAYOUT_UNDEFINED,
tex->imageLayout);
VulkanExampleBase::flushCommandBuffer(layoutCmd, queue, true);
// Create sampler
VkSamplerCreateInfo sampler = vkTools::initializers::samplerCreateInfo();