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

snapshots: Improve convert_wgsl and convert_spv legibility. #2509

Closed

Conversation

jimblandy
Copy link
Member

Add a use Targets::* declaration to convert_wgsl and convert_spv, so that each test case fits on a single line, to improve legibility.

I think it's an improvement, but it's obviously a matter of taste. If someone objects, I'm fine with the status quo as well.

Add a `use Targets::*` declaration to `convert_wgsl` and
`convert_spv`, so that each test case fits on a single line,
to improve legibility.
@teoxoy
Copy link
Member

teoxoy commented Sep 26, 2023

CI is unhappy because you can't "import" associated consts of a struct.

You'd probably have to do this for each target:

let X = Targets::X;
...

We could also add those consts to the struct instead:

const MAIN = Self::SPIRV.bits()
    | Self::METAL.bits()
    | Self::GLSL.bits()
    | Self::HLSL.bits()
    | Self::WGSL.bits();
const DEBUG = Self::IR.bits()
    | Self::ANALYSIS.bits()
    | Self::DOT.bits();

Since most snapshots use all the lang targets.

@jimblandy
Copy link
Member Author

Did I really not even test this before posting the PR? Apparently so.

@jimblandy
Copy link
Member Author

Maybe there are better ways to handle all this.

@jimblandy jimblandy closed this Sep 26, 2023
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