Commit Graph
51 Commits
Author SHA1 Message Date
bors[bot]andDzmitry Malyshau bc065e4abc Merge #615
615: Use General allocator at all times for now r=grovesNL a=kvark

In all user-managed resources, we don't have control of the lifetime. Since we don't know when it's released, we can't use any more specific allocator kind than `General`.

Previously, we assumed that buffers created for MAP_READ+COPY_SRC, for example, were one-time buffers created to copy data. However, there appear to be cases where they were used to fill data in once, and then persistently used as a copy source destination.

In the future, one WebGPU data transfer story is settled, we'll be able to use `Linear` kind again for all internally managed uploads. I.e. writeBuffer, writeTexture, and createBuffeMappedOnlyAtStart.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-25 02:08:54 +00:00
Dzmitry Malyshau fc68b5ef54 Use General allocator at all times for now 2020-04-24 21:59:41 -04:00
Dzmitry Malyshau 09d3623885 Minor error reporting fixes (#607) 2020-04-24 21:58:30 -04:00
Dzmitry Malyshau 5e458b5d45 Separate public usage from internal use (#601) 2020-04-21 09:12:40 -04:00
Aron Granberg 21b441d087 Improve error messages for mismatched binding types (#593) 2020-04-20 14:41:40 -04:00
Almar Klein e7005548c0 Warn when binding a buffer that is still mapped 2020-04-16 11:35:03 +02:00
bors[bot]andDzmitry Malyshau 729ecb1404 Merge #582
582: Track pipeline layout lifetime r=grovesNL a=kvark

Fixes #580
This one is interesting: it's not instantly destroyed when dropped, like bind group layouts. And it's not tracked for GPU usage like the resources. It's somewhat in-between. We have the following classes of tracking now:
  1. no tracking, destroyed on drop. Applies to: bind group layouts, adapters
  2. only CPU-side tracking. They go to "suspected" list on drop of self or anything that can point to them. Applies to: pipeline layouts
  3. full GPU tracking. They go to "suspected" list on drop, then get associated with active submission before destruction. Applies to: buffers, textures, views, bind groups, pipelines

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-14 13:08:29 +00:00
Dzmitry Malyshau 3cc4fa51bc Track pipeline layout lifetime 2020-04-14 00:58:30 -04:00
Dzmitry Malyshau a0701b41cb Fix buffer unmap warning 2020-04-14 00:08:04 -04:00
Dzmitry Malyshau d9609ec269 Remove array layer count from texture descriptor 2020-04-13 11:44:10 -04:00
Aron Granberg 3db1e6c10d Improve error message when bind group and bind group layout have different number of entries 2020-04-11 11:22:40 +02:00
Dzmitry Malyshau 920c00931d Fix tracking of the initial state during replacement.
When multiple "replace" style transitions are happening,
we weren't properly retaining the "first" state, which
is required for proper stitching of command buffers.

This logic is fixed and fortified with a new set of
"change" and "merge" tests in the track module.
2020-04-10 00:39:23 -04:00
Aaron Loucks b6ec8440e9 Increase default maximum vertex buffer inputs from 8 to 16
Additionally, the input states are now stored in a `SmallVec` to
enable higher limits.

Fixes #558
2020-04-07 21:00:06 -04:00
Dzmitry Malyshau a3aefe2535 Rustfmt stable pass 2020-04-06 08:55:39 -04:00
Rukai 99161cbeb5 Use crates.io release of peek-poke 2020-04-05 23:06:02 -04:00
Dzmitry Malyshau 00c98e7d5a Fix order of maintenace between submission tracking and buffer mapping. 2020-04-05 14:39:10 -04:00
Dzmitry Malyshau f07943f2d8 Use NonZeroU64 for Id 2020-04-04 19:43:16 -04:00
Kunal Mohan fb1c448aa9 Add BufferMapState enum
fix #395
Add BufferMapState enum to track the state of buffer
mapping and store any mapping details in case one is
pending.
2020-04-03 07:55:23 +05:30
bors[bot]andHeroesGrave 306554600a Merge #540
540: Add serialization to more types r=kvark a=HeroesGrave

With these changes, pretty much everything in wgpu-types can be serialized with the exception of BufferDescriptor, CommandEncoderDescriptor, and TextureDescriptor which contain a `*const c_char`.

Options for dealing with those:
- Leave these types as not de/serializable
- Skip when serializing, deserialize as nullptr
- Serialize as a string, deserialize as nullptr

AFAICT there's not really a way to allow a full roundtrip for these fields because nul-terminated strings don't play nicely with serde. Maybe it could serialize as a byte array?

Co-authored-by: HeroesGrave <heroesgrave@gmail.com>
2020-03-28 14:44:08 +00:00
HeroesGrave 1702a54c5c Add Undefined variant to CompareFunction 2020-03-28 16:20:47 +13:00
Joshua Groves f3bb6eb230 Move more types to wgpu-types 2020-03-27 23:26:17 -02:30
Dzmitry Malyshau 8aeeb8e318 Port to gfx-extras and gfx-hal-0.5 2020-03-27 00:54:01 -04:00
Lachlan Sneff bcd7744c5b Unbox unnecessarily boxed function 2020-03-26 22:38:50 -04:00
Aaron Loucks fdcf9e7067 Add inital debug labels
- bind group
- bind group layout
- command encoder
- texture
2020-03-24 19:43:11 -04:00
Aaron Loucks 2700d1cc15 Add buffer debug labels 2020-03-24 19:38:07 -04:00
Dzmitry Malyshau 5e2f200223 Track GPU use of compute and render pipelines (#534) 2020-03-24 19:28:26 -04:00
Dzmitry Malyshau 0a30cf4b46 Recycled identity management (#533) 2020-03-24 19:18:42 -04:00
Dzmitry Malyshau 272e423a5c Improve shutdown cleanup (#532) 2020-03-24 18:03:25 -04:00
Joshua Groves b9259c0c8c Move more types into wgpu-types 2020-03-16 23:57:50 -02:30
Dzmitry Malyshau 7f966be455 Update naming of bindings to entries 2020-03-16 10:06:54 -04:00
Joshua Groves b58c15815b Move more shared types into wgpu-types 2020-03-14 23:08:05 -02:30
Dzmitry Malyshau 26657374f8 Update vertex layout naming 2020-03-14 12:44:04 -04:00
Dzmitry Malyshau 095f320470 Wholesome spec update.
Biggest change is that buffer binding is done one by one. There is a number of renamings of the fields, also the binding types are expanded.
2020-03-13 23:59:05 -04:00
Joshua Groves 9940aef599 Move some types into shared wgpu-types crate 2020-03-10 22:36:23 -02:30
Dzmitry Malyshau 023ce7f6c8 Catch swapchain output being dropped too early 2020-02-18 22:57:12 -05:00
Dzmitry Malyshau ab416bcc68 All the missing Gecko fixes 2020-02-09 20:15:55 -05:00
Dzmitry Malyshau 8a5de68aab Refactor the swap chain frame tracking 2020-01-21 14:24:45 -05:00
yanchith 53b9a01b2f Resolve trivial clippy warning 2020-01-17 14:44:02 +01:00
bors[bot]andLayl 3a41272cba Merge #448
448: Fix framebuffers not always being cleaned up if invalid r=kvark a=LaylConway

This changes framebuffers to be cleaned up if only one view is cleaned up, instead of if all views are cleaned up. This is necessary because currently, at least for me, swapchain images will have a different view every frame. This means that if other views continue to exist between frames, the resulting framebuffers will never be cleaned up.

Fixes #447

Co-authored-by: Layl <2385329-layl@users.noreply.gitlab.com>
2020-01-15 14:24:19 +00:00
Layl 6202d5ddad Fix framebuffers not always being cleaned up if invalid 2020-01-15 15:11:16 +01:00
Dzmitry Malyshau 92441c38a2 Fix missing transitions before the render pass 2020-01-13 16:52:58 -05:00
Zakor Gyula 2fbda5a3c1 Fix missing memory release 2020-01-13 15:44:15 +01:00
Zakor Gyula 94fe1436f1 Fix missing memory allocator disposal 2020-01-13 15:44:15 +01:00
Dzmitry Malyshau bcf533fd89 Refactor usage tracker init() 2020-01-08 23:19:52 -05:00
Dzmitry Malyshau 017a54ff97 Refactor usage tracking to be truly sparse 2020-01-08 22:43:19 -05:00
Dzmitry Malyshau bbe0d7df1b Command buffer/encoder destruction 2020-01-08 18:14:45 -05:00
Dzmitry Malyshau 59a9d14c81 Suspect unlinked resources used in submissions 2020-01-08 18:14:07 -05:00
Dzmitry Malyshau 040efa2820 Fix refcount use of the texture view source 2020-01-08 18:13:43 -05:00
Dzmitry Malyshau bf8c9fe27b Make device tracker to be the last home for destroyed resources 2020-01-08 18:13:43 -05:00
Dzmitry Malyshau 73f6fbbf88 use full Id paths in the device module 2020-01-08 18:10:53 -05:00