Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Update API for new wgpu gl backend support#10

Merged
bors[bot] merged 3 commits intogfx-rs:masterfrom
kyren:wgpu-gl
Jun 8, 2019
Merged

Update API for new wgpu gl backend support#10
bors[bot] merged 3 commits intogfx-rs:masterfrom
kyren:wgpu-gl

Conversation

@kyren
Copy link
Copy Markdown
Contributor

@kyren kyren commented May 20, 2019

This won't work until this pr is merged in wgpu, but at least this way we can discuss it.

@kyren
Copy link
Copy Markdown
Contributor Author

kyren commented May 21, 2019

If you want to try this out locally, you'll need a copy of this wgpu pr and this gfx pr locally, and you'll need to adjust their dependencies to point to the local copies.

If you do this, the demos currently mostly work except the colors are off, and the shadow demo currently looks like this:

image

I'm currently in the process of figuring out how the shadow demo is broken.

@msiglreith
Copy link
Copy Markdown

Cool!
I'm unable to get the example running locally but a potential error cause could be the clipspace difference between vulkan and opengl for the z dimension. There is probably an option in the spirv cross translator which allows to adjust it accordingly. Only GL 4.5+ allows to control the clip settings to natively support Vulkan's design decision iirc

@kvark
Copy link
Copy Markdown
Member

kvark commented May 24, 2019

@msiglreith so that would be an issue in gfx-backend-gl, not any of the wgpu crates. Did you ever try running gfx_ocean on GL, out of curiosity? I imagine our current examples in gfx-rs are too primitive to cover this.

@kyren
Copy link
Copy Markdown
Contributor Author

kyren commented May 24, 2019

@msiglreith so that would be an issue in gfx-backend-gl, not any of the wgpu crates.

It's kind of my fault for bringing up the shadow demo, all of the problems there are of course because of gfx-backend-gl, but the wgpu-rs demos are just complex enough that they actually start pushing its boundaries.

I'm unable to get the example running locally but a potential error cause could be the clipspace difference between vulkan and opengl for the z dimension. There is probably an option in the spirv cross translator which allows to adjust it accordingly.

I'll try and test that theory!

I think now you'll have to adjust Cargo.toml again to get this PR to run, or you might actually have to clone the three PRs (gfx-backend-gl, wgpu, wgpu-rs) locally and add a patch section to Cargo.toml for them all... it's a bit of a mess atm.

@kvark
Copy link
Copy Markdown
Member

kvark commented May 24, 2019

@kyren since the dependent PR is merged, could you rebase and make this a non-draft PR please?

@kyren kyren changed the title [DRAFT] Update API for new wgpu gl backend support Update API for new wgpu gl backend support May 24, 2019
@kyren kyren changed the title Update API for new wgpu gl backend support [DRAFT] Update API for new wgpu gl backend support May 24, 2019
@kyren kyren changed the title [DRAFT] Update API for new wgpu gl backend support Update API for new wgpu gl backend support May 24, 2019
@kyren
Copy link
Copy Markdown
Contributor Author

kyren commented May 24, 2019

Okay, this is rebased and now points to current wgpu master, but there's a drive-by wgpu API compatibility change in it.

Also, none of the examples will work at all until this pr is merged.

@kvark
Copy link
Copy Markdown
Member

kvark commented May 24, 2019

Oh, my apologies - didn't realize it's waiting for me!
On the way to merging now. I suppose we'd have to bump the gfx-rs dependency in wgpu-native before proceeding.

@kyren
Copy link
Copy Markdown
Contributor Author

kyren commented May 24, 2019

On the way to merging now. I suppose we'd have to bump the gfx-rs dependency in wgpu-native before proceeding.

Yeah, though now that the wgpu change is merged this will at least build cleanly, it's just not that useful without the gfx-hal PR... though one could argue that even with the gfx-hal PR it's probably still limited. I guess now that the wgpu PR is merged the specific order of all these things is not too critical.

@kvark
Copy link
Copy Markdown
Member

kvark commented Jun 6, 2019

@kyren would you want to rebase and finish this PR?

@kyren
Copy link
Copy Markdown
Contributor Author

kyren commented Jun 6, 2019

Okay, I've rebased the PR. I don't think the examples will work out of the box until some of the gfx-backend-gl changes are updated in cargo, but that's not blocking this.

As soon as I'm at my desk I'll check to make sure that the examples still work as I left them when overriding gfx-backend-gl to point to the master branch.

@kyren
Copy link
Copy Markdown
Contributor Author

kyren commented Jun 6, 2019

Well, if you pick the correct git commit for gfx, the hello-triangle example will work, but there are other new problems with the other examples due to wgpu changes I think (hitting this panic, maybe due to rendy changes?).

That isn't blocking this PR though, I just don't want anybody reading this to think it will work out of the box just yet.

When I get back to doing graphics work again I'll take a fresh look at getting wgpu-rs / wgpu / gfx-backend-gl working again to the same state I had it at least.

@grovesNL
Copy link
Copy Markdown
Collaborator

grovesNL commented Jun 6, 2019

@omni-viral encountered that panic while testing the GL backend with rendy too - need to decide on a workaround

@kvark
Copy link
Copy Markdown
Member

kvark commented Jun 7, 2019

We need to file this upstream in gfx-rs first and discuss there...
Edit: filed gfx-rs/gfx#2812

@kvark
Copy link
Copy Markdown
Member

kvark commented Jun 8, 2019

That being said, we can still land this as soon as you consider it ready ;)

@kyren
Copy link
Copy Markdown
Contributor Author

kyren commented Jun 8, 2019

I think it's ready. The actual changes to the wgpu-rs library itself are pretty minimal, most of this PR is just fixing the examples to optionally use glutin.

@kvark
Copy link
Copy Markdown
Member

kvark commented Jun 8, 2019

bors r+

bors bot added a commit that referenced this pull request Jun 8, 2019
10: Update API for new wgpu gl backend support r=kvark a=kyren

This won't work until [this pr](gfx-rs/wgpu#183) is merged in wgpu, but at least this way we can discuss it.

Co-authored-by: kyren <kerriganw@gmail.com>
@bors
Copy link
Copy Markdown
Contributor

bors bot commented Jun 8, 2019

Build succeeded

@bors bors bot merged commit 9faa01a into gfx-rs:master Jun 8, 2019
rukai pushed a commit to rukai/wgpu-rs that referenced this pull request Jun 16, 2019
10: Generate C header r=kvark a=grovesNL

Fixes gfx-rs#6

~~WIP: there are a few issues I've encountered already for the few functions we expose.~~

Co-authored-by: grovesNL <josh@joshgroves.com>
Co-authored-by: Joshua Groves <josh@joshgroves.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants