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 locking order in render_pipeline_get_bind_group_layout #4253

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

nical
Copy link
Contributor

@nical nical commented Oct 17, 2023

Checklist

  • Run cargo clippy.

Connections

Blocks https://bugzilla.mozilla.org/show_bug.cgi?id=1856371

Description

The code path for when IDs are provided externally was creating a new root token while the previous one still existed. The right thing to do is to ensure the other guards are closed before assigning the newly created bind group which this patch does by scoping the them.

Also add the equivalent code for compute_pipeline_get_bind_group_layout.

Testing

This is covered by the CTS in Firefox.

@nical nical requested a review from a team as a code owner October 17, 2023 14:53
@jimblandy
Copy link
Member

@nical There are checks in Token::root that are supposed to detect attempts to create multiple roots simultaneously on the same thread. Did those debug assertions trigger in this case?

@cwfitzgerald
Copy link
Member

(These checks probably should be bounded by "strict-asserts" rather than debug_assertions)

Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@jimblandy
Copy link
Member

(These checks probably should be bounded by "strict-asserts" rather than debug_assertions)

Oooh, good point.

@jimblandy
Copy link
Member

(These checks probably should be bounded by "strict-asserts" rather than debug_assertions)

Filed as #4258.

@jimblandy jimblandy merged commit 7461781 into gfx-rs:trunk Oct 18, 2023
23 checks passed
@nical
Copy link
Contributor Author

nical commented Oct 18, 2023

@nical There are checks in Token::root that are supposed to detect attempts to create multiple roots simultaneously on the same thread. Did those debug assertions trigger in this case?

Yes that's how I found the issue.

@nical nical deleted the double-root branch October 18, 2023 13:23
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.

3 participants