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: Consolidate path handling. #2501

Merged
merged 6 commits into from
Sep 25, 2023

Conversation

jimblandy
Copy link
Member

Add a new type, Input, representing a particular Naga input file, with methods to generate related paths - output files with a particular extension, parameter files, and the input file itself. Use this throughout snapshots.rs to generate paths.

Give Input utility methods for reading and writing files.

Each commit in this PR should pass CI independently. Some commits have a lot of pure renames, so reviewing commits separately is probably easiest.

@jimblandy jimblandy marked this pull request as ready for review September 24, 2023 23:07
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Good stuff!

@teoxoy
Copy link
Member

teoxoy commented Sep 25, 2023

Seems like this needs a manual rebase...

Don't replace dots with dashes in the output filenames for no reason.
Instead, give them names consistent with those generated by
`write_output_glsl`.
This makes it a bit easier to use in the CLI and snapshot tests.
Rather than adding a `-glsl` suffix to the name, just rely on
`check_targets`' standard naming behavior, treating
`tests/in/variations.glsl` like any other snapshot input.
Add a new type, `Input`, representing a particular Naga input file,
with methods to generate related paths - output files with a
particular extension, parameter files, and the input file itself.
Use this throughout `snapshots.rs` to generate paths.

Give `Input` utility methods for reading and writing files.
Change printlns in the backend functions to say "generating" instead
of "writing" before calling the Naga backends. "Writing" suggests
writing output to a file; "generating" seems more accurate for calling
a backend.
@jimblandy jimblandy enabled auto-merge (rebase) September 25, 2023 14:56
@jimblandy jimblandy merged commit 3bcb114 into gfx-rs:master Sep 25, 2023
6 checks passed
@jimblandy jimblandy deleted the snapshot-param-reform branch September 25, 2023 19:36
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