Commit Graph

1203 Commits

Author SHA1 Message Date
Dzmitry Malyshau
15cdc794fa Shader binding validation 2020-06-05 12:48:34 -04:00
Dzmitry Malyshau
534d7ac504 Validate pipeline layout creation 2020-06-05 12:48:34 -04:00
Dzmitry Malyshau
f158709dd0 Validate bind group layouts 2020-06-05 12:48:34 -04:00
Connor Fitzgerald
08c0460e32 Add assert that old SwapChainOutput is dead after SwapChain is remade 2020-06-04 23:42:59 -04:00
Dzmitry Malyshau
b5c38ae40d Prevent internal thread from cleanup 2020-06-04 22:45:59 -04:00
Connor Fitzgerald
ade7ce10b2 Rustification of Extensions and SamplerDescriptor 2020-06-02 21:04:25 -04:00
Dzmitry Malyshau
075e683cb5 Fix tracing of buffers that are mapped at creation 2020-06-02 16:30:41 -04:00
Dzmitry Malyshau
1acd1901de Fix bytes_per_row used in write_texture 2020-06-02 13:44:12 -04:00
Dzmitry Malyshau
ae17ea7625 New map_async logic, change the semantic of mapped buffers. 2020-06-02 13:44:00 -04:00
Dzmitry Malyshau
aa12e7dc14 Read-only depth-stencil support 2020-06-01 19:54:56 -04:00
Dzmitry Malyshau
321a5cee0f Enforce copy buffer-texture row pitch alignment 2020-06-01 16:51:42 -04:00
Connor Fitzgerald
415ce97415 Implement anisotropic filtering and extensions/limits 2020-06-01 10:43:54 -04:00
Dzmitry Malyshau
6fb2b272e4 Fix recycling of command buffers 2020-05-31 11:50:24 -04:00
Dzmitry Malyshau
7181bfe977 Move BufferSize to wgpu-types 2020-05-30 01:19:42 -04:00
Jay Oster
5daef9acc2 Remove unnecessary features 2020-05-29 05:25:03 -07:00
Jay Oster
09328ec2eb Make libx11 optional 2020-05-27 21:05:53 -07:00
bors[bot]
4c136418ff
Merge #667
667: Add asserts to validate that a resource exists when used r=kvark a=DavidPeicho

Hi,

As discussed in #610, this is mostly for C/C++ users. Some questions:
* Would it be possible to display the ID of the resource that failed? I don't know what you think about implementing the `Display` trait on the `Id` struct? 
* Do you see other places needing for checks?

Thanks!

Co-authored-by: David Peicho <david.peicho@gmail.com>
2020-05-26 22:23:31 +00:00
bors[bot]
6650b94ff6
Merge #668
668: Return failures to the user in swap_chain_get_next_texture, rather than transparently reconfiguring. r=kvark a=AlphaModder

TODO:
- [x] Change `Global::swap_chain_get_next_texture` in `wgpu-core`.
- [x] Update `wgpu_swap_chain_get_next_texture` in `wgpu-native`. (https://github.com/gfx-rs/wgpu-native/pull/32)
- [x] Wrap `SwapChainOutput`/`SwapChainStatus` in a nice enum in `wgpu-rs`. (https://github.com/gfx-rs/wgpu-rs/pull/323)
- [ ] Update `wgpu_bindings` (?)

Co-authored-by: AlphaModder <quasiflux@gmail.com>
2020-05-26 21:26:15 +00:00
AlphaModder
e89c3d6b1c Alter swap_chain_get_next_texture to bubble up failures to the user. 2020-05-26 14:15:22 -07:00
Dzmitry Malyshau
79eb7b9c17 Minor fixes in Gecko 2020-05-26 16:41:24 -04:00
David Peicho
96bdaa2a9f storage: add attribute to pretty-print invalid resource usage 2020-05-26 18:46:10 +01:00
Paul Kernfeld
d529526e7f
"Use the whole buffer" is !0, not 0 (#663)
* "Use the whole buffer" is !0, not 0

Fixes #654
Applies to BufferBinding, set_vertex_buffer, set_index_buffer

* Add BufferSize type alias

* Make BufferSize a transparent type

Add a custom serialization "buddy" type
Use BufferSize::WHOLE instead of crate::WHOLE_SIZE

* Move SerBufferSize into device::trace mod

Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
2020-05-26 13:25:06 -04:00
Dzmitry Malyshau
4e1d76013c Add missing repr(C) on copy views 2020-05-26 09:35:09 -04:00
Dzmitry Malyshau
e4659b6d05 Bring back BufferCopyView 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
679dba044b Remove array layers from texture copies 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
dff37bb65d Move TextureDataLayout to wgpu-types 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
fcf1d2762d Use TextureDataLayout consistently 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
2695d64269 Share code between write_buffer and write_texture 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
a4ea5358ef Implement write_texture 2020-05-26 00:15:09 -04:00
Dzmitry Malyshau
70154373f8 Fix indirect buffer access flags 2020-05-22 16:25:09 -04:00
yanchith
58a60392c2 Fix possible out-of-bounds when trace log level enabled
Also, even when there was no out-of-bounds access, the log statement talked
about an incorrect submission index.
2020-05-17 12:17:36 +02:00
Dzmitry Malyshau
8b9ddbfbca Vecmap dependency update to 0.8.1 2020-05-15 10:41:20 -04:00
Dzmitry Malyshau
4c62b20282 Multiple fixes and clean ups.
- Clean up after the pending writes on destroy.
- Fix temporary buffer creation.
- Fix internal thread initialization by the command allocator.
- Clean up player event_loop usage.
2020-05-11 14:07:02 -04:00
Dzmitry Malyshau
786ead9701 Destroy temporary buffers 2020-05-11 10:53:21 -04:00
Dzmitry Malyshau
35f2e8b70e Move queue logic into a submodule 2020-05-10 22:40:04 -04:00
Dzmitry Malyshau
ba8c2eae54 Implement Queue::write_buffer 2020-05-10 01:21:47 -04:00
Gabriel Majeri
f70f32af87 Add optional SPIR-V shader validation
# Conflicts:
#	Cargo.lock
2020-05-09 19:55:10 +03:00
bors[bot]
54c6f6751b
Merge #645
645: Add a loom test for RefCount r=kvark a=paulkernfeld

A first effort at gfx-rs/wgpu-rs#96
loom testing is gated behind cfg(loom)

Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
2020-05-06 18:10:43 +00:00
Paul Kernfeld
29a4cee002 Add a loom test for RefCount 2020-05-06 13:53:57 -04:00
Dzmitry Malyshau
cf8513baf5 Proper maintenance of the command pools 2020-05-06 11:15:08 -04:00
Dzmitry Malyshau
4c448c3fc5
Add a way to destroy a pass by a mutable reference (#647) 2020-05-05 21:52:06 -04:00
Dzmitry Malyshau
3e57c11260 Refactor create_surface a bit 2020-05-05 09:47:51 -04:00
Dzmitry Malyshau
fbc533bfee Save bind group layout inside pipeline layouts 2020-05-04 23:46:06 -04:00
Anton Lazarev
29ce9a44cf
Pass through raw-window-handle 2020-05-04 15:55:19 -04:00
Dzmitry Malyshau
71d4f77ab8 Wait for idle before destroying swapchains 2020-05-03 23:39:05 -04:00
Dzmitry Malyshau
831d908663 Properly destroy swap chains 2020-05-03 22:13:43 -04:00
Paul Kernfeld
cc2e6db7f5 Make assertions more verbose in src/command
This contributes to #485
2020-05-02 13:16:09 -04:00
bors[bot]
e2100b6911
Merge #621
621: Keep Adapter alive r=grovesNL a=kvark



Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-05-01 04:30:09 +00:00
Dzmitry Malyshau
f35dd741aa
Android support (#625) 2020-05-01 00:22:00 -04:00
Dzmitry Malyshau
288f8342b1 Don't drop the Global on panic 2020-05-01 00:20:54 -04:00
Dzmitry Malyshau
9500cfa4f3 Keep Adapter alive by the device 2020-05-01 00:20:54 -04:00
Paul Kernfeld
29fe9a935a
Make assertions in wgpu-core device/mod.rs verbose (#622)
Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
2020-05-01 00:05:13 -04:00
Dzmitry Malyshau
f64b2dd3bb trace: make Id serialization nicer 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
3c68fb17e4 player: full winit integration 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
77a5eda796 trace: fix reusing object ids 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
854c1be035 trace: support pipelines, refactor destruction sequence 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
018417f174 trace: replaying all the commands 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
47f37ad78e trace: player skeleton 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
622d9ecc74 trace: all the commands 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
d4705b6008 trace: bind groups, shaders, and buffer contents 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
1cc548a7a2 Make descriptors generic over Label 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
4c1ea02553 trace: hook up RON output 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
5035ffdfe2 Split limits and private features, add tracing module 2020-04-30 09:55:52 -04:00
Dzmitry Malyshau
0e533547a1 Split serde feature into trace+replay 2020-04-30 09:55:52 -04:00
bors[bot]
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
baf435d8b8
Add is_power_of_two function (#603) 2020-04-21 09:29:10 -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
Dzmitry Malyshau
df2c97ff0c Fix host mapping buffer barriers 2020-04-18 16:56:05 -04:00
Dzmitry Malyshau
75d0157aa7 Enable READ access for texture storage 2020-04-18 13:29:17 -04:00
bors[bot]
daf45362bc
Merge #591
591: Warn when binding a buffer that is still mapped r=kvark a=almarklein

Fixes #510

I'd like to make more contributions wrt validation. Though I'm quite new to Rust, so let's start small :)  

From the discussion in #510 I concluded that in this case the buffer has actually been dropped, does the error message make sense like this?

Do the messages logged with `log::warn`, end up in the same logging system as the layer validation messages? So a solution to get those messages into Python (for wgpu-py) would work for both kinds of validation messages?


Co-authored-by: Almar Klein <almar.klein@gmail.com>
2020-04-17 21:15:19 +00:00
Dzmitry Malyshau
8eefe269c1 Derive swapchain layout off the load operation 2020-04-16 21:49:24 -04:00
Almar Klein
e7005548c0 Warn when binding a buffer that is still mapped 2020-04-16 11:35:03 +02:00
bors[bot]
6b0751f1f8
Merge #586
586: Improve drawing error messages r=kvark a=HalfVoxel



Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2020-04-15 12:59:58 +00:00
Aron Granberg
41a6425fb2 Improve drawing error messages 2020-04-15 02:29:37 +02:00
Aron Granberg
5f6accc206 Improve error messages when passing buffers with the wrong usage flags 2020-04-14 20:18:00 +02:00
bors[bot]
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
bors[bot]
96a4a34b83
Merge #581
581: Fix buffer unmap warning r=kvark a=kvark

It's more consistent if neither map_buffer or unmap_buffer care about the status.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-14 11:24:19 +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
379ea37982 Comment fixes, header update 2020-04-13 18:48:08 -04:00
Dzmitry Malyshau
d9609ec269 Remove array layer count from texture descriptor 2020-04-13 11:44:10 -04:00
bors[bot]
f50dd7a299
Merge #570
570: Improve error message when bind group and bind group layout have different number of entries r=kvark a=HalfVoxel



Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2020-04-13 00:17:43 +00:00
Dzmitry Malyshau
357ee9a447 Fix read-only flags 2020-04-11 20:50:20 -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
Dzmitry Malyshau
74e9e89fe7 Refactor tracking of swapchain images as attachments
We were improperly detecting if a swapchain image has already
been used by a command buffer. In this case, we need to assume
that it's already in the PRESENT state.
2020-04-10 00:38:53 -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
7dba052900 Version bump and CHANGELOG update 2020-04-06 08:55:39 -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
bors[bot]
d6d31695d3
Merge #553
553: Fix order of maintenace between submission tracking and buffer mapping. r=kvark a=kvark

Fixes https://github.com/gfx-rs/wgpu-rs/issues/237

Logic needs to have the following order:
  1. we first wait for the device to finish
  2. then we move some tracked resources from per-submission lists into the "ready to destroy" or "ready to map" lists.
  3. then we handle mapping, which goes through "ready to map" lists
  4. then we destroy everything for realz that needs to be

That order got broken with #547

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-05 21:54:16 +00:00
bors[bot]
8f9f13fc8c
Merge #550
550: Add check for bound pipeline r=kvark a=kunalmohan

fix #456
Validate that a pipeline is bound before issuing any draw/dispatch call.

Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
2020-04-05 19:58:26 +00:00
Dzmitry Malyshau
00c98e7d5a Fix order of maintenace between submission tracking and buffer mapping. 2020-04-05 14:39:10 -04:00
Kunal Mohan
aef0c7c2c4
Add check for bound pipeline
fix #456
Validate that a pipeline is bound before issuing
draw/dispatch call.
2020-04-05 11:16:50 +05:30
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
Dzmitry Malyshau
f3eee020e6 Check surface compatibility 2020-03-30 23:31:24 -04:00
bors[bot]
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
2e9610e8c9 Request NDC_Y_FLIP feature 2020-03-27 00:54:01 -04:00
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
aloucks
e39aaa9cb3
Implement PartialEq, Eq, and Hash for more types (#535) 2020-03-24 19:29:18 -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
bors[bot]
d3e47fc5ae
Merge #521
521: Texture component type r=kvark a=kvark

Matching the upstream spec...

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-03-17 16:58:34 +00:00
Joshua Groves
b9259c0c8c Move more types into wgpu-types 2020-03-16 23:57:50 -02:30
Dzmitry Malyshau
c4e3fb4d36 Add texture component type field to BGL entry 2020-03-16 12:02:26 -04:00
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
bors[bot]
a74de20ac6
Merge #514
514: Move some types into shared wgpu-types crate r=kvark a=grovesNL

As we discussed a while ago, we need to be able to share some types between wgpu-core/wgpu-native/wgpu-remote/wgpu-rs.

The problem is that we want to avoid a dependency on wgpu-core and wgpu-native when building [wgpu-rs for the wasm32-unknown-unknown target](https://github.com/gfx-rs/wgpu-rs/issues/101). We can avoid this by moving all shared types into a separate crate which is exposed on all targets.

Let me know if we should use some other approach or organize the types somehow. This isn't complete yet, but it might be easier to integrate this over several PRs instead of diverging my branch too far.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-03-11 03:07:17 +00:00
Joshua Groves
24caf76765 Rename serde feature 2020-03-10 23:19:45 -02:30
Joshua Groves
9940aef599 Move some types into shared wgpu-types crate 2020-03-10 22:36:23 -02:30
Aaron Loucks
fe95fddf5a Use vulkan nomenclature for PresentMode variants
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPresentModeKHR.html
2020-03-06 00:48:45 -05:00
Aaron Loucks
051d08424c Add PresentMode::Mailbox 2020-03-05 18:19:18 -05:00
Kartikaya Gupta
b5ba17012a Update WebGPU to mozilla-central from hg rev 0f1a8e4c6a76b3b0b16902c7fdfe2356c60ca351 2020-02-20 15:49:32 -05:00
Dzmitry Malyshau
023ce7f6c8 Catch swapchain output being dropped too early 2020-02-18 22:57:12 -05:00
Dzmitry Malyshau
a0759b983d Fix binding compatibility of an absent group 2020-02-16 20:17:53 -05:00
bors[bot]
a048f5e5d5
Merge #492
492: Encode render targets into the render pass blob r=grovesNL a=kvark

Fixes #454

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-02-11 12:58:14 +00:00
bors[bot]
73374021d7
Merge #480
480: Implement `enumerate_adapters`. r=kvark a=daxpedda

This is take two of #478, it's a much smaller change with less abstraction.

-  implement `internal_enumerate_adapters`, which refactors `instance.{BACKEND}.enumerate_adapters()` out of `pick_adapter`
-  implement `enumerate_adapters`, which just returns a vector of all GPUs in the form of `AdapterId`

Co-authored-by: daxpedda <daxpedda@gmail.com>
2020-02-10 19:01:20 +00:00
daxpedda
eb6eec5c95
Implement enumerate_adapters. 2020-02-10 19:54:36 +01:00
Dzmitry Malyshau
e05471ad6d Encode render targets into the render pass blob 2020-02-10 12:44:44 -05:00
Dzmitry Malyshau
ab416bcc68 All the missing Gecko fixes 2020-02-09 20:15:55 -05:00
bors[bot]
d4a46cb60e
Merge #479
479: Serialize BindGroupBinding r=kvark a=imiklos



Co-authored-by: Istvan Miklos <istvan.miklos@h-lab.eu>
2020-01-28 12:41:08 +00:00
Istvan Miklos
38ba0e625a Serialize BindGroupBinding 2020-01-28 12:47:23 +01:00
daxpedda
cd8e2a30b2
Duplicate DeviceType from gfx-hal. 2020-01-26 23:09:58 +01:00
daxpedda
8c80557dd6
Return custom AdapterInfo that contains backend. 2020-01-25 18:22:34 +01:00
bors[bot]
009bde0f90
Merge #468
468: Switch value of BufferUsage's INDIRECT and STORAGE_READ fields r=kvark a=almarklein

Closes #467. This makes the value of `INDIRECT` equal to it's value in the IDL spec. (`STORAGE_READ` is not present in the IDL spec.)

I changed the value in `resource.rs` and then ran `make ffi/wgpu.h`.


Co-authored-by: Almar Klein <almar.klein@gmail.com>
2020-01-23 16:26:53 +00:00
Dzmitry Malyshau
b9e7449b43 Fix building on Rust 1.37
It doesn't like by-move pattern with an `if`
2020-01-23 00:52:04 -05:00
Almar Klein
299a051db1 Switch value of BufferUsage's INDIRECT and STORAGE_READ fields
This makes the value of INDIRECT equal to it's value in the IDL spec.
(STORAGE_READ is not present in the IDL spec).
2020-01-22 08:07:07 +01:00
Dzmitry Malyshau
8a5de68aab Refactor the swap chain frame tracking 2020-01-21 14:24:45 -05:00
Dzmitry Malyshau
ec54038e7c Improve STORAGE_READ support for buffers 2020-01-21 14:13:27 -05:00
Dzmitry Malyshau
ad7045455c Optionally request vertex shader stores and atomics 2020-01-21 14:12:08 -05:00
yanchith
ab205b042c Add # Safery docs to wgpu-core 2020-01-17 16:15:05 +01:00
yanchith
0d9ad70468 Add TODOs for range_plus_one clippy warnings 2020-01-17 14:44:17 +01:00
yanchith
53b9a01b2f Resolve trivial clippy warning 2020-01-17 14:44:02 +01:00
bors[bot]
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
bors[bot]
881222a947
Merge #451
451: Make BindGroupLayoutBinding Serializable r=kvark a=imiklos

cc @kvark @zakorgy

Co-authored-by: Istvan Miklos <istvan.miklos@h-lab.eu>
2020-01-14 20:04:21 +00:00
Istvan Miklos
0fdf77feb5 Make BindGroupLayoutBinding Serializable 2020-01-14 12:43:58 +01:00
Dzmitry Malyshau
a51019795e Switch to a custom fork of peek-poke 2020-01-13 16:52:59 -05:00
Dzmitry Malyshau
92441c38a2 Fix missing transitions before the render pass 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau
f798f7c631 Add missing render pass methods 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau
e0574ee899 Remove the old render and compute passes 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau
40ac14e92c Switch the examples to use the new raw passes 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau
941fcca08d Raw render pass encoding 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau
c01a7c6abe Use peek-poke for compute pass encoding 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau
20cd803d67 Standalone render passes 2020-01-13 16:52:58 -05:00
Dzmitry Malyshau
7808a4d4cd Stand-alone compute passes 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
Aaron Loucks
5ca57374f6 Check power/battery status when selecting adaptors
PowerPreference::Default will now prefer discrete GPUs
when on AC power and will prefer integrated GPUs while
on battery power (i.e. the battery is discharging).
2020-01-12 17:26:54 -05:00
Aaron Loucks
4b46e885fd Prefer discrete GPU for PowerPreference::Default 2020-01-11 03:07:45 -05: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
Dzmitry Malyshau
3a40ba2d60 Move lifetime tracker into a separate module 2020-01-08 18:10:53 -05:00
Dzmitry Malyshau
9acefac5b3 Heavy refactor of resource lifetime tracking 2020-01-08 18:06:28 -05:00
Layl
a221ca1c12 Fix cmd buffer cleanup not always using lowest active index 2020-01-08 01:17:58 +01:00
Dzmitry Malyshau
7be921495d Fix clippy warnings and errors 2020-01-04 13:20:28 -05:00
Layl
ac8f75288f Use current active list instead of storing last done 2020-01-02 01:33:45 +01:00
Layl
b55cd162bf Defer command buffer recycling until allocate 2020-01-02 01:33:45 +01:00
bors[bot]
2a2ab3dc2a
Merge #418
418: Hotfix deadlocks on resource cleanup r=kvark a=LaylConway

This resolves resource cleanup causing deadlocks with `maintain`, because of `Device::pending` being locked in reverse order.

I'm calling this a "hotfix" because I don't think this is a scaleable approach to resolve how the issue happened in the first place, but it alleviates current deadlocking isssues.

I'm not quite sure how `Token` works, so I don't know if I used that right here.

This fixes #417

Co-authored-by: Layl <2385329-layl@users.noreply.gitlab.com>
2019-12-31 06:07:35 +00:00
bors[bot]
8f42ba6676
Merge #412
412: Another big tracking refactor r=later a=kvark

Fixes #409
Note: there is way more code that had to be thrown out in the process of this PR than there is in the PR itself.
Also fixes [this comment](04e17b3f4f/wgpu-core/src/track/texture.rs (L29)):
> //TODO: make this less awkward!

## Logic
Instead of having a run-time per-operation control over what state is being used for stitching (with `Stitch` enum), we are now deriving this automatically on a per-subresource level. Whenever we are detecting a transition for a sub-resource, and we know there wasn't any "first" state associated with it in the current tracker, we are saving this "first" state. Unlike previous code, where it was confusing what of `Unit` fields (`init`, `last`) are valid, now `first` is `Option<>`, so we know we should be using it if it's there.

This allows us to have this hybrid tracking state of a render pass, where all resources are immutable (and their usage is extended), except for the output attachments. This, together with a whole lot of refactoring, gets us #409.

I'm actually quite happy with the tracking code now. It's finally taking shape we aren't afraid to tell others about :)

Note: this was tested on wgpu-rs examples and vange-rs.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2019-12-30 23:11:52 +00:00
bors[bot]
890bbcfbed
Merge #416 #420 #424
416: Makefile package command and travis github releases r=kvark a=Korijn

Closes #414

Approach mostly mimicked from [gfx-portability](https://github.com/gfx-rs/portability) as recommended to me by @kvark. I needed a number of commits to iron out some kinks for the Windows builds, so I would recommend using squash merge when accepting this PR.

Note that the Windows rust=nightly build fails, but it's also broken on master, so it's unrelated to the changes in this PR.

/cc @almarklein

# Questions

- [x] Would it make sense to also regenerate the `ffi/wgpu.h` and `wgpu-remote.h` header files and include them in the zip archive?

# Todo for maintainers

- [x] Configure encrypted `api_key`
As in [gfx-portability](https://github.com/gfx-rs/portability/blob/master/.travis.yml#L61) you will need to create an API key and commit it to the `.travis.yml` file. I've checked "allow edits from maintainers" so you should be able to commit to this branch directly. You may want to reference the [Travis instructions](https://docs.travis-ci.com/user/deployment/releases/#authenticating-with-an-oauth-token) as well.

- [ ] Tag revisions
Previous versions (`v0.1` - `v0.4`) have not been tagged on the master branch, you will want to do so retroactively. Also, when releasing in the future, make sure to tag the commit before pushing. Alternatively, you can schedule a travis build manually after applying the tag retroactively.

420: Make Origin3d::{x,y,z} all have type u32 r=kvark a=fintelia

Fixes #419 

424: swapchain creation: check if selected present mode is supported r=kvark a=Veykril

Implements a simple check as talked about in #350 to fallback to `FIFO` should the selected present mode not be available on the system.

Co-authored-by: Korijn van Golen <k.vangolen@clinicalgraphics.com>
Co-authored-by: Korijn van Golen <korijn@gmail.com>
Co-authored-by: Jonathan Behrens <fintelia@gmail.com>
Co-authored-by: Veykril <lukastw97@gmail.com>
2019-12-30 19:26:21 +00:00
Veykril
9eab6fc19e swapchain check present mode, default to vsync if selection is unsupported 2019-12-28 13:34:07 +01:00
Layl
9065e4c1cb Hotfix deadlocks on resource cleanup 2019-12-28 12:38:17 +01:00
Jonathan Behrens
461f114ad5 Make Origin3d::{x,y,z} all have type u32 2019-12-25 21:42:49 -05:00
yanchith
e9545c93ed Deduplicate Bind Group Layouts on creation
To make later bind group layout compatibility checks simpler (and
cheaper), deduplicate them on creation. If two bind group layouts with
same descriptors are requested, only one is created and the same id is
returned for both.
2019-12-17 18:32:33 +01:00
Dzmitry Malyshau
c0d6cf18e1 Refactor tracker initializers 2019-12-17 00:19:39 -05:00
Dzmitry Malyshau
d74c8cb5ae Refactor tracker stitches 2019-12-17 00:19:39 -05:00
Dzmitry Malyshau
109253247d Track render pass attachments in the pass tracker 2019-12-17 00:19:39 -05:00
Dzmitry Malyshau
38305c62f3 Fix tracking of render pass attachments 2019-12-15 23:10:38 -05:00
Dzmitry Malyshau
033624f160 Handle adapter enumeration failures better 2019-12-15 15:19:35 -05:00
Istvan Miklos
45be9035b7 Add Serialize/Deserialize derive to BufferDescriptor 2019-12-11 14:43:05 +01:00
Dzmitry Malyshau
bd24c20d4c Fix lock token lifetimes 2019-12-08 17:00:30 -05:00
Mac O'Brien
71cf7f0027 Re-export DeviceType 2019-12-07 15:05:53 -06:00
Mike Hommey
74d83fdedd Update smallvec to 1.0 2019-12-06 13:37:30 +09:00
Dzmitry Malyshau
486b1b6764 Remote buffer destruction 2019-12-03 08:59:22 -05:00
Dzmitry Malyshau
97766ab300 Get buffer sub data in wgpu-remote 2019-12-02 17:23:04 -05:00
Dzmitry Malyshau
2f74e227a8 Remote buffer mapping 2019-11-29 16:44:22 -05:00
bors[bot]
2006c07a57
Merge #387
387: Stop dynamic offset iteration when the bind groups stop r=grovesNL a=kvark

Fixes #386 

I imagine the code is not performance-optimal and could be improved. This PR focuses on correctness.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2019-11-29 02:08:19 +00:00
Dzmitry Malyshau
605620b20c Buffer creation in wgpu-remote 2019-11-28 17:18:25 -05:00
Dzmitry Malyshau
0880986a97 Stop dynamic offset iteration when the bind groups stop 2019-11-28 14:36:36 -05:00
Dzmitry Malyshau
1a2a37df7d Fix STORAGE_READ support 2019-11-25 14:30:03 -05:00
Dzmitry Malyshau
3908d2b5a1 Cleanup exports 2019-11-19 10:59:24 -05:00
Dzmitry Malyshau
98d28caffc Refactor internal texture tracking format 2019-11-18 22:07:15 -05:00
Dzmitry Malyshau
4e57c42c71 Initialize trackers with full selector - part 2 2019-11-18 09:20:16 -05:00
Dzmitry Malyshau
0569bc6956 Initialize trackers with full selector 2019-11-18 00:21:13 -05:00
Dzmitry Malyshau
6c632d1366 Separate native from the core 2019-11-16 00:36:23 -05:00