UnityVulkanImage image;
if (!m_UnityVulkan->AccessRenderBufferTexture((UnityRenderBuffer)data->colorBuffer, UnityVulkanWholeImage, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT, kUnityVulkanResourceAccess_PipelineBarrier, &image))
{
UnityLog("failed to access rendertexture color buffer");
return;
}
after calling the API, I print the image.layout, it's VK_IMAGE_LAYOUT_UNDEFINED type instead of VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. Because I want to sample the texture, so the image layout out must be VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL.
Do I need to transition image layout manully?
after calling the API, I print the image.layout, it's
VK_IMAGE_LAYOUT_UNDEFINED
type instead ofVK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
. Because I want to sample the texture, so the image layout out must beVK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
. Do I need to transition image layout manully?