Skip to content

Conversation

VZout
Copy link
Member

@VZout VZout commented Oct 22, 2020

Up to y'all if you want this in.
Just copy pasted the wgpu example and made it rusty.

Mainly just wrote it so I can patch it into main locally for testing.

Fix #65

@khyperia
Copy link
Contributor

oh my gosh, I can actually, read the entire example-runner program without my eyes glazing over, that's incredible

@VZout
Copy link
Member Author

VZout commented Oct 22, 2020

Not only that it also runs in the browser!

@expenses
Copy link
Contributor

The Cargo.toml for the runner seems to be out of date with main.rs because wasm-bindgen-futures isn't listed as a dependency.

@repi
Copy link
Contributor

repi commented Oct 22, 2020

Wait we don't need a different shader right? Can just use the same one.

And then maybe call it example-runner-wgpu and example-runner-ash?

@DJMcNab
Copy link
Contributor

DJMcNab commented Oct 22, 2020

I've mostly made it work with the old shader in https://github.com/DJMcNab/rust-gpu/tree/wgpu-example, although the output I get is upside down. I'm not sure why that is 🤔.

Thanks to the people on the discord for helping me get it this far.

@VZout
Copy link
Member Author

VZout commented Oct 22, 2020

Wait we don't need a different shader right? Can just use the same one.

And then maybe call it example-runner-wgpu and example-runner-ash?

We don't but I made this more for myself since I want a tiny as possible shader for my own testing. This I can just patch into my branches and test/debug easily.

VZout and others added 16 commits October 24, 2020 00:00
* Fixed nested if statements

* feedback

* Removed a line
* Add bug report template

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Ari V <[email protected]>

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Ari V <[email protected]>

* Update bug_report.md

* Update bug_report.md

Co-authored-by: Ari V <[email protected]>
This should mean that if one of the required components is broken on a
given nightly, rustup will try going backwards until it finds one which
works.
* Initial commit for binding proposal, nees some cleanup

* Continue at home

* Explain global binding model

* Explain function binging model

* Final suggestion

* Add more ups & downs

* Add another downside to static

* Add another downside to static
@repi
Copy link
Contributor

repi commented Oct 24, 2020

On my Windows machine the wgpu-example-runner example works, but on my Mac I just get the following when running which is rather odd:

[0.902503 ERROR]()(no module): Function retrieval error "Function \'main_vs\' does not exist"
[0.902600 ERROR]()(no module): Invalid shader entry point 'main_vs': InvalidEntryPoint
thread 'main' panicked at 'failed to create graphics pipeline: Failed to create pipeline: Unsupported usage: Implementation specific error occurred', /Users/johan/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.6.5/src/device/mod.rs:2898:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Not really sure at all why it would be failing to find even the entrypoint of the shader

@grovesNL
Copy link
Contributor

@repi this seems to be a bug, we'll fix it in gfx-rs/gfx#3435

@grovesNL
Copy link
Contributor

@repi we just published a patch release, so this should work fine after updating with cargo update or cargo update -p gfx-backend-metal

@repi
Copy link
Contributor

repi commented Oct 27, 2020

@grovesNL awesome thx, will try out!

Update: worked!

@repi repi requested a review from fu5ha October 27, 2020 01:01
Copy link
Contributor

@repi repi left a comment

Choose a reason for hiding this comment

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

Works with Mac now, yay! And merged it with the latest changes.

Think we should get this in! And once it is merged we could do some renaming & moving things around a bit.

"examples/example-shader",
"examples/wgpu-example-shader",
Copy link
Member

Choose a reason for hiding this comment

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

Adding a comment here, one thing that I would change but I think could be done after merging, is to rename this shader to something like hello-world-shader or simplest-shader or something to that effect, since it shouldn't really be specific to wgpu.

Copy link
Contributor

Choose a reason for hiding this comment

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

fully agree!

I was thinking that the current example-shader would become more, well simply, shaders with a set of non-trivial shaders like the current sky one and more in the same crate.

but also very good then to have a super simple separate crate that is easier to iterate on with fewer dependencies and features. esp. soon when glam gets in #149

Copy link
Member

@fu5ha fu5ha left a comment

Choose a reason for hiding this comment

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

With the caveat of my one comment, think this seems fine to merge for now... I can take stewardship of making this a little more integrated with the other example(s) afterwards. I would like to get #109 merged as well which then paves the way for the wgpu runner to run the sky example.

@repi repi merged commit 27df71f into main Oct 27, 2020
@repi repi deleted the wgpu-example branch October 27, 2020 01:39
@@ -46,6 +46,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
- run: brew install spirv-tools
Copy link
Contributor

Choose a reason for hiding this comment

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

wait what? this should have excluded wgpu-example-runner in the clippy run, not installing spirv-tools, right? either that or including example-runner in the clippy run

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure what you mean?

Did get clippy build failures on this branch on that spirv-tools was missing

Copy link
Contributor

Choose a reason for hiding this comment

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

Why would you use brew on a linux job?

Copy link
Member

Choose a reason for hiding this comment

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

@bjorn3 It's the only package manager with spirv-tools on linux that is available in GitHub Actions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why would you use brew on a linux job?

See also #107

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.

Add example using gfx-hal or wgpu