Skip to content

Fixed Vulkan swap chain extent - #285

Merged
dzhdanNV merged 3 commits into
NVIDIA-RTX:mainfrom
Bonzai-Dev:main
Oct 21, 2026
Merged

dzhdanNV merged 3 commits into
NVIDIA-RTX:mainfrom
Bonzai-Dev:main

Conversation

@Bonzai-Dev

Copy link
Copy Markdown
Contributor

This PR addresses this issue encountered in NRISamples and multiple other issues when handling the swap chain, such as returning the wrong nri::Result for vkAcquireNextImageKHR or vkQueuePresentKHR, as stated in the specs. It also adds an extra check for the 0xFFFFFFFF special value, indicating that the surface size will be determined by the extent of a swap chain targeting the surface.

Copy link
Copy Markdown
Collaborator

Please address these points:

  1. Use the selected extent for both swapchainInfo.imageExtent and the wrapped texture dimensions. Currently, only the texture metadata changes.
  2. Preserve presentation scaling: when scaling is enabled, retain the requested extent within minScaledImageExtent/maxScaledImageExtent, rather than unconditionally selecting currentExtent.
  3. Keep textureIndex = m_TextureIndex after successful acquisition.
  4. Please remove the local OUT_OF_DATE suppression from acquisition and presentation. The existing result conversion already returns Result::OUT_OF_DATE. Would it be better to downgrade this result to Message::WARNING centrally in ReportMessage, keeping the diagnostic instead of suppressing it?

@dzhdanNV

dzhdanNV commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for the fixes, but I can't integrate this PR as is because of the issues stated above. Additionally, I would like to understand:

  • why did you remove INVALID_ARGUMENT reporting for out of range values? It seems to be intentional, please, explain
  • it looks like you are not happy with OUT_OF_DATE reported as ERROR. Is it because of the spam? I think I demote OUT_OF_DATE to WARNING, but if the spam is the case - it's an issue on your side. OUT_OF_DATE is a valid recoverable event but it must not happen all the time.

Let's discuss if something is unclear or concerning.

@Bonzai-Dev

Copy link
Copy Markdown
Contributor Author

I have pushed a new commit that should address all issues mentioned above. Regarding why I removed the reporting for out-of-range values, the changes I have introduced should set the extent of the swap chain to the correct size, making the extra checks irrelevant. As for your concern about the OUT_OF_DATE error, I have simply thought that the NRI_RETURN_ON_BAD_VKRESULT macro didn't return the correct error, which turns out I was wrong.

@dzhdanNV

Copy link
Copy Markdown
Collaborator

Thanks. Merged!

@dzhdanNV
dzhdanNV merged commit 49485eb into NVIDIA-RTX:main Oct 21, 2026
dzhdanNV added a commit that referenced this pull request Oct 21, 2026
@dzhdanNV

Copy link
Copy Markdown
Collaborator

I added a handling of rare zero extents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants