Commit Graph
2124 Commits
Author SHA1 Message Date
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
Andreas Reich 99e691932d add clear buffer/image to wgpu-rs api 2021-06-05 11:49:13 +02:00
Dzmitry Malyshau cfc6792c82 Validate pipeline state formats 2021-06-03 10:30:35 -04: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
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
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
Dzmitry Malyshau ab78f3cf16 Check render target aspects 2021-05-19 00:42:20 -04:00
Dzmitry Malyshau 19dfcd93ca Make player automatically start/stop the capture 2021-05-18 17:42:49 -04:00
Connor Fitzgerald be5adfa584 Fix segfault caused by improper drop order 2021-05-18 01:47:24 -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
Dzmitry Malyshau 51c7963195 Use the same MissingFeatures error everywhere 2021-05-17 14:20:17 -04:00
Dzmitry Malyshau 163b11db42 Validate the writable storage feature 2021-05-17 14:19:49 -04:00
Dzmitry Malyshau a06d277d40 Simplify feature selection 2021-05-17 14:11:48 -04:00
Dzmitry Malyshau f0a145d0fa Add VERTEX_WRITABLE_STORAGE feature, refactor the sample border 2021-05-17 14:09:02 -04:00
bors[bot]andDzmitry Malyshau 53eab747a3 Merge #1381
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>
2021-05-14 03:57:13 +00:00
Dzmitry Malyshau e00251d3e3 Update naga to gfx-25 2021-05-13 23:56:26 -04:00
Dzmitry Malyshau 58b83f3ff6 Add extern-C on wgpu_render_pass_execute_bundles 2021-05-11 15:00:49 -04:00
Dzmitry Malyshau f861e83df1 Fix wgpu_render_bundle_draw_indexed_indirect 2021-05-11 15:00:49 -04:00
Jonathan Behrens c64618abb8 Include shader label in log message if validation fails 2021-05-08 14:07:56 -04:00
Luca Casonato 751aa714f4 fix: zeroable buffer_get_mapped_range size
According to spec, size can be Some(0).
2021-05-06 22:03:43 -04:00
Dzmitry Malyshau 3bd0e8b050 Validate storage class 2021-05-06 13:25:34 -04:00
Dzmitry Malyshau de5907d938 Explicitly list output spirv capabilities 2021-05-06 13:25:21 -04:00
Dzmitry Malyshau e5ddb94be0 Version bump to 0.8 2021-04-29 11:57:22 -04:00
Dzmitry Malyshau ffd47fbc0e Remove Vulkan Portability support 2021-04-29 11:42:26 -04:00
Dzmitry Malyshau 6ff618aafb Big refactor of the profiling usage 2021-04-29 02:06:58 -04:00
Chandler Newman 904ec7a5ee Add uniform and storage buffer arrays 2021-04-29 00:38:04 -04:00
Dzmitry Malyshau 087bd07f55 Add shader compile markers 2021-04-27 12:23:28 -04:00
Dzmitry Malyshau 6c7f2b917f Update profiling to 1.0 2021-04-26 11:59:15 -04:00
Dzmitry Malyshau 03c4e0969e Update naga to gfx-23 2021-04-26 11:10:22 -04:00
Dzmitry Malyshau 525efda7b2 Hard error on SPIRV parsing failure when VALIDATION is requested 2021-04-22 17:18:16 -04:00
Dzmitry Malyshau bc4c5c8f03 Change error type for the backend shader 2021-04-21 17:06:58 -04:00
Dzmitry Malyshau 8505a39f6a Make implicit ids actually errors to start with 2021-04-20 17:32:40 -04:00
Dzmitry Malyshau cc2e547d48 Update gfx to the new image view API 2021-04-20 10:16:30 -04:00
Dzmitry Malyshau cac643507b Validate min/max blending factors 2021-04-20 09:37:07 -04:00
Dzmitry Malyshau de86f2a72f Mark unused implicit BGL ids as vacant 2021-04-19 23:35:33 -04:00
Dzmitry Malyshau 27f51ca252 Update naga to gfx-22, add interpolation sampling validation 2021-04-19 13:33:36 -04:00
Dzmitry Malyshau 280ba30c6c Don't compare booleans 2021-04-18 10:25:54 -04:00
Dzmitry Malyshau 92886b4995 Validate filtering samplers at BG creation 2021-04-18 10:25:54 -04:00
Dzmitry Malyshau 6d7ef8b8fd Validate filtered sampling 2021-04-18 10:25:54 -04:00
bors[bot]andDzmitry Malyshau a749f09bbf Merge #1325
1325: Relax and imporve vertex attribute validation r=cwfitzgerald a=kvark

**Connections**
None

**Description**
Improves our validation of vertex attributes in the following ways:
  1. Relaxes the size matching, so that we allow the shaders to default some of the values we don't provide
  2. Require interpolation to match
  3. Make the error messages more detailed:

>     In Device::create_render_pipeline
    error in stage VERTEX
    error matching the stage input at 1 (Uint32x2 interpolated as None) against the previous stage outputs
    input type is not compatible with the provided Float32x2

**Testing**
Tested on wgpu-rs examples.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-18 07:37:54 +00:00
Dzmitry Malyshau c744582052 Update blending API names 2021-04-15 11:25:04 -04:00
Dzmitry Malyshau c0478c707d Address clippy issues on copying things 2021-04-14 15:23:20 -04:00
adamnemecek 6d3a514c43 updated gfx (#1327)
* updated gfx

* use long rev
2021-04-14 14:37:13 -04:00
Dzmitry Malyshau 78652e93f4 Make input stage errors more detailed 2021-04-13 23:01:02 -04:00
Dzmitry Malyshau b7a0410e09 Relax vertex attribute matching, also check interpolation 2021-04-13 22:19:44 -04:00