Closes#7481.
This implementation roughly follows approach 2 outlined in #7481, i.e.,
it adds a polyfill for the signed and unsigned dot product of packed
vectors for each platform. It doesn't use the specialized instructions
that are available for this operation on SPIR-V (with capability
DotProductInput4x8BitPacked).
* init files, dir structure
* wip: it's working need to suss out the readme and some of the consts...
* ok that's probably good enough for a first pass...
* chore: spelling
* chore: readme tweaks
* chore: clippy and fmt
* chore: add self and changes to changelog.md
* fix: typo and remove env_logger via cfg flag for wasm builds (which this doesn't supprot anyway)
* refactor: bring inline with newer wgpu
* refactor: bring inline with newer wgpu
* chore: work on the readme a bit...
* refactor: remove a bunch of everything, be simple
* wip: get a test going
* wip: remove unrequired pub(s)...
* refactor: remove a bunch of everything, be simple
wip: get a test going
* wip: remove unrequired pub(s)...
wip: remove unrequired pub(s)...
* chore: cleanups, typos, simplifying
* chore: reconcile changelog diffs
* fix: re-add our change to the changelog
* wip: finess the docs a bit per request...
* chore: trying to get the woring right...
* chore: trying to get the woring right...
* fix: typos
* fix: spelling
* Update mod.rs
swap all loops over to 'for' by request.
Flume's sender is already Send/Sync
chunks will already split for us
.unwraps() unwraps everywhere!
* Update CHANGELOG.md
Co-authored-by: Jim Blandy <jimb@red-bean.com>
* 1GB as the example says we'll do
- 1GB as the example says we'll do
- update readme for windows users.
* init files, dir structure
* wip: it's working need to suss out the readme and some of the consts...
* ok that's probably good enough for a first pass...
* chore: spelling
* chore: readme tweaks
* chore: clippy and fmt
* chore: add self and changes to changelog.md
* fix: typo and remove env_logger via cfg flag for wasm builds (which this doesn't supprot anyway)
* refactor: bring inline with newer wgpu
* refactor: bring inline with newer wgpu
* chore: work on the readme a bit...
* refactor: remove a bunch of everything, be simple
* wip: get a test going
* wip: remove unrequired pub(s)...
* wip: remove unrequired pub(s)...
wip: remove unrequired pub(s)...
* chore: cleanups, typos, simplifying
* fix: re-add our change to the changelog
* wip: finess the docs a bit per request...
* chore: trying to get the woring right...
* chore: trying to get the woring right...
* fix: typos
* fix: spelling
* Update mod.rs
swap all loops over to 'for' by request.
Flume's sender is already Send/Sync
chunks will already split for us
.unwraps() unwraps everywhere!
* Update CHANGELOG.md
Co-authored-by: Jim Blandy <jimb@red-bean.com>
* 1GB as the example says we'll do
- 1GB as the example says we'll do
- update readme for windows users.
* bring up to date with trunk
sync with trunk.
make more of Jim's changes
* some of the consts have changed name.
* small tweaks
* what is the flag called now?
what is the flag called now?
* Update shader.wgsl
naming things betterer
* Update README.md
reword readme
* Update README.md
simplify readme
* Update mod.rs
remove unused
* well at least it compiles again
* BUG: ... it seems to run forever and never complete.
* nicer shader module creation
* ... add logging to track down infinite hangtime...
* use 2 buffers in the test
* test and example pass (now they do the same number of buffers..
* that's better...
* fix: remove duplicate entries
* fix: whitespace
* move changelog entry to #unreleased per request
* fix: target_arch != wasm to satiate pipeline
* fix: target_arch != wasm to satiate pipeline
* pipeline want's us to allow allows...
* savage hacks to make the wasm build ignore our test
* fix: allow the allowing of allows that allow the dead_code.
* Fix: no tests on wasm
---------
Co-authored-by: Jim Blandy <jimb@red-bean.com>
The types remain available at their original paths by `pub use ir::*`.
This may or may not be a temporary measure for migration.
The only changes to the moved code are:
* Fixing doc links.
* Moving `pub use block::Block` to the top.
This is a useful shortcut for tests and example code, allowing it to
create a noop device without needing to deal with nonexistent
fallibility and asynchrony.
This will help users determine whether the problem is:
* a backend is not statically enabled
* a backend is not dynamically enabled
* no drivers or physical adapters are present for that backend
(further distinction would be useful here)
* no adapters met the required criteria
There are deficiencies in the reporting of WebGPU vs. WebGL support.
Those would best be fixed by also fixing the mutual exclusion of those
backends.
Makes the dual source implementation in wgpu WebGPU spec compliant.
Furthermore, makes the dual source blending extension available when targeting WebGPU.
This allows abstract-typed expressions to be used for some or all of
the switch selector and case selectors. If these are all not
convertible to the same concrete scalar integer type we return an
error. If all the selector expressions are abstract then they are
concretized to i32.
The note previously provided by the relevant error message, suggesting
adding or removing the `u` suffix from case values, has been
removed. While useful for simple literal values, it was comically
incorrect for more complex case expressions. The error message should
still be useful enough to allow the user to easily identify the
problem.
When the user provides values for a module's overrides, rather than
replacing override-sized array types with ordinary array types (which
could require adjusting type handles throughout the module), instead
edit all overrides to have initializers that are fully-evaluated
constant expressions. Then, change all backends to handle
override-sized arrays by retrieving their overrides' values.
For arrays whose sizes are override expressions, not simple references
to a specific override's value, let front ends built array types that
refer to anonymous overrides whose initializers are the necessary
expression.
This means that all arrays whose sizes are override expressions are
references to some `Override`. Remove `naga::PendingArraySize`, and
let `ArraySize::Pending` hold a `Handle<Override>` in all cases.
Expand `tests/gpu-tests/shader/array_size_overrides.rs` to include the
test case that motivated this approach.
Instead allow the const to be converted each time it is const
evaluated as part of another expression. This allows an abstract const
to be used as a different type depending on the context.
As a result, abstract types may now find their way in to the IR, which
we don't want. This occurs because the compact pass treats named
expressions as used, mostly so that our snapshot tests are more
useful, and therefore does not remove them. To prevent this, we avoid
adding abstract-typed local consts to the named expressions list. This
will have no functional effect on any shaders produced by the
backends, but some unused local const declarations will no longer be
present.
* Initial(untested commit), vulkan and gles only supported
* Maybe fixed compiles for metal and dx12
* Hopefully fixed compiles for other backends and updated to functional(?) vulkan thing
* Fixed the clippy warning
* Fixed silly documentation mistake
* Fixed issue with multiview feature
* Dummy commit for dummy CI
The CI pooped itself, hopefully this fixes that. Will probably be undone either way.
* Re trigger CI checks, to avoid #7126
* Changes based on code review
* Fixed clippy warning, broken cargo.lock
* Unfucked cargo.lock for real this time
* Switched match to if-let in accordance with review
* Updated changelog
* Fix CI error
Done from web out of impatience
* CI is very angry 😡
Made CI less angry by fixing formatting(hopefully). This commit was also done from GitHub web.
* Removed comment in following request
* Update wgpu-hal/src/vulkan/adapter.rs
---------
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
If it is undefined behaviour for loops to be infinite, then, when
encountering an infinite loop, downstream compilers are able to make
certain optimizations that may be unsafe. For example, omitting bounds
checks. To prevent this, we must ensure that any loops emitted by our
backends are provably bounded. We already do this for both the MSL and
HLSL backends. This patch makes us do so for SPIRV as well.
The construct used is the same as for HLSL and MSL backends: use a
vec2<u32> to emulate a 64-bit counter, which is incremented every
iteration and breaks after 2^64 iterations.
While the implementation is fairly verbose for the SPIRV backend, the
logic is simple enough. The one point of note is that SPIRV requires
`OpVariable` instructions with a `Function` storage class to be
located at the start of the first block of the function. We therefore
remember the IDs generated for each loop counter variable in a
function whilst generating the function body's code. The instructions
to declare these variables are then emitted in `Function::to_words()`
prior to emitting the function's body.
As this may negatively impact shader performance, this workaround can
be disabled using the same mechanism as for other backends: eg calling
Device::create_shader_module_trusted() and setting the
ShaderRuntimeChecks::force_loop_bounding flag to false.
Instead allow the const to be converted and each time it is const
evaluated as part of another expression. This allows an abstract const
to be used as a different type depending on the context.
A consequence of this is that abstract types may now find their way to
the validation stage, which we don't want. We therefore additionally
now ensure that the compact pass removes global constants of abstract
types. This will have no *functional* effect on shaders generated by
the backends, as the expressions belonging to the abstract consts in
the IR will not actually be used, as any usage in the input shader
will have been const-evaluated away. Certain unused const declarations
will now be removed, however, as can be seen by the effect on the
snapshot outputs.
* Link to where it is used and how to check support.
* Link from `Auto*` to the variants they refer to.
* Organize mode information into lists.
* Document which value is the default value.
* Various wording changes.
I mostly did not touch the descriptions of the individual modes.
I think that they could use some explanation of jargon (what is a
“presentation engine”, really?) but I am not the person to write that.