Commit Graph
88 Commits
Author SHA1 Message Date
Dzmitry Malyshau c2bb2d5dfc Experimental command pool API 2021-06-14 01:58:09 -04:00
Dzmitry Malyshau 006f8abbba build and clippy fixes, command buffer cleanup 2021-06-10 12:44:29 -04:00
Dzmitry Malyshau 0a82c232ba hal: port the rest of wgpu-core 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 569cd0cdd6 WIP new wgpu-hal 2021-06-08 00:46:08 -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 6ff618aafb Big refactor of the profiling usage 2021-04-29 02:06:58 -04:00
Connor Fitzgerald fca72f54f9 Validate compute shader's presence 2021-03-31 01:08:53 -04:00
Connor Fitzgerald cf6f9c3ca8 Move from tracing to log + profiling 2021-03-17 01:22:30 -04:00
Dzmitry Malyshau 231bba03a1 Lint all the things 2021-03-12 12:39:04 -05:00
Andreas Reich 492027fe6e command buffer buffer memory init tracking is only filled if necessary now 2021-01-31 21:56:22 +01:00
Andreas Reich 9595b39bb3 Fine grained tracking of buffer init requirements 2021-01-31 21:55:49 +01:00
Andreas Reich 5133b0da94 Introduced separate MemoryInitTracker 2021-01-31 21:55:49 +01:00
Andreas Reich a51b4f9232 buffer zero initialization prior to use in submit 2021-01-31 21:55:49 +01:00
Connor Fitzgerald a22037ced0 Add pipeline statistics and timeline queries 2021-01-16 00:48:54 -05:00
Dzmitry Malyshau 012569845d Update render pass and framebuffers logic to the latest gfx-hal 2021-01-15 00:53:28 -05:00
Mikko Lehtonen 6c56613045 Merge PassErrorScope::Draw* and Dispatch* variants 2021-01-12 22:23:17 +02:00
Mikko Lehtonen 0d60bd80c5 Include pipeline id in some pass error scopes 2021-01-12 17:58:44 +02:00
Dzmitry Malyshau 389a848dea Support trailing render passes after the swapchain rendering 2021-01-11 21:40:41 -05:00
Dzmitry Malyshau ab10d36ac0 Rename get_encoder to get_encoder_mut 2020-12-23 11:20:08 -05:00
Dzmitry Malyshau 35b163ebc8 Encode render passes while command buffer is only read-locked 2020-12-22 13:48:18 -05:00
Dzmitry Malyshau cb67ef6542 Clean up render pass labels 2020-12-15 17:28:24 -05:00
Dzmitry Malyshau 394135f725 Fix and improve object labels and command markers 2020-12-15 11:28:11 -05:00
Dzmitry Malyshau c6bc37dbde [error] render bundles 2020-11-23 12:00:47 -05:00
Mikko Lehtonen 459e835250 Add Ids to PassErrorScope
Also makes it pub, and the places it is used.
Tweak some error messages.
2020-11-21 23:39:05 +02:00
Mikko Lehtonen 4498f172cc Retain labels for resources
As a braking api change, adds also label for the error id generation,
for labeling invalid ids too.

Also adds query methods the label.
2020-11-19 00:09:21 +02:00
Marvin Löbel 8723a8379a Annotate all commands of {Compute,Render}Passes with error context informations 2020-11-12 23:05:10 +01:00
Marvin Löbel 752c1aad33 Elide redundant set_pipeline calls.
Add a small abstraction over state changes

Deduplicate redundant pipeline state checking
2020-10-21 19:25:21 +02:00
PENGUINLIONG 6f4508523a Pass [u8] instead of [u32] for push constants (#918)
* Pass [u8] instead of [u32] for push constants

Use 2-instruction aligner

Fixed alignment

Fixed offsets

Added alignment checks and fixed size

Use semantic constants

* Replaced all magic number with constant

* Fixed type cast
2020-10-08 23:13:18 -04:00
Adam Nemecek db1870e7fc use self 2020-09-25 19:11:46 -07:00
Dzmitry Malyshau 0345c56758 Properly implement compute pass usage scopes 2020-09-23 19:01:47 -04:00
Dzmitry Malyshau 9d8dc0b04d Grand cleanup and refactor of the descriptors in the API 2020-08-12 14:13:32 -04:00
Dzmitry Malyshau dbd7e2c579 Separate valid internal IDs from external ones 2020-08-04 11:16:59 -04:00
Gabriel Majeri e860dd995f Handle command pool creation error 2020-07-29 09:56:42 +03:00
Dzmitry Malyshau bf862b7907 Clarity renames according to the Gecko review 2020-07-28 16:58:28 -04:00
Connor Fitzgerald cb485f3798 Convert all logging to tracing and add fmt logger 2020-07-25 19:33:21 -04:00
Gabriel Majeri 04b0b4d3a5 Error type for command_encoder_finish 2020-07-18 10:46:47 +03:00
Connor Fitzgerald c8bcc50ed6 Implement PUSH_CONSTANTS feature 2020-07-13 12:47:09 -04:00
Dzmitry Malyshau 0ed90d001b Tweak the logging a bit to make debug level usable 2020-06-24 10:26:43 -04:00
Connor Fitzgerald 62a870280f Refine Logging Levels 2020-06-22 02:13:04 -04:00
Connor Fitzgerald c1f0021a05 Add Chrome Backend 2020-06-20 20:55:59 -04:00
Connor Fitzgerald 1b2cf3cd22 Add Tracing and Instrument Entry Points 2020-06-20 14:26:50 -04:00
Dzmitry Malyshau 365f4e8786 Remove peek-poke.
There was a lot of highly unsafe use of serialization based on peek-poke that we
weren't entirely happy with. It's replaced by just serializing the passes now.
Also, switch BufferSize to Option<NonZero>.
2020-06-20 00:39:11 -04:00
Nikita Krupitskas eaf2acb43a Implement debug marker support 2020-06-17 00:05:52 +03:00
Dzmitry Malyshau 7aa5753701 Re-architecture the bundles using normalized command streams.
This is a major change in how the bundles are implemented. Instead of
transparently injecting them into the pass command stream, we are now
treating bundles as first-class API objects and API tracing them
accordingly. The bundle contains a normalized command stream that is
very easy to inject into a native command buffer multiple times.
2020-06-11 15:34:45 -04:00