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-cli: Support reading input from stdin #1700

Closed
rhysd opened this issue Jan 26, 2022 · 0 comments · Fixed by #1701
Closed

naga-cli: Support reading input from stdin #1700

rhysd opened this issue Jan 26, 2022 · 0 comments · Fixed by #1701

Comments

@rhysd
Copy link
Contributor

rhysd commented Jan 26, 2022

Current interface of naga-cli is as follows:

naga [OPTIONS] INPUT [OUTPUT...]

Since INPUT must be specified, the input file must exist in filesystem.

Since the input validation while editing shader program is great for those who are not familiar with WGSL like me. I'm considering to run naga command in a text editor on the fly.

However, while editing a source, the source text is not written to a file yet. It is only on memory of the text editor.

I suppose there are two possible solutions.

  1. naga supports reading input from stdin (INPUT argument will be optional). A text editor can pass the current source via stdin
  2. A text editor writes the current source to a temporary file and pass the path to naga

Cons of 1. is that it needs new implementation.
Cons of 2. is that it requires overhead of writing source to temporary file. The file path is different from actual file path being edited.

I think 1. is cleaner and faster.

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 a pull request may close this issue.

1 participant