diff --git a/base/VulkanTexture.hpp b/base/VulkanTexture.hpp index 87a44aaf..0c9a2e1e 100644 --- a/base/VulkanTexture.hpp +++ b/base/VulkanTexture.hpp @@ -222,7 +222,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -242,7 +241,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, imageLayout, subresourceRange); @@ -483,7 +481,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -503,7 +500,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, imageLayout, subresourceRange); @@ -696,7 +692,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -715,7 +710,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, imageLayout, subresourceRange); @@ -910,7 +904,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -929,7 +922,6 @@ namespace vks vks::tools::setImageLayout( copyCmd, image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, imageLayout, subresourceRange); diff --git a/base/VulkanTools.cpp b/base/VulkanTools.cpp index 2eda4a37..9376d5d0 100644 --- a/base/VulkanTools.cpp +++ b/base/VulkanTools.cpp @@ -94,7 +94,6 @@ namespace vks void setImageLayout( VkCommandBuffer cmdbuffer, VkImage image, - VkImageAspectFlags aspectMask, VkImageLayout oldImageLayout, VkImageLayout newImageLayout, VkImageSubresourceRange subresourceRange, @@ -229,7 +228,7 @@ namespace vks subresourceRange.baseMipLevel = 0; subresourceRange.levelCount = 1; subresourceRange.layerCount = 1; - setImageLayout(cmdbuffer, image, aspectMask, oldImageLayout, newImageLayout, subresourceRange); + setImageLayout(cmdbuffer, image, oldImageLayout, newImageLayout, subresourceRange, srcStageMask, dstStageMask); } void insertImageMemoryBarrier( @@ -293,7 +292,7 @@ namespace vks #if defined(__ANDROID__) // Android shaders are stored as assets in the apk // So they need to be loaded via the asset manager - VkShaderModule loadShader(AAssetManager* assetManager, const char *fileName, VkDevice device, VkShaderStageFlagBits stage) + VkShaderModule loadShader(AAssetManager* assetManager, const char *fileName, VkDevice device) { // Load shader from compressed asset AAsset* asset = AAssetManager_open(assetManager, fileName, AASSET_MODE_STREAMING); @@ -320,7 +319,7 @@ namespace vks return shaderModule; } #else - VkShaderModule loadShader(const char *fileName, VkDevice device, VkShaderStageFlagBits stage) + VkShaderModule loadShader(const char *fileName, VkDevice device) { std::ifstream is(fileName, std::ios::binary | std::ios::in | std::ios::ate); diff --git a/base/VulkanTools.h b/base/VulkanTools.h index bd0f31dd..09f7e931 100644 --- a/base/VulkanTools.h +++ b/base/VulkanTools.h @@ -83,7 +83,6 @@ namespace vks void setImageLayout( VkCommandBuffer cmdbuffer, VkImage image, - VkImageAspectFlags aspectMask, VkImageLayout oldImageLayout, VkImageLayout newImageLayout, VkImageSubresourceRange subresourceRange, @@ -116,9 +115,9 @@ namespace vks // Load a SPIR-V shader (binary) #if defined(__ANDROID__) - VkShaderModule loadShader(AAssetManager* assetManager, const char *fileName, VkDevice device, VkShaderStageFlagBits stage); + VkShaderModule loadShader(AAssetManager* assetManager, const char *fileName, VkDevice device); #else - VkShaderModule loadShader(const char *fileName, VkDevice device, VkShaderStageFlagBits stage); + VkShaderModule loadShader(const char *fileName, VkDevice device); #endif // Load a GLSL shader (text) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 198d41d1..7061dfb0 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -200,9 +200,9 @@ VkPipelineShaderStageCreateInfo VulkanExampleBase::loadShader(std::string fileNa shaderStage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shaderStage.stage = stage; #if defined(__ANDROID__) - shaderStage.module = vks::tools::loadShader(androidApp->activity->assetManager, fileName.c_str(), device, stage); + shaderStage.module = vks::tools::loadShader(androidApp->activity->assetManager, fileName.c_str(), device); #else - shaderStage.module = vks::tools::loadShader(fileName.c_str(), device, stage); + shaderStage.module = vks::tools::loadShader(fileName.c_str(), device); #endif shaderStage.pName = "main"; // todo : make param assert(shaderStage.module != VK_NULL_HANDLE); diff --git a/pbribl/pbribl.cpp b/pbribl/pbribl.cpp index ca734286..7df5bf23 100644 --- a/pbribl/pbribl.cpp +++ b/pbribl/pbribl.cpp @@ -902,7 +902,6 @@ public: vks::tools::setImageLayout( cmdBuf, textures.irradianceCube.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -980,7 +979,6 @@ public: vks::tools::setImageLayout( cmdBuf, textures.irradianceCube.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, subresourceRange); @@ -1299,7 +1297,6 @@ public: vks::tools::setImageLayout( cmdBuf, textures.prefilteredCube.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -1378,7 +1375,6 @@ public: vks::tools::setImageLayout( cmdBuf, textures.prefilteredCube.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, subresourceRange); diff --git a/shadowmappingomni/shadowmappingomni.cpp b/shadowmappingomni/shadowmappingomni.cpp index 7ac287a9..6920aa58 100644 --- a/shadowmappingomni/shadowmappingomni.cpp +++ b/shadowmappingomni/shadowmappingomni.cpp @@ -227,7 +227,6 @@ public: vks::tools::setImageLayout( layoutCmd, shadowCubeMap.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, subresourceRange); @@ -520,7 +519,6 @@ public: vks::tools::setImageLayout( offscreenPass.commandBuffer, shadowCubeMap.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -534,7 +532,6 @@ public: vks::tools::setImageLayout( offscreenPass.commandBuffer, shadowCubeMap.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, subresourceRange); diff --git a/texture3d/texture3d.cpp b/texture3d/texture3d.cpp index 1d2f7652..8aa948c4 100644 --- a/texture3d/texture3d.cpp +++ b/texture3d/texture3d.cpp @@ -400,7 +400,6 @@ public: vks::tools::setImageLayout( copyCmd, texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -430,7 +429,6 @@ public: vks::tools::setImageLayout( copyCmd, texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, texture.imageLayout, subresourceRange); diff --git a/texturearray/texturearray.cpp b/texturearray/texturearray.cpp index 0cffda77..9a300ac2 100644 --- a/texturearray/texturearray.cpp +++ b/texturearray/texturearray.cpp @@ -224,7 +224,6 @@ public: vks::tools::setImageLayout( copyCmd, textureArray.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -244,7 +243,6 @@ public: vks::tools::setImageLayout( copyCmd, textureArray.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, textureArray.imageLayout, subresourceRange); diff --git a/texturecubemap/texturecubemap.cpp b/texturecubemap/texturecubemap.cpp index 9d19a458..5243fc83 100644 --- a/texturecubemap/texturecubemap.cpp +++ b/texturecubemap/texturecubemap.cpp @@ -232,7 +232,6 @@ public: vks::tools::setImageLayout( copyCmd, cubeMap.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); @@ -252,7 +251,6 @@ public: vks::tools::setImageLayout( copyCmd, cubeMap.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, cubeMap.imageLayout, subresourceRange); diff --git a/texturemipmapgen/texturemipmapgen.cpp b/texturemipmapgen/texturemipmapgen.cpp index c223ef05..7d5e92ba 100644 --- a/texturemipmapgen/texturemipmapgen.cpp +++ b/texturemipmapgen/texturemipmapgen.cpp @@ -201,7 +201,12 @@ public: subresourceRange.layerCount = 1; // Optimal image will be used as destination for the copy, so we must transfer from our initial undefined image layout to the transfer destination layout - vks::tools::setImageLayout(copyCmd, texture.image, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange); + vks::tools::setImageLayout( + copyCmd, + texture.image, + VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + subresourceRange); // Copy the first mip of the chain, remaining mips will be generated VkBufferImageCopy bufferCopyRegion = {}; @@ -220,7 +225,6 @@ public: vks::tools::setImageLayout( copyCmd, texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, subresourceRange); @@ -268,7 +272,6 @@ public: vks::tools::setImageLayout( blitCmd, texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, mipSubRange, @@ -290,7 +293,6 @@ public: vks::tools::setImageLayout( blitCmd, texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, mipSubRange, @@ -303,7 +305,6 @@ public: vks::tools::setImageLayout( blitCmd, texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, texture.imageLayout, subresourceRange);