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
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>
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>
1391: Simplify features r=cwfitzgerald a=kvark
**Connections**
Fixes#1390
Makes vertex writable storage optional (native-only for now)
Fixes the follow-up to #891
**Description**
Refactors the code so that adding new features and maintaining current ones is much easier.
Refactors the way missing features are checked and reported, DRY way.
**Testing**
Not really tested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1381: Update naga to gfx-25 r=kvark a=kvark
**Connections**
Fixes#1362
Picks up https://github.com/gfx-rs/gfx/pull/3752 and https://github.com/gfx-rs/gfx/pull/3758
**Description**
Updates gfx and Naga. Hooks up the new validation capabilities.
**Testing**
Self-testing.
Note: this PR doesn't currently work because Metal's backend is now required use a sizes buffer when dynamically sized arrays are present. One of the internal tests here uses them.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1385: fix typo in PowerPreference::LowPower description r=cwfitzgerald a=cab
**Description**
Fixes a typo in the description of `PowerPreference::LowPower`.
**Testing**
None
Co-authored-by: Conner Bryan <conner@amps.io>
1358: Big refactor of the profiling usage r=kvark a=kvark
**Connections**
**Description**
Improves the profiling markers in many ways:
1. remove unnecessary leftovers from the `tracing` era, such as querying device/adapter features. These are one-time and light-weight. It's unlikely we are going to be interested in them.
2. add markers to where it really matters, such as `maintain` pieces, `submit` phases, render pass preparation, etc.
3. shorten the markers to be strictly the function names, passing the class name as a tag
**Testing**
Tested on vange-rs
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1354: Update profiling to 1.0 r=kvark a=kvark
**Connections**
https://github.com/gfx-rs/gfx/pull/3734
**Description**
Some crates like to release 1.0
**Testing**
Should work
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1353: Update naga to gfx-23 r=kvark a=kvark
**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3733
**Description**
Just a bunch of Naga fixes
**Testing**
To be tested in wgpu-rs
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1351: Hard error on SPIRV parsing failure when VALIDATION is requested r=cwfitzgerald a=kvark
**Connections**
Follow-up from https://github.com/gfx-rs/wgpu/issues/1350#issuecomment-825186159
**Description**
If the user provided SPIR-V, and they requested VALIDATION, and we fail to parse the file - there is no point to proceed.
VALIDATION flag should be a gaurantee of safe operation, so we can't just throw the same SPIR-V at SPIRV-Cross and pretend that it's ok.
**Testing**
Tested on noclip shaders
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
1348: Change error type for the backend shader r=kvark a=kvark
**Connections**
Fixes#1347
**Description**
Issues a better error for this case
**Testing**
Should work
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>