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

Add Extension/Limit Interface #338

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

cwfitzgerald
Copy link
Member

@cwfitzgerald cwfitzgerald commented Jun 1, 2020

Follow up to gfx-rs/wgpu#690.

This forwards the extension/limit access interface into wgpu-rs.

It appears that the web-sys doesn't actually implement any of the methods we need, so I had them return the defaults. Device::limits exists, but it returns Object not GpuLimits, so doesn't appear usable.

@cwfitzgerald cwfitzgerald marked this pull request as draft June 1, 2020 05:47
bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jun 1, 2020
690: Implement Anisotropic Filtering Extension and Expose Extension Interface r=kvark a=cwfitzgerald

**Connections**

Resolves #568.

**Description**

This PR solves two tightly related problems:
 - Adds the ability to create a sampler with anisotropic filtering
 - Adds the webgpu interface for getting the limits/extensions on adapters and devies.

**Testing**

I have tested this against my codebase which uses it. Adding an example in wgpu-rs on how to use extensions/limits would be good, especially as we have native/webgpu extensions, but can come as a future enhancement, once we feel the extension situation has stabilized a bit.

**TODO**

- [x] Allow wgpu-rs to call limit/extension interface (gfx-rs/wgpu-rs#338)
- [ ] Determine how wgpu-native is going to adopt this functionality.
- [ ] After discussing #691, what changes need to be made. 

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
bors bot added a commit to gfx-rs/wgpu that referenced this pull request Jun 1, 2020
690: Implement Anisotropic Filtering Extension and Expose Extension Interface r=kvark a=cwfitzgerald

**Connections**

Resolves #568.

**Description**

This PR solves two tightly related problems:
 - Adds the ability to create a sampler with anisotropic filtering
 - Adds the webgpu interface for getting the limits/extensions on adapters and devies.

**Testing**

I have tested this against my codebase which uses it. Adding an example in wgpu-rs on how to use extensions/limits would be good, especially as we have native/webgpu extensions, but can come as a future enhancement, once we feel the extension situation has stabilized a bit.

**TODO**

- [x] Allow wgpu-rs to call limit/extension interface (gfx-rs/wgpu-rs#338)
- [ ] Determine how wgpu-native is going to adopt this functionality.
- [ ] After discussing #691, what changes need to be made. 

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
@cwfitzgerald cwfitzgerald force-pushed the anisotropic-filtering branch from ee868f1 to e189d0d Compare June 1, 2020 17:04
@cwfitzgerald cwfitzgerald marked this pull request as ready for review June 1, 2020 17:07
@cwfitzgerald cwfitzgerald force-pushed the anisotropic-filtering branch from e189d0d to c4819cc Compare June 1, 2020 17:09
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

Thank you!
bors r+

@@ -130,6 +130,7 @@ impl framework::Example for Skybox {
lod_min_clamp: 0.0,
lod_max_clamp: 100.0,
compare: wgpu::CompareFunction::Undefined,
anisotropy_clamp: 1,
Copy link
Member

Choose a reason for hiding this comment

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

I think we should change most (if not all) sampler descriptors to end with .. Default::default(). That would be more future proof, match the web better, and avoid exposing stuff that is not relevant

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. Should I change this in this PR? Or should that be separate?

Copy link
Member

Choose a reason for hiding this comment

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

let's have this merged, the PR just continues the convention of the old code, it's not required to change that

@bors
Copy link
Contributor

bors bot commented Jun 1, 2020

@bors bors bot merged commit 50d1eb6 into gfx-rs:master Jun 1, 2020
bors bot added a commit that referenced this pull request Jun 3, 2020
345: Rustify the example's use of Extensions and SamplerDescriptor r=kvark a=cwfitzgerald

Implements gfx-rs/wgpu#696.

This didn't change any content from #338, just interface, but I tested a couple examples and it seems to work okay.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
bors bot added a commit that referenced this pull request Jun 3, 2020
345: Rustify the example's use of Extensions and SamplerDescriptor r=kvark a=cwfitzgerald

Implements gfx-rs/wgpu#696.

This didn't change any content from #338, just interface, but I tested a couple examples and it seems to work okay.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.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.

2 participants