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

Add SHADERINT_16 feature to allow 16bit ints in Vulkan shaders #3401

Merged
merged 5 commits into from
Feb 2, 2023

Conversation

Elabajaba
Copy link
Contributor

@Elabajaba Elabajaba commented Jan 19, 2023

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Stops Vulkan Validation errors for FSR2 when using https://github.com/JMS55/fsr2_wgpu (currently very much a WIP).

Description
This just enables the Vulkan shader_int16 device feature if the feature is requested. I copied how it seems to be done for SHADER_FLOAT64.

According to the docs, this isn't an extension and is part of vulkan 1.0 VkPhysicalDeviceFeatures. I don't know if anything doesn't support this feature, so I'm wondering if it should be enabled by default? Did some more digging on https://vulkan.gpuinfo.org/ and it isn't nearly as universal as I thought.

Testing
Tested using bevy+fsr2, it stopped the validation errors about 16bit ints.

@Elabajaba Elabajaba requested a review from crowlKats as a code owner January 19, 2023 00:36
Copy link
Collaborator

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

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

don't forget to update deserialize_features in deno_webgpu/src/lib.rs, and update the GPUFeatureName enum in deno_webgpu/src/02_idl_types.js

@teoxoy
Copy link
Member

teoxoy commented Jan 19, 2023

Wanted to mention that I filed #3406; not a blocker for this PR but something to put on our radar.

@Elabajaba
Copy link
Contributor Author

Elabajaba commented Jan 20, 2023

don't forget to update deserialize_features in deno_webgpu/src/lib.rs, and update the GPUFeatureName enum in deno_webgpu/src/02_idl_types.js

Does the GPUFeatureName enum in deno_wgpu/webgpu.idl also have to be updated?

edit: Also, is i16 support considered to be extended from spec?

edit2: To answer my own question, it looks like webgpu.idl shouldn't be updated, and it should be considered an extension of the spec.

Does deno_webgpu want what are potentially native only features?

@crowlKats
Copy link
Collaborator

Does deno_webgpu want what are potentially native only features?

yes; if my memory serves right, the spec states that the implementer can extend the standard set of features. we just allow all features that wgpu has, because why not.

@Elabajaba
Copy link
Contributor Author

I think this should be done now.

@crowlKats
Copy link
Collaborator

thanks!

Copy link
Collaborator

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

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

Deno part looks good to me.

@crowlKats crowlKats dismissed their stale review January 21, 2023 03:00

requested changes have been made

wgpu-types/src/lib.rs Outdated Show resolved Hide resolved
Elabajaba and others added 2 commits February 2, 2023 01:41
Co-authored-by: Connor Fitzgerald <[email protected]>
@cwfitzgerald cwfitzgerald enabled auto-merge (squash) February 2, 2023 01:52
@cwfitzgerald cwfitzgerald merged commit c5e2f5a into gfx-rs:master Feb 2, 2023
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.

4 participants