diff --git a/android/computeshader/build.bat b/android/computeshader/build.bat index 22e2f2f9..3cbd71e5 100644 --- a/android/computeshader/build.bat +++ b/android/computeshader/build.bat @@ -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" diff --git a/computeshader/computeshader.cpp b/computeshader/computeshader.cpp index 82dec677..fc3a62df 100644 --- a/computeshader/computeshader.cpp +++ b/computeshader/computeshader.cpp @@ -57,7 +57,7 @@ public: // Compute pipelines are separated from // graphics pipelines in Vulkan std::vector 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();