Skip to content

Conversation

@simoll
Copy link
Collaborator

@simoll simoll commented May 8, 2025

The backing memory of the ShaderStages vector starts to migrate when more than four stages are pushed. ASAN detects and errs on that condition (details in bug).

Closes #7104

}

// mod.ShaderStages can only take four elements before it starts to
// migrate. Make sure not to add redundant stages.
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could exit the while loop early here if mod.size() is 4?

Comment on lines +402 to +403
// mod.ShaderStages can only take four elements before it starts to
// migrate. Make sure not to add redundant stages.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the problem is that we leak memory if the ShaderStages SmallVector ever grows, then wouldn't a better fix be to avoid a SmallVector (or any type that can move its memory) entirely? That is, should we adjust PayloadAccessAnnotation to store the stages in a fixed data structure instead?

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

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Memleak for PAQs with more than four shader stages

3 participants