-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Require new F16_IN_F32
downlevel flag for quantizeToF16
, pack2x16float
, and unpack2x16float
in WGSL input
#8130
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
Conversation
I guess maybe this should be a downlevel flag? |
Yes, it sounds more appropriate. |
6d83ae5
to
b644274
Compare
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.
LGTM! I had a couple of things that should be easy to resolve.
I used Conventional Comments in this review! I hope they help with clarity and tone. 🙂
naga/tests/in/wgsl/bits.toml
Outdated
@@ -1,3 +1,5 @@ | |||
god_mode = true # requires F16_IN_F32 |
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.
thought: It's very unfortunate that we haven't split god_mode
into different bits of configuration yet. Not something to handle here, but *sigh in idealist*.
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.
I agree, this is unfortunate, and isn't really that much effort to fix, but I was trying to avoid scope creep on this change. (Also, I think there are other pending changes to tests to reuse some of the "toml test attributes" infrastructure in more places, which seems like a reason to put this off until it can be done with less risk of conflicts.)
Filed #8154 for this.
F16_IN_F32
capability for pack/unpack/quantize f16F16_IN_F32
downlevel flag for quantizeToF16
, pack2x16float
, and unpack2x16float
F16_IN_F32
downlevel flag for quantizeToF16
, pack2x16float
, and unpack2x16float
F16_IN_F32
downlevel flag for quantizeToF16
, pack2x16float
, and unpack2x16float
in WGSL input
…8130) Although the operation of these functions is defined in terms of f16 semantics, the input/output types are not f16, and they are generally available even when native `f16` support is not. But in at least one case, they are only available with `f16` support, so add a new downlevel flag that is cleared when these functions are not available. Add some infrastructure to simplify testing of missing capabilities/extensions, and add tests for a few more kinds of f16 usage. Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
wgpu-hal/src/vulkan/adapter.rs
Outdated
@@ -1696,6 +1696,15 @@ impl super::Instance { | |||
); | |||
}; | |||
|
|||
if info.driver_info.contains("Mesa ") { |
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.
From meeting: decide if we should narrow this condition.
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.
I narrowed it to look for driver == "llvmpipe"
.
I also noticed that the gles and vulkan backends aren't written to set newly-defined downlevel flags by default, maybe they should be? And regardless of that, should the gles backend enable F16_IN_F32?
Although the operation of these functions is defined in terms of f16 semantics, the input/output types are not f16, and they are generally available even when native `f16` support is not. But in at least one case, they are only available with `f16` support, so add a new downlevel flag that is cleared when these functions are not available. Add some infrastructure to simplify testing of missing capabilities/extensions, and add tests for a few more kinds of f16 usage. Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
Although the operation of these functions is defined in terms of f16 semantics, the input/output types are not f16, and they are generally available even when native
f16
support is not. But in at least one case, they are only available withf16
support, so add a new capability that decides whether these functions are available.Add some infrastructure to simplify testing of missing capabilities/extensions, and add tests for a few more kinds of f16 usage.
Testing
Adds tests in the
wgsl_errors
suite. Updates some snapshot tests to declare the new capability. Rename one glsl snapshot test that already had "glsl" in the name before the change was made to always rename snapshot outputs to include the source format.Squash or Rebase? Rebase
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.