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

[naga spv-in] Let BlockContext hold a &mut Module. #6682

Merged

Conversation

jimblandy
Copy link
Member

@jimblandy jimblandy commented Dec 7, 2024

Refactor front::spv::BlockContext so that, rather than holding various shared and mutable references to various fields of the crate::Module being constructed, it holds just a single &mut Module, and accesses its fields through that.

This should allow the SPIR-V front to use utility functions like Module::generate_predeclared_type as intended.

Fixes #6679.

@jimblandy jimblandy added naga Shader Translator kind: refactor Making existing function faster or nicer lang: SPIR-V Vulkan's Shading Language area: naga front-end labels Dec 7, 2024
@jimblandy jimblandy requested a review from a team as a code owner December 7, 2024 19:32
Refactor `front::spv::BlockContext` so that, rather than holding
various shared and mutable references to various fields of the
`crate::Module` being constructed, it holds just a single `&mut
Module`, and accesses its fields through that.

This should allow the SPIR-V front to use utility functions like
`Module::generate_predeclared_type` as intended.

Fixes gfx-rs#6679.
@jimblandy jimblandy merged commit ba1f042 into gfx-rs:trunk Dec 9, 2024
27 checks passed
@jimblandy jimblandy deleted the naga-spv-in-blockcontext-mut-module branch December 9, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end kind: refactor Making existing function faster or nicer lang: SPIR-V Vulkan's Shading Language naga Shader Translator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[naga spv-in] BlockContext should just hold a &mut Module and be done with it
2 participants