1474: Add clear buffer/image to wgpu-rs api r=kvark a=Wumpf
Follow up to #1335
Started using this in Blub fluid sim a little bit on volume textures, works nicely 432fb75a68, more to come
Co-authored-by: Andreas Reich <r_andreas2@web.de>
1479: fix typo regarding structure rename in changelog r=kvark a=profan
**Description**
Just fixing a typo I realised was there when trying to use the changelog to fix my code, thanks for adding a list of changes to the latest changelogs!
Co-authored-by: Robin Hübner <robinhubner@gmail.com>
1470: Validate pipeline state formats r=cwfitzgerald a=kvark
**Connections**
Fixes#1425
**Description**
We weren't validating any of the pipeline formats.
**Testing**
Manually tested, e.g.:
```
Caused by:
In Device::create_render_pipeline
note: label = `shadow`
depth/stencil state is invalid
format Rgba8UnormSrgb does not have a depth aspect, but depth test/write is enabled
```
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1469: Handle winit exception in web to avoid breaking async executor r=grovesNL a=Frizi
This is a continuation of https://github.com/gfx-rs/wgpu-rs/pull/923.
I'd still like to fix this on our end, even if the real underlying issue is in winit. The fix is small, and we can migrate to the proper winit solution once it exists. In the mean time, we can continue working on improving webgl support without a major blocker.
Co-authored-by: Frizi <frizi09@gmail.com>
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
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>
1402: Check render target aspects r=kvark a=kvark
**Connections**
Reported on Matrix by "m4b"
**Description**
Passing a depth texture as a color attachment results in:
> Validation Error: [ VUID-vkCmdBeginRenderPass-initialLayout-00895 ] Object 0: handle = 0x280000000028, name = ShadowTexture, type = VK_OBJECT_TYPE_IMAGE; Object 1: handle = 0x3020000000302, type = VK_OBJECT_TYPE_RENDER_PASS; Object 2: handle = 0x3030000000303, type = VK_OBJECT_TYPE_FRAMEBUFFER; Object 3: handle = 0x2b000000002b, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x34f84ef4 | vkCmdBeginRenderPass(): Layout/usage mismatch for attachment 0 in VkRenderPass 0x3020000000302[] - the color attachment layout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL but the image attached to VkFramebuffer 0x3030000000303[] via VkImageView 0x2b000000002b[] was not created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT The Vulkan spec states: If any of the initialLayout or finalLayout member of the VkAttachmentDescription structures or the layout member of the VkAttachmentReference structures specified when creating the render pass specified in the renderPass member of pRenderPassBegin is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then the corresponding attachment image view of the framebuffer specified in the framebuffer member of pRenderPassBegin must have been created with a usage value including VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkCmdBeginRenderPass-initialLayout-00895)
**Testing**
Just ran wgpu-rs examples
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1401: Make player automatically start/stop the capture r=kvark a=kvark
**Connections**
Follow-up to #1301
**Description**
Replaying compute-based workloads, or Gecko-based API traces, always wants to auto-capture everything.
This PR makes it the default.
**Testing**
Tested on a real Gecko capture :)
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
914: Change the texture sample type for the cube example from Float to Uint r=kvark a=igowen
this is a rework of #764. i think wgpu supports everything we need for this now!
Co-authored-by: Ian Gowen <ian@gowen.cc>
1399: Fix segfault caused by improper drop order r=kvark a=cwfitzgerald
**Connections**
Closes#1398
**Description**
The disabled dtor of the global hub was causing the incorrect drop order causing devices to be dropped before instances.
**Testing**
Tested against up and coming testing code.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
1393: Fix dynamic stencil reference for Replace ops r=cwfitzgerald a=kvark
**Connections**
Fixes an issue reported on Matrix, where we'd not set the stencil reference.
**Description**
Our conditions didn't check the Replace ops.
**Testing**
Untested, YOLO
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>