Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uninitialized reftype during image state merge #3446

Conversation

james-sumihiro
Copy link
Contributor

This PR targets an error that can occur if images are referenced by a secondary command buffer before being referenced by a primary command buffer that executes the secondary.

Image states tracked by secondary command buffers are merged into their executing primaries in the hook for VkCmdExecuteCommands. If an image state refers to an image that was not previously referenced by the primary, a new, uninitialized image state is added to the primary. The new image state is initialized with elements of the original, including subresource states, but the frameref type of subresource states is uninitialized. An error is logged when the subresource state reftypes are passed to the reftype composition function.

This PR adds logic to initialize the reftype of the new subresource state with the value of the original if it remains uninitialized before the composition function.

The reftype of a merged subresource state is now initialized with the reftype of the original subresource state

This resolves an issue that could occur if image states in a secondary command buffer were merged into a primary for the first time, where the resulting merged image state would have an uninitialized reftype
@baldurk baldurk merged commit aaf64f1 into baldurk:v1.x Sep 26, 2024
16 checks passed
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