Commit Graph
739 Commits
Author SHA1 Message Date
Dzmitry Malyshau da38b8b077 Make spirv an optional feature 2021-06-21 12:09:12 -04:00
bors[bot]andAlex S 96dbd06a1f Merge #1525
1525: Add Naga bypass to allow feeding raw SPIR-V shader data to the backend. r=kvark a=ElectronicRU

**Connections**
Fixes #1520 .

**Description**
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.

**Testing**
`texture_arrays` example is runnable now, which uncovers an additional bug in Vulkan backend - binding arrays are instead treated like sole bindings, and indices shift, too. Lots of errors from validation layer ensue.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 16:13:53 +00:00
Alex S 7cd7b18560 Code review:
- Remove Cow from wgpu-hal API surface. You graze on in our hearts.
- Rename feature flag to SPIRV_SHADER_PASSTHROUGH in anticipation
  of crate feature `spirv` to reduce confusion.
- Add some more documentation about behaviour and intended avenues of
  use to the feature.
2021-06-20 15:22:04 +03:00
bors[bot]andAlex S cfda54f108 Merge #1528
1528: Support TEXTURE_SPECIFIC_FORMAT_CAPABILITIES for rendertargets. r=kvark a=ElectronicRU

**Description**
With TEXTURE_SPECIFIC_FORMAT_FEATURES enabled, one would assume that render pipeline creation would use extended features
for color/depth-stencil render targets. However, it does not. This aims to fix that discrepancy.

Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 06:14:42 +00:00
Alex S 8bfa949261 Code review:
- rename ShaderInput variants
- rename feature flag
- hard error on Metal backend trying to compile SPIR-V
- fix test failing because of feature flag bits changing
2021-06-20 06:22:59 +03:00
Alex S 066bd7e647 Support TEXTURE_SPECIFIC_FORMAT_CAPABILITIES for rendertargets. 2021-06-20 05:57:55 +03:00
Alex S 6d2e6e5a56 Add Naga bypass to allow feeding raw SPIR-V shader data to the backend.
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.
2021-06-19 23:32:44 +03:00
Gordon-F 2873ac32d9 Remove MPL 2.0 header in files 2021-06-19 21:06:08 +03:00
bors[bot]andAlex S 1d2efb43bc Merge #1511
1511: Added storage texture array support. r=kvark a=ElectronicRU

**Description**
Arrays of storage images (*f*image*n*D in GLSL parlance) should now be supported.
I also took the liberty to refactor texture format checking a bit,
and tighten up sampled texture support detection for Metal as well.

**Testing**
Not completely sure what's the proper testing approach here, open to suggestions.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-18 21:38:54 +00:00
Connor Fitzgerald f49c50442f Update naga to gfx-26 2021-06-18 13:15:28 -04:00
bors[bot]andAlex S 49f677b1fd Merge #1513
1513: Fix failing test compilation on windows - DX12 and DX11 not there. r=kvark a=ElectronicRU

**Description**
Due to some things in macros being left on cfg(windows) and some changed to cfg(dx12/dx11), the tests didn't even compile, much less run.

**Testing**
Ideally, some CI for Windows should be set up.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-18 16:44:18 +00:00
Alex S 9f6f4da4ba blindsided by clippy 2021-06-18 19:31:12 +03:00
Alex S 8d13d97663 Fix failing test compilation on windows - DX12 and DX11 not there. 2021-06-18 19:29:09 +03:00
Alex S 52fab481e6 Added storage texture array support.
I also took the liberty to refactor texture format checking a bit,
and tighten up sampled texture support detection for Metal as well.
2021-06-18 19:20:37 +03:00
Dzmitry Malyshau 9c8d4dbfa6 Hot patch for temp_suspected tracking 2021-06-18 10:59:47 -04:00
Dzmitry Malyshau 80ab18404e Change the order to suspect temporary resources earlier 2021-06-18 02:49:46 -04:00
Dzmitry Malyshau 7410b700d6 fix swapchain recycling, copies, device destruction, RODS 2021-06-16 23:18:50 -04:00
Dzmitry Malyshau c53addac8a hal/vk: draws and dispatches. Refactor query set descriptor 2021-06-16 14:17:37 -04:00
Dzmitry Malyshau 668fedd1c0 hal: rename aux to util 2021-06-15 01:33:19 -04:00
Dzmitry Malyshau 00de15990e hal/vk: pipeline creation 2021-06-15 01:24:25 -04:00
Dzmitry Malyshau 9d85602349 hal: re-architect command encoding and pooling 2021-06-14 13:30:28 -04:00
Dzmitry Malyshau d8979cad4a hal/vk: command pools, clippy warnings 2021-06-14 10:26:40 -04:00
Dzmitry Malyshau c2bb2d5dfc Experimental command pool API 2021-06-14 01:58:09 -04:00
Dzmitry Malyshau 4eae5a38d0 hal/vk: hook up gpu-descriptor 2021-06-12 01:04:15 -04:00
Dzmitry Malyshau 61e2e242cd hal/vk: textures and samplers 2021-06-11 19:14:41 -04:00
Dzmitry Malyshau 9ae5e36ad8 hal/vk: format mapping 2021-06-11 14:27:00 -04:00
Dzmitry Malyshau faf8f7e890 Simple API for coherent mapping 2021-06-10 16:05:44 -04:00
Dzmitry Malyshau d88aa99997 Fix rows-per-image treatment, clippy warnings 2021-06-10 15:43:21 -04:00
Dzmitry Malyshau 006f8abbba build and clippy fixes, command buffer cleanup 2021-06-10 12:44:29 -04:00
Dzmitry Malyshau 782c72d32c hal/mtl: queue 2021-06-10 10:54:06 -04:00
Dzmitry Malyshau 3109b1b63d hal/mtl: most of the command encoding 2021-06-10 02:31:31 -04:00
Dzmitry Malyshau bdaf57dbed hal/mtl: pipelines and fences 2021-06-09 23:38:48 -04:00
Dzmitry Malyshau 9f904700ee hal/mtl: creation of bind groups 2021-06-09 17:06:43 -04:00
Dzmitry Malyshau 6d229847be hal: redesign the bind group descriptor 2021-06-08 17:12:28 -04:00
Dzmitry Malyshau a0b51ce35c hal: remove the cows 2021-06-08 15:18:06 -04:00
Dzmitry Malyshau a421c1c8b6 Instance plumbing 2021-06-08 11:46:53 -04:00
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
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