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

[Migrated] Infrastructure for using ShaderToy as a test corpus #66

Open
rust-gpu-bot opened this issue Nov 13, 2024 · 5 comments
Open

Comments

@rust-gpu-bot
Copy link

Issue automatically imported from old repo: EmbarkStudios/rust-gpu#1104
Old labels: mcp: proposed
Originally creatd by LegNeato on 2023-11-27T17:58:09Z 👍: 2


Proposal

Create infrastructure that translates (working) shadertoy shaders into rust-gpu (and runs?). This would make it so we have a sort of burndown chart a la https://github.com/uutils/coreutils#gnu-test-suite-compatibility and https://boajs.dev/boa/test262/ and stress test different parts of rust-gpu. Implementing enough to flip a shader from not working to working may be an easier place for contributors to start, and seeing shaders work is neat!

Feasibility

The shadertoy api looks pretty straightforward to implement from the runner side: https://www.shadertoy.com/howto.

I'm not sure how easy the transpiling will be, but there is https://github.com/phaazon/glsl/tree/master/glsl/src/transpiler and spot checks on some shadertoy shaders doesn't look too crazy. We could probably allowlist or denylist.

Implementation

I wanted to open this for comments before starting on an implementation.

@rust-gpu-bot
Copy link
Author

Comment from LegNeato (CONTRIBUTOR) on 2023-11-27T20:56:11Z


Related: EmbarkStudios/rust-gpu#1096

@rust-gpu-bot
Copy link
Author

Comment from LegNeato (CONTRIBUTOR) on 2023-12-09T03:29:53Z


I hand ported three shaders from shadertoy...I think automating this is doable for most of the image shaders. It would be cool to have a harness that compares rendering results.

@rust-gpu-bot
Copy link
Author

Comment from LegNeato (CONTRIBUTOR) on 2023-12-09T03:31:54Z


Example, which works with mouse too:
Screenshot 2023-12-08 at 11 27 42 PM

Ported from https://www.shadertoy.com/view/DlGfzh. Code in https://github.com/LegNeato/rust-gpu/tree/fork-shield

@rust-gpu-bot
Copy link
Author

Comment from LegNeato (CONTRIBUTOR) on 2024-01-09T22:16:59Z


Update: I have a WIP PR to make naga translate to rust.

@rust-gpu-bot
Copy link
Author

Comment from LegNeato (CONTRIBUTOR) on 2024-03-26T20:20:31Z


Update: I have a WIP differential harness that compares the original shadertoy shader and the converted rust shader's output.

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

No branches or pull requests

1 participant