Removed unused parameters for image layout transitions and shader loading (Refs #103)
This commit is contained in:
parent
549f49ff77
commit
ba0cc82e50
10 changed files with 13 additions and 35 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue