NVIDIA-RTX / NVIDIA-RTX/Streamline

support for vkAcquireNextImage2KHR

Open
#87 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
1.2k
Forks
159
PR merge metrics
No merged PRs in 30d

Description

We use vkAcquireNextImage2KHR, but it is not wrapped in streamline, so I patched the streamline source like below, but I am not sure whether it will work right based on the comment below. Please advise.

    // not sure this works correctly if the plugin hook is not using the deviceMask in pAcquireInfo. Streamline needs to support this.
    VkResult VKAPI_CALL vkAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex)
    {
        bool skip = false;
        VkResult result = VK_SUCCESS;
        {
            const auto& hooks = sl::plugin_manager::getInterface()->getBeforeHooks(sl::FunctionHookID::eVulkan_AcquireNextImageKHR);
            for (auto [hook, feature] : hooks)
            {
                result = ((sl::PFunVkAcquireNextImageKHRBefore*)hook)(device, pAcquireInfo->swapchain, pAcquireInfo->timeout, pAcquireInfo->semaphore, pAcquireInfo->fence, pImageIndex, skip);
                // report error on first fail
                if (result != VK_SUCCESS)
                {
                    return result;
                }
            }
        }

        if (!skip)
        {
            result = s_ddt.AcquireNextImage2KHR(device, pAcquireInfo, pImageIndex);
        }
        return result;
    }

Contributor guide

Open the contributing guide

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 at the vkAcquireNextImage2KHR entry point and compare its proposed hook path with the existing eVulkan_AcquireNextImageKHR interface. Check how pAcquireInfo->deviceMask should be handled before calling s_ddt.AcquireNextImage2KHR. Done means the wrapper and hook behavior correctly support the device mask, with the result and image index preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.