bool Image::transitionLayout()

in RenderScriptMigrationSample/app/src/main/cpp/VulkanResources.cpp [374:381]


bool Image::transitionLayout(VkImageLayout newLayout) {
    if (newLayout == mLayout) return true;
    VulkanCommandBuffer layoutCommand(mContext->device(), mContext->commandPool());
    RET_CHECK(mContext->beginSingleTimeCommand(layoutCommand.pHandle()));
    recordLayoutTransitionBarrier(layoutCommand.handle(), newLayout);
    RET_CHECK(mContext->endAndSubmitSingleTimeCommand(layoutCommand.handle()));
    return true;
}