In `naga::valid::interface::VaryingContext::validate`, use `let else`
instead of `match`, to promote the main flow of control to a lower
indentation level, and move error reporting closer to the check that
failed.
Fixes a regression introduced by #8265 where we were mistakenly writing a comma before the first buffer argument (if no other arguments were printed before it).
Delete the `naga::path_like` module, and simply using `String` and
`str` instead.
Nothing in Naga uses `Path` or `PathBuf` methods; indeed, Naga only
converts these values back and forth from string-like types with
`to_string_lossy` and `into`, such that using string-like, rather than
path-like, types actually simplifies the code.
This also avoids dead code warnings starting in Rust 1.89 that would
otherwise require distracting `#[cfg_attr]` conditionals.
Escape non-ASCII identifier characters with `write!(…, "u{:04x}", …)`,
surrounding with `_` as appropriate. This solves (1) a debugging issue
where stripped characters would otherwise be invisible, and (2) failure
to re-validate that stripped identifiers didn't start with an ASCII
digit.
I've confirmed that this fixes [bug
1978197](https://bugzilla.mozilla.org/show_bug.cgi?id=1978197) on the
Firefox side.
* Features and draw commands added
* Tried to implement the pipeline creation (completely untested)
* Fixed clippy issues
* Fixed something I think
* A little bit of work on the mesh shader example (currently doesn't work on dx12)
* Reached a new kind of error state
* Fixed an alignment issue
* DirectX 12 mesh shaders working :party:
* Removed stupid change and updated changelog
* Fixed typo
* Added backends option to example framework
* Removed silly no write fragment shader from tests to see if anything breaks
* Tried to make mesh shader tests run elsewhere too
* Removed printlns and checked that dx12 mesh shader tests run
* Documented very strange issue
* I'm so lost
* Fixed stupid typos
* Fixed all issues
* Removed unnecessary example stuff, updated tests
* Updated typos.toml
* Updated limits
* Apply suggestion from @cwfitzgerald
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Apply suggestion from @cwfitzgerald
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Removed supported backends, made example & tests always pass the filename to shader compilers
* Removed excessive bools in test params
* Added new tests to the list
* I'm a sinner for this one (unused import)
* Replaced random stuff with test params hashing
* Updated typos.toml
* Updated -Fo typo thing
* Actually fixed typo issue this time
* Update CHANGELOG.md
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Update tests/tests/wgpu-gpu/mesh_shader/mod.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update wgpu-hal/src/dx12/mod.rs
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Addressed comments
* Lmao
---------
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
In order to support external textures, we must be able to map a single
external texture resource binding to multiple Vulkan descriptors. This
means we must be able to override the `Binding` and `DescriptorSet`
values for global variables when generating SPIR-V, rather than simply
passing through the group and binding values from Naga IR.
This patch extends the existing SPIR-V Naga backend's `BindingMap` to
contain a descriptor set and binding value in addition to the existing
array size. When creating BindGroupLayouts/BindGroups we use a
sequentially incrementing value for each entry's binding value,
continuing to just use the bind group index as the descriptor set
value.
The Naga backend looks up each resource in the map when emitting its
`Binding` and `DescriptorSet` decorations. If the entry cannot be
found in the map, it will either error or emit fake bindings based on
its configuration.
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>
This adds MSL backend support for `ImageClass::External`. (ie WGSL's
`external_texture` texture type). This is implemented very similarily
to the HLSL implementation in #7826.
Each external texture global variable is lowered to 3 `texture2d`s and
a buffer of type NagaExternalTextureParams. As usual in Naga's MSL
backend, these are passed as arguments to the entry point. The
bindings for each of these arguments are provided via the usual
binding map, using a new `BindExternalTextureTarget` variant of
`BindTarget`.
Unlike HLSL, MSL allows textures to be used as fields in structs. We
therefore immediately wrap these variables in a
`NagaExternalTextureWrapper` struct. This wrapper can then
conveniently be passed to either user-defined functions or builtin
implementations that accept an external texture.
The WGSL builtins `textureDimensions()`, `textureLoad()`, and
`textureSampleBaseClampToEdge()` are implemented using wrapper
functions using the regular `write_wrapped_functions()` machinery.
The HLSL external texture implementation didn't have to do anything in
particular to handle both coordinate types, as int2 automatically gets
promoted to uint2. But in MSL this is not the case, and it is
therefore important to test that we correctly handle both coordinate
types.