Commit Graph
818 Commits
Author SHA1 Message Date
Dzmitry Malyshau 450defb743 Fix panic in surface cleanup 2021-08-13 02:09:43 -04:00
Dzmitry Malyshau f2a18ee57c Update naga to 1907a92 2021-08-12 23:58:19 -04:00
Connor Fitzgerald 4dc0e265ac Merge pull request #1764 from kvark/submitted-work
Implement onSubmittedWorkDone
2021-08-12 00:06:45 -04:00
Dzmitry Malyshau 4a1ae0d7ec Issue surface texture transitions 2021-08-11 20:58:42 -04:00
Dzmitry Malyshau dffe1f1793 Return a texture by the surface 2021-08-11 20:58:42 -04:00
Dzmitry Malyshau f78061bcef Merge swap chain into surface 2021-08-11 20:58:42 -04:00
Connor Fitzgerald a60d2f6f3b Merge pull request #1774 from ElArtista/gles_storage_limits 2021-08-10 13:09:49 -04:00
Agorgianitis Loukas 8796089636 Gather downlevel flags and require them all at once 2021-08-07 11:17:43 +03:00
Agorgianitis Loukas 5bc42843cf Add downlevel flag for storage buffers in vertex shaders 2021-08-06 21:22:16 +03:00
Joshua Yanovski bff04c1502 Fix dynamic offset handling for render bundles
I found this while testing a "bundlemark" version of bunnymark.
2021-08-06 10:38:35 -07:00
Zicklag 9310f264f1 Update Naga With New Storage Classes API (#1766) 2021-08-05 13:50:51 -04:00
Lonsdaleiter 64ffdd52ad Added is_surface_supported (#1763) 2021-08-04 14:27:08 +00:00
Dzmitry Malyshau 80cf1ffff9 Implement onSubmittedWorkDone 2021-08-04 01:03:26 -04:00
Mikko Lehtonen 5d9c276c82 Include naga diagnostic in the parse error (#1760)
Wraps the Naga's `ParseError` with `NagaParseError` type, that uses the
Naga's full error formatting for its `Display` impl, including shader
source.
2021-08-03 17:27:34 -04:00
Mikko Lehtonen 78e4cd5dbc Remove AsDisplay trait in error formatting 2021-08-03 11:51:52 -04:00
Mikko Lehtonen 019dca3cfa Error formatting impls closer to errors
This is achieved by making a ErrorFormatter helper that is passed to
fmt_pretty, making the impls a lot simpler.
2021-08-03 11:51:52 -04:00
Mikko Lehtonen e4cdddc639 Move error formatting to wgpu-core 2021-08-03 11:51:52 -04:00
Zicklag 07cd75a36b Fix New Clippy Lints From Rust 1.54.0
Fixes a number of new lints introduce in the updated clippy that
CI is now using.
2021-07-29 16:29:46 -05:00
Zicklag fd460fa1e4 Use Bitshift Style for All Bitflag Consts
This makes existing bitflags easier to read and makes it eaiser to add
new flags later.
2021-07-28 11:28:54 -05:00
Dzmitry Malyshau 552a5f138e Rename texture usage names 2021-07-28 00:17:54 -04:00
Dzmitry Malyshau 69f808c54a hal/dx12: support base vertex/instance 2021-07-27 08:59:41 -04:00
bors[bot]andRiccardo Zaglia 3eb3eed8cf Merge #1609
1609: [Vulkan] Initialize wgpu objects from raw handles r=kvark a=zarik5

**Connections**
This PR is a successor of https://github.com/gfx-rs/gfx/pull/3762

**Description**
The `handle_is_external` flag mechanism was not enough to ensure safety, when for example the Instance is wrapped in `Arc<>` and a library cannot keep track of all its clones. This is the case with the bevy render rewrite. The solution was to let wgpu be in charge of destroying the handles, but it also has to keep a reference to a "drop guard" which is always dropped after the handle is destroyed. For the OpenXR integration, this drop guard will be `xr::Instance`.

For now this is just a proof of concept. Only instance creation is handled, and there is even type error in `wgc::Instance::from_hal()`.

I have a few concerns:
* Is it ok to expose `hal::Instance` from the wgpu crate? Or should the user pass all the parameters so `hal::Instance` can be constructed internally? This second options is more disruptive, since the wgpu-types crate would need to import all platform-specific crates to define the structure/enum to hold the raw handles.
* Without counting the call to create the `hal::Instance`, there are 4 indirection calls to save the raw instance. Can this be optimized in any way?

Do you think it is possible to merge wgpu-hal into wgpu-core? This could help with reducing the distance from the surface level API to the platform specific APIs even more.

**Testing**
Vulkan/Android (Oculus Quest) using [this sample](https://github.com/zarik5/openxrs/blob/wgpu-test/openxr/examples/vulkan.rs).


Co-authored-by: Riccardo Zaglia <riccardo.zaglia5@gmail.com>
2021-07-26 05:03:13 +00:00
Riccardo Zaglia 2657849977 [Vulkan] Initialize wgpu objects from raw handles 2021-07-25 21:51:40 +02:00
Dzmitry Malyshau 52734bf87a Fix tracing feature for RODS 2021-07-23 11:33:22 -04:00
Dzmitry Malyshau 34b68121c6 Check bundle RODS against pass RODS 2021-07-23 11:24:05 -04:00
Dzmitry Malyshau bb218c1580 Check render bundle encoding for RODS 2021-07-23 11:24:05 -04:00
Dzmitry Malyshau 2c45796d9c Update Naga to cc91c77 2021-07-23 02:19:42 -04:00
bors[bot]andDzmitry Malyshau 5ef620ace8 Merge #1704
1704: Fix buffer memory initialization to use the tracker consistently r=kvark a=kvark

**Connections**
Depends on https://github.com/gfx-rs/naga/pull/1125

**Description**
Contains a number of dx12 fixes in addition to the buffer initialization fix.
The problem there was - we used the "pending writes" command buffer to initialize buffers, but also used the device's resource tracker and its state to figure out the transitions *after* a command buffer is merged its states.

**Testing**
Ran the examples on Vulkan.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-23 04:48:42 +00:00
Dzmitry Malyshau 09c9ab5e75 Fix buffer memory initialization to use the tracker consistently 2021-07-22 01:19:53 -04:00
Connor Fitzgerald 683d03a8e4 Add Rgb9e5Ufloat 2021-07-21 23:54:46 -04:00
Dzmitry Malyshau 1a9a855ea9 Rename InputStepMode to VertexStepMode 2021-07-21 17:48:00 -04:00
initial-algebra 0db00e9657 Implement Feature::SHADER_PRIMITIVE_INDEX on Vulkan 2021-07-17 15:31:35 -03:00
Dzmitry Malyshau 5419947095 hal/vk: relay semaphore 2021-07-16 17:55:03 -04:00
Dzmitry Malyshau 509b683e6b hal: renderdoc integration 2021-07-14 16:17:39 -04:00
Boris-Chengbiao Zhou 783c85e264 hal: Fix copy-paste error in texture copy dimensions 2021-07-14 19:52:57 +02:00
Dzmitry Malyshau 8cd17aafe3 Switch read-only storage textures to be exclusive and behind a feature 2021-07-14 01:04:37 -04:00
0f784bb3c0 Merge #1602
1602: New DX12 backend (unfinished) r=kvark a=kvark

**Connections**
Continuation of #1471

**Description**
Mostly fresh implementation on DX12 backend for wgpu-hal
Core changes:
  - texture usage is filtered before passing to `create_texture_view`, so that wgpu-hal can assume every bit is important.
  - all the copies involving textures are limited to one array layer at a time
  - remove render pass boundary usages

**Testing**
Examples (not running yet)


Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-13 22:26:44 +00:00
Dzmitry Malyshau bbb046077e Check for blendable flag in filtering 2021-07-13 13:13:40 -04:00
Dzmitry Malyshau 0df804e9c2 hal/dx12: bunch of validation fixes 2021-07-13 02:54:37 -04:00
Dzmitry Malyshau 00859b9e0c Stop using render pass boundary usages for resource transitions 2021-07-13 01:02:42 -04:00
Dzmitry Malyshau 81f31f5555 hal: change blend color argument 2021-07-13 01:01:30 -04:00
Dzmitry Malyshau 35ee65707f hal: make copy to work on one array layer at a time 2021-07-13 01:01:26 -04:00
Dzmitry Malyshau c7519432ee Filter texture usages on view creation 2021-07-13 01:01:21 -04:00
Dzmitry Malyshau c01f6a557e hal/dx12: enable the backend in wgpu-core 2021-07-13 01:01:19 -04:00
bors[bot]andAndreas Reich 5c2e40c6ed Merge #1636
1636: Rename StoreOp::Clear to StoreOp::Discard r=kvark a=Wumpf

(recent change in spec)

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-07-12 16:47:19 +00:00
Andreas Reich f5a4cbc0e1 Rename StoreOp::Load to StoreOp::Discard
(recent change in spec)
2021-07-12 18:06:15 +02:00
bors[bot]andConnor Fitzgerald 4781d9da7b Merge #1607
1607: Fix Downlevel Vertex Stage Storage Buffer Check r=kvark a=cwfitzgerald

**Connections**

Fixes a bug in #1599. Also follows up on #1583 marking all of hello-compute as a failure.

**Testing**

Tests now pass on rpi4.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-07 14:01:37 +00:00
Connor Fitzgerald 8ded21862e Fix downlevel vertex stage storage buffer check 2021-07-06 21:43:47 -04:00
Benoît du Garreau e7269e72f3 Upgrade arrayvec to 0.7 2021-07-06 00:45:24 +02:00
bors[bot]andConnor Fitzgerald 118cf2cdba Merge #1599
1599: Fix Limits for lava/llvmpipe and re-enable and re-work CI r=kvark,groves,wumpf a=cwfitzgerald

**Connections**

No longer fixes #1551.

**Description**

This PR has a couple things going on at once.

- Fixes limits for llvmpipe, lavapipe, and rpi4.
- Added a downlevel limit to express that RPI4 does not allow storage buffers in vertex shaders on GL.
- Added a `Limits::downlevel_default()` that takes minimum limits from GLES and adds some more documentation on how to choose limits.
- Moved all examples to the new downlevel limits
- Reworks CI to re-enable software testing and unify instructions.

**Testing**

It is

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-04 19:23:23 +00:00