Commit Graph
2761 Commits
Author SHA1 Message Date
Dzmitry Malyshau ff2a3e84fc update synchronization, fix last errors in wgc 2021-06-08 02:03:44 -04:00
Dzmitry Malyshau 0a82c232ba hal: port the rest of wgpu-core 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau c61ee1262b hal: transfer operations 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau 6d51fab864 hal:: Fill the command buffer calls 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau 738ae2b227 Surface API 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau bae3c694bd Documentation update 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau 0ea4cac04b Rework shader and pipeline creation 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau 569cd0cdd6 WIP new wgpu-hal 2021-06-08 00:46:08 -04:00
bors[bot]andAndreas Reich a92b8549a8 Merge #1474
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 https://github.com/Wumpf/blub/commit/432fb75a6865565d29503432f79c60f29ec4c637, more to come

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-06-06 00:07:03 +00:00
bors[bot]andRobin Hübner 8e8f59af7c Merge #1479
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>
2021-06-05 22:29:01 +00:00
Robin Hübner bc0c86a47a fix typo regarding structurer rename in changelog 2021-06-05 22:09:06 +01:00
Andreas Reich 99e691932d add clear buffer/image to wgpu-rs api 2021-06-05 11:49:13 +02:00
bors[bot]andDzmitry Malyshau 7978df83ef Merge #1470
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>
2021-06-04 23:32:18 +00:00
Dzmitry Malyshau cfc6792c82 Validate pipeline state formats 2021-06-03 10:30:35 -04:00
bors[bot]andFrizi c7576553ba Merge #1469
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>
2021-06-03 11:25:46 +00:00
Frizi 07376d11e8 Handle winit exception in web to avoid breaking async executor 2021-06-03 13:02:56 +02:00
Dzmitry Malyshau e4b0de2526 Links updates 2021-06-02 23:54:26 -04:00
Dzmitry Malyshau 900a141392 Work around CI failures on hello-compute 2021-06-02 22:48:33 -04:00
Dzmitry Malyshau a6ff3ea086 Merge changelogs and readmes 2021-06-02 21:50:16 -04:00
Dzmitry Malyshau 4fc478513a Merge ../wgpu-rs into reunion 2021-06-02 21:31:02 -04:00
bors[bot]andDzmitry Malyshau 6566a6ce49 [rs] Merge #920
920: Bunnymark example r=grovesNL a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-06-02 16:20:43 +00:00
Sean Moulton 9bdc65e5f7 [rs] Add include_wgsl!() macro (#922)
* Add include_wgsl macro

* Add include_wgsl macro

* Change ShaderFlags to all
2021-06-01 22:31:02 -04:00
Dzmitry Malyshau e98f36245b [rs] Framework and README update 2021-06-01 09:54:44 -04:00
Dzmitry Malyshau f438f0b920 [rs] Bunnymark example 2021-06-01 09:19:19 -04:00
bors[bot]andDzmitry Malyshau 6e680d96a4 [rs] Merge #921
921: Update wgpu to eadaa1b7d8 r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1419, https://github.com/gfx-rs/wgpu/pull/1417, and https://github.com/gfx-rs/wgpu/pull/1403

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-06-01 13:10:49 +00:00
Dzmitry Malyshau ac6276dfb5 [rs] Update wgpu to eadaa1b7d8 2021-06-01 09:02:19 -04:00
bors[bot]andDzmitry Malyshau eadaa1b7d8 Merge #1419
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>
2021-06-01 12:44:53 +00:00
Dzmitry Malyshau beb88b0a88 Skip the cube compatibility on a downlevel flag 2021-06-01 08:29:44 -04:00
bors[bot]andDzmitry Malyshau 9cd01635d7 Merge #1417
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>
2021-06-01 06:45:05 +00:00
bors[bot]andDzmitry Malyshau c332c7fffe Merge #1403
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>
2021-06-01 06:31:28 +00:00
Lucien Greathouse ba041e4451 Expand 0.8.0 Changelog (#1420)
* humble beginnings

* Current progress

* More precise NonZeroU32 change

* Fix typo

* Changelog enough to get my game to compile again

* Fix type change line
2021-06-01 02:03:59 -04:00
Dzmitry Malyshau 7b7e72b1c2 Split the tracker into stateful/stateless to reduce the overhead 2021-05-31 14:18:44 -04:00
Wumpf f62d0d5edc Native Extension: Expose fill buffer & clear image (#1335)
* 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
2021-05-30 11:03:33 -04:00
bors[bot]andJoshua Groves cb18541221 [rs] Merge #918
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>
2021-05-29 23:35:06 +00:00
Joshua Groves 2a42e73eef [rs] Specify latest gfx release branch in README 2021-05-29 14:56:56 -02:30
Dzmitry Malyshau e9d2f402f1 Improve handling of erroring command buffers on submission 2021-05-20 15:35:14 -04:00
Dzmitry Malyshau 314ed4cce5 Trace render passes before they are ran 2021-05-20 11:43:39 -04:00
bors[bot]andDzmitry Malyshau bc70e1fd85 [rs] Merge #916
916: Update capture API r=kvark a=kvark

Picks up https://github.com/gfx-rs/wgpu/pull/1401

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-05-19 15:42:02 +00:00
Dzmitry Malyshau 3b7c6a9e00 [rs] Update capture API 2021-05-19 11:41:06 -04:00
bors[bot]andDzmitry Malyshau 7ce535cc97 Merge #1402
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>
2021-05-19 04:53:42 +00:00
Dzmitry Malyshau ab78f3cf16 Check render target aspects 2021-05-19 00:42:20 -04:00
bors[bot]andDzmitry Malyshau 6ac8d8a728 Merge #1401
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>
2021-05-18 21:43:23 +00:00
Dzmitry Malyshau 19dfcd93ca Make player automatically start/stop the capture 2021-05-18 17:42:49 -04:00
bors[bot]andIan Gowen 7a43516943 [rs] Merge #914
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>
2021-05-18 14:42:04 +00:00
Ian Gowen 29b1df51fc [rs] Change the texture sample type for the cube example from Float to Uint, and move the mandelbrot->color mapping functionality from the texel generation code to the fragment shader. 2021-05-18 10:33:15 -04:00
bors[bot]andConnor Fitzgerald 09f8f8dfb6 Merge #1399
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>
2021-05-18 05:48:15 +00:00
Connor Fitzgerald be5adfa584 Fix segfault caused by improper drop order 2021-05-18 01:47:24 -04:00
bors[bot]andDzmitry Malyshau 1cd4ad7cfe Merge #1393
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>
2021-05-18 00:30:51 +00:00
Dzmitry Malyshau e24e8f643c Fix dynamic stencil reference for Replace ops 2021-05-17 18:42:42 -04:00
bors[bot]andDzmitry Malyshau 13f2ca571c Merge #1391
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>
2021-05-17 19:03:59 +00:00