Unity-Technologies / Unity-Technologies/NativeRenderingPlugin

Does AccessRenderBufferTexture of Vulkan Plugin API can transition image layout?

Open
#36 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
943
Forks
186
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the AccessRenderBufferTexture call shown in the issue and trace how the UnityVulkanImage layout is populated after the call. Compare the requested Vulkan layout and access parameters with the plugin API behavior and relevant Vulkan image-layout documentation. Done means establishing whether the API performs the transition or whether callers must do it manually, with the expected behavior documented or corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, unity
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.