Skip to content

support for vkAcquireNextImage2KHR #87

@pprabhu78

Description

@pprabhu78

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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions