1419: Skip the cube compatibility on a downlevel flag r=cwfitzgerald a=kvark
**Connections**
Fixes#1418
**Description**
Adds a downlevel flag for cube arrays, checks for it.
**Testing**
Untested, but should work.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1417: Split the tracker into stateful/stateless to reduce the overhead r=cwfitzgerald a=kvark
**Connections**
Implements https://github.com/gfx-rs/wgpu/issues/1413#issuecomment-851604344
Reduces the overhead for resource tracking in the Animometer benchmark by up to 50%.
**Description**
We used to use the full tracker set on the usage scopes associated with compute/render passes. A resource tracker has 2 responsibilities: ensuring the resource is held alive, and validating and recording the state transitions. This PR exploits the fact that the latter responsibility is only applicable for buffers and textures. So doing all the lifetime tracking for a pass is a waste: we can instead just attach the lifetimes to the parent command buffer, straight.
In the Animometer benchmark, there is one large buffer, and thousands of bind groups pointing to different offsets into it. The old code would fill up the pass tracker with those bind groups, and then merge it into the command buffer tracker. The new code would just fill up the command buffer tracker instead. Since there is only one buffer, the pass tracking becomes much lighter.
**Testing**
Untested. It would be nice to have some benchmarks here, possibly after #1397 ?
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1403: Trace render passes before they are ran r=cwfitzgerald a=kvark
**Connections**
Follow-up to #1245
**Description**
We want the API traces to reproduce issues. Previously, we moved all the resource creation to happen after the trace is written.
This PR follow-up by also recording the render pass commands even in the case where one of them triggers a validation error.
Another big part of the PR now is handling the command buffers that failed for some reason. The submission is skipping them now instead of erroring the whole thing.
**Testing**
Tested manually on wgpu-rs examples
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
* humble beginnings
* Current progress
* More precise NonZeroU32 change
* Fix typo
* Changelog enough to get my game to compile again
* Fix type change line
* Add command buffer fill buffer method
* Added test for buffer fill
* Added image clear + test
* image/buffer clear methods are now pure clear to zero
* fix cargo clippy & int type issues
* clear buffer alignment is now given by COPY_BUFFER_ALIGNMENT
* joined buffer/image clear player tests
* ImageSubresourceRange is now used in TextureViewDescriptor
Better errors for Unexpected, BadInteger, BadFloat, BadTexture, BadTypeCast, UnknownScalarType, UnknownStorageClass, UnknownAttribute, UnknownBuiltin, UnknownShaderStage, UnknownStorageFormat and UnknownConservativeDepth, ZeroStride, ZeroSizeOrAlign and UnknownType.
Also adds lexer::capture_span.
Also fixes some validation for texture sample types and and issue that cauld cause e.g. the type `f33` to be parsed as `f32`.
918: Specify latest gfx release branch in README r=kvark a=grovesNL
Specify latest gfx release branch in README, to hopefully avoid people checking out `hal-0.2` then wondering why the patch doesn't seem to do anything.
Co-authored-by: Joshua Groves <josh@joshgroves.com>
Previously the types where changed in a later phase now they are changed
right when the argument is added, this makes the implementation slightly
less spec compliant because the following code will compile whilst it shouldn't
```glsl
void test(float a) {}
void test(out float b) {}
```
Matrix and vector constructors expected a vector (in the case of the
matrix) or a scalar (in both cases). Now they handle resizing such that
the following code now works
```glsl
mat3 a;
mat4(a); // This would return a validation error because it emitted a cast
```
WGSL requires that runtime-sized arrays appear only as the last member of a
structure in in the `storage` storage class. It seems to me that Naga should
enforce this restriction on its own IR as well.