* [spirv-out] Move instructions to own module
* [spirv-out] Fix wrong function use of some instructions
* [spirv-out] Update instruction parameters
* [spirv-out] Update current instruction tests
* [spirv-out] Order current instruction tests
* [spirv-out] Add missing instruction tests
920: Don't bind groups that aren't expected by the layout r=grovesNL a=kvark
**Connections**
Sibling of #919 for master.
**Description**
**Testing**
In addition to the fix itself, this comes with a new regression playtest!
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
547: Implement on_uncaptured_error r=kvark,cwfitzgerald a=scoopr
This is very crude at the moment, I'm mostly just checking if the directions is at all viable.
So I set out to implement `on_caught_error`, focusing solely on the direct backend. It just accepts a `Fn(GPUError)` (and I named it GPUError because I didn't yet want to rename the import of `std::error::Error`).
I store the handler in a `ErrorSinkRaw` struct, which is then wrapped in Arc+Mutex, with the idea that other resources can point to the same Arc, so when `Device::on_uncaught_error` is called mid application, all resources will point to the right place. Otherwise I think something like `Buffer::unmap` would have to find the `Device` it was created with, to find the uncaught handler.
Now I store the `ErrorSink` in the `Device` struct, because it is a convenient place to hold it. But I guess it is a bit nonsensical with the web backend, so either it would need to be `cfg(not(wasm32))`, or move the whole thing in the backend side, but in the direct backend, I don't see a convenient place to store the closure. But the unwrapping is done in direct backend, so it can't really be moved up in to wgpu-core either, unless the error handling overall is moved there.
Also related, I'm now passing the `error_sink` argument to the few methods where I implemented the error handling, which I think is a bit ugly, but it works.
Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
908: Clarify usage of SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING r=cwfitzgerald a=im-0
**Connections**
https://github.com/gfx-rs/wgpu-rs/pull/540
**Description**
This clarifies usage of SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING with GLSL.
**Testing**
This commit only changes documentation.
Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
540: Improve and fix examples/texture-arrays r=cwfitzgerald a=im-0
Original examples/texture-arrays produces following output on my machine (Linux, Mesa/RADV 20.2-rc3, Radeon VII):

Quick investigation showed that only shaders with non-uniform indexing are problematic (first commit helped with this). Then, after searching on the web, I figured out that the problem is in missing `nonuniformEXT`. Second commit fixes this.
I am new to graphics programming, and `nonuniformEXT` may work just by accident. So please confirm my finding before merging.
Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
916: Flush staging init buffers r=cwfitzgerald a=kvark
**Connections**
Related to https://github.com/gfx-rs/gfx/pull/3362
With the new use of `write_buffer`/`write_texture`, the results on D3D11 regressed.
**Description**
It just happened to be the case that all the backends returned coherent staging buffers, used internally for `write_*` and `mapped_at_creation == true`. However, D3D11 backend currently doesn't have the coherent memory at all, and it helped me to see that we were missing a flush() on the staging buffer.
**Testing**
Untested, but should work (tm).
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
* [glsl-new] Update last exprs to ExpressionRule
Refactor out binary_expr to keep parser.rs 'small' and readable
* [glsl-new] Change binary_expr to method on Program
* [glsl-new] Make binary_expr a proper method
909: Add Quad play test r=kvark a=DevOrc
**Connections**
#807
**Description**
Adds a play test that renders a white quad to a texture. The texture is then copied to a buffer and checked for accuracy with a file of expected bytes (All 0xFF).
**Testing**
Cargo test succeeds
Co-authored-by: Noah Charlton <ncharlton002@gmail.com>
Add documentation, make clippy happy
Compilation errors
Add some more docs
Few more compilation errors
Changes based on the review
glsl-new parser fix
Set default local size to (0, 0, 0)
final cleanup
Last design
New design
545: Remove bake.frag from shadow example r=kvark a=yutannihilation
Now that `fragment_stage` is a `Option`, I guess this is the case when we don't need fragment shader.
Co-authored-by: Hiroaki Yutani <yutani.ini@gmail.com>
910: Replace backends! Macro with CFG Aliases r=kvark a=zicklag
**Connections**
Needs to be merged before: https://github.com/gfx-rs/wgpu/pull/907
**Description**
This change makes it easier to conditionally compile code based on graphics backends by adding `#[cfg]` aliases for the backends such as `vulkan`, `metal`, etc. This makes the code easier to read and maintain.
**Testing**
Tested the WGPU-rs cube and boids examples and they work as normal on a Linux machine with Vulkan.
Co-authored-by: Zicklag <zicklag@katharostech.com>
912: Fix write-only stencil state descriptors from not working - fixes#911 r=kvark a=Dinnerbone
**Connections**
This fixes [#911 - Stencil testing broken between v0.5 and v0.6](https://github.com/gfx-rs/wgpu/issues/911).
**Description**
Write-only stencil states (read 0, write >0) are being treated as if they are disabled, which causes pipelines to act as though they don't have any stencil state set at all. This worked prior to commit 2473c25971 (introduced in PR #873). As far as I can tell, this works fine in Vulkan, Metal, DX12 and DX11 as we've been using this approach over at Ruffle for a while now.
**Testing**
You can view the reproduction case in #911 for manual testing. I have confirmed that this fix makes that case work as expected.
I couldn't find any automated tests for wgpu-types to copy and add for this case. If that's wanted then please let me know what the best approach is.
Co-authored-by: Nathan Adams <dinnerbone@dinnerbone.com>
903: fix for mixed STORAGE_STORE and STORAGE_LOAD r=kvark a=kocsis1david
**Connections**
None
**Description**
A buffer that contains dynamic data is used for both uniforms and storage read. This was a problem for wgpu and it gave a `PendingTransition` error.
**Testing**
It's a trivial fix, but I don't know if there's an example for it in wgpu-rs that can be used for testing.
It seems that the PR "Sync changes from mozilla-central" is already solving the same issue.
Co-authored-by: Dávid Kocsis <kocsis1david@windowslive.com>
* Allow copying from depth textures
* Rename TextureFormat::is_depth_format to just is_depth
* Only allow Depth32Float format for copying, and only as source