-
Notifications
You must be signed in to change notification settings - Fork 547
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
Add WebGPU backend #3231
Add WebGPU backend #3231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an autogenerated code review, only first 25 of 88 new suggestions are shown
The .monocodus
config not found in your repo. Default config is used.
Check config documentation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an autogenerated code review, new suggestions: 7
The .monocodus
config not found in your repo. Default config is used.
Check config documentation here
Oh wow, you are attacking this task, this is great news! So the main goal of this backend is to target the Web. This means, we don't care in particular about Now, if you just try to link to Does that make sense? @grovesNL can correct if I said this wrong. |
Yeah, makes sense. I will look into switching to The only problem I've encountered so far, is that some of the |
That's one of the architectural blockers to resolve, it could be a serious issue. |
@kvark we won't be able to use |
Does this mean we'll have to modify the |
No, we aren't going to modify gfx-hal API here. |
I'm not sure of the best way to handle this, some options could be:
Maybe there are other ways to handle this? |
The easiest solution for now seems to be to expose separate entry points specific for WebGPU (at least temporarily, until a better solution is proposed). I could make the Would that be acceptable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an autogenerated code review, new suggestions: 20
The .monocodus
config not found in your repo. Default config is used.
Check config documentation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an autogenerated code review, new suggestions: 21
The .monocodus
config not found in your repo. Default config is used.
Check config documentation here
@GabrielMajeri this would let you to proceed and get something working. Similar to how we have OpenGL API somewhat working but requiring application changes for a while (but no more). When we find a proper solution for async, we wouldn't need to scrap a lot of code, so there is nothing to lose if we go this direction here. |
@kvark Alright, I've started work on that. Would it be OK to get this merged as-is (since its just boilerplate code), and add instance creation in the next PR, for easier review? |
Yeah, as long as CI is happy :) |
Ok! I've looked at the logs for the failing build. It seems to be an ICE on nightly: error: internal compiler error: src/librustc_mir/interpret/validity.rs:396:
Unexpected error during ptr inbounds test: cannot read from foreign (extern) static DefId(0:40 ~ dispatch[5c52]::ffi[0]::[0]::_dispatch_queue_attr_concurrent[0]) I'll see if it's already reported. |
@GabrielMajeri also, let's please rename this to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an autogenerated code review, new suggestions: 20
The .monocodus
config not found in your repo. Default config is used.
Check config documentation here
@kvark Noted, renamed everything from |
I'm disabling monocodus warnings in #3234. Sorry about the mess it makes! |
bors try |
tryBuild failed: |
Looks like the nightly failure will be fixed in the next nightly... |
bors try |
tryBuild failed: |
@GabrielMajeri sorry, looks like it needs to be updated now that Mesh shaders have landed. It should be fairly straightforward though. Would you mind rebasing and updating it?
|
No problem, fixed now. |
bors r+ |
Build succeeded: |
This PR adds a WebGPU backend for
gfx-hal
, making some progress towards #3027.I've currently gotten the backend to compile. Further additions will come in future PRs.