Skip to content

Ensure all swapchains have a unique handle#2

Open
fholger wants to merge 1 commit intoelliotttate:masterfrom
fholger:master
Open

Ensure all swapchains have a unique handle#2
fholger wants to merge 1 commit intoelliotttate:masterfrom
fholger:master

Conversation

@fholger
Copy link
Copy Markdown

@fholger fholger commented Mar 31, 2026

The previous approach is incorrect when multiple swapchains are created, destroyed, then recreated - it can lead to a new swapchain being assigned an existing handle, then overwriting that existing swapchain's data and thus corrupting further operations with the swapchains.


Summary by cubic

Guarantees unique swapchain handles to prevent overwriting entries after create/destroy/recreate cycles. This removes handle reuse and stops swapchain data corruption.

  • Bug Fixes
    • Replaced (g_swapchains.size() + 2) with a monotonic counter g_nextSwapchainHandle++ (initialized at 1) for chain.handle assignment.

Written for commit 53cbf07. Summary will update on new commits.

…ld lead to a new swapchain getting assigned an existing handle, screwing up further swapchain operations
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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.

1 participant