Commit Graph

78 Commits

Author SHA1 Message Date
Connor Fitzgerald
308e72b521 Fix typo in BufferUsage docs 2020-07-22 20:55:08 -04:00
Dzmitry Malyshau
21be559a9f Add depth clamping support 2020-07-22 11:03:36 -04:00
Marvin Löbel
4ed2c0a313 Replace borrowed slices in Descriptor structs with copy on write slices (#822)
* Replace &[T] in descriptor structs with Cow<[T]>

* Changed label fields to use Cow<'a, str>

* Deduplicate types across the tracing API

Introduce the ToStatic trait

* Deduplicate trace::RenderBundleDescriptor

* Remove ugly ToOwned bounds

* Simplifiy Action variants

* Make Clone bounds on type defs less verbose

* Fix a error in play.rs

* Remove ToStatic, and Make Action<'a> borrow descriptors instead
2020-07-20 12:31:05 -04:00
Rukai
3fe9d8872f swap_chain_present returns SwapChainStatus 2020-07-20 21:13:22 +10:00
bootra-dev
215c9fe750 refactor to group by size 2020-07-16 14:00:06 -04:00
bootra-dev
ee0e4850fd add size function for VertexFormat 2020-07-16 13:55:34 -04:00
Kunal Mohan
62100584e8 Derive Hash on BindGroupLayoutEntry 2020-07-16 19:47:35 +05:30
bors[bot]
fc4baa3107 Merge #795
795: Move `RenderPass*AttachmentDescriptor` types into core r=kvark a=GabrielMajeri

**Connections**
Follow up to #791.

**Description**
I had the impression that these two types were already shared between `wgpu-core` and `wgpu-rs`, considering they were generic. Further investigation reveals that not to be the case.

This PR moves these types into `wgpu-core`, since they're specific to this crate.

**Testing**
Checked with core, player and `wgpu-rs`.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-14 12:52:27 +00:00
Gabriel Majeri
39ed7a008c Move RenderPass*AttachmentDescriptor types into core 2020-07-14 08:11:20 +03:00
Connor Fitzgerald
c8bcc50ed6 Implement PUSH_CONSTANTS feature 2020-07-13 12:47:09 -04:00
Gabriel Majeri
f3b80f1d8d Unify wgpu-core and wgpu-rs types 2020-07-13 18:39:49 +03:00
Gabriel Majeri
9cd3d47ce7 Remove non-exhaustive markers 2020-07-12 19:56:04 +03:00
Dzmitry Malyshau
e693170aef Rename bindings to entries 2020-07-08 23:41:09 -04:00
Connor Fitzgerald
238e6b74ee Populate limits struct 2020-07-07 16:12:03 -04:00
bors[bot]
cfd21d4913 Merge #763
763: Remove raw pointers from the render pipelines API r=kvark a=GabrielMajeri

**Connections**
Rust-ification of API, as part of #689

**Description**
The objective is to get rid of raw pointers in the render pipeline descriptor and associated structures.

**Testing**
Checked with `player` and the `trace` feature, and with `wgpu-rs` with the changes in https://github.com/gfx-rs/wgpu-rs/pull/425

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-07 17:29:37 +00:00
Gabriel Majeri
d4eeea8118 Remove pointers from pipelines API 2020-07-07 19:37:04 +03:00
Dzmitry Malyshau
46230720b5 Remove UnsafeFeatures as we decided the top level guard is not useful 2020-07-06 23:46:46 -04:00
Connor Fitzgerald
441b6e0d04 Implement MultiDrawIndirect Extensions 2020-06-27 23:43:23 -04:00
Connor Fitzgerald
ac62a11619 Convert Extensions + Capabilities into Features 2020-06-26 00:18:46 -04:00
Rukai
8137934739 Allow intra doc link resolution failures, because they actually succeed when they need to but rust doesnt know 2020-06-24 22:20:22 +10:00
Kunal Mohan
73b079f226 Derive Serialize and Deserialize for HostMap 2020-06-22 13:08:17 +05:30
bors[bot]
93a34b538d Merge #741
741: Fix the default lod_max_clamp value for the SamplerDescriptor r=kvark a=hasenbanck

**Connections**
As suggested in https://github.com/gfx-rs/wgpu-rs/pull/397

**Description**
The current default value for the ```lod_max_clamp``` of a sampler is 0.
This would deactivate mipmapping alltogether. Setting the default to ```f32::MAX``` makes sure to always enable it. It's the default value apple uses in Metal, it seems to be valid usage in Vulkan (```maxLod``` in ```VkSamplerCreateInfo```) and in DX12 (```MaxLOD``` in ```D3D12_SAMPLER_DESC```).

Co-authored-by: Nils Hasenbanck <nils@hasenbanck.de>
2020-06-21 00:49:09 +00:00
Nils Hasenbanck
1f5a55ea13 Fix the default lod_max_clamp value for the SamplerDescriptor
The current default value for the lod_max_clamp of a sampler is 0.
This would deactivate mipmapping alltogether. Setting it to
f32::MAX makes sure to always enable it. It's the default value apple
uses in Metal, it seems to be valid usage in Vulkan (maxLod in
VkSamplerCreateInfo) and in DX12 (MaxLOD in D3D12_SAMPLER_DESC).
2020-06-20 18:03:51 +02: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
bors[bot]
b4410c5d8a Merge #732
732: Dummy workspace crate r=cwfitzgerald a=kvark

Basically, it makes sure that doing `cargo check` locally in the workspace is all you need.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-06-18 19:11:53 +00:00
Dzmitry Malyshau
0cd1ec2981 Dummy workspace crate 2020-06-18 14:16:04 -04:00
Connor Fitzgerald
15d0db8828 wgpu-types documentation pass 2020-06-17 20:38:44 -04:00
Dzmitry Malyshau
a27341bd6d Basic support for minBufferBindingSize 2020-06-16 00:34:58 -04:00
Connor Fitzgerald
5a7fb4c1e5 Implement Capability/Extension Split 2020-06-14 02:32:54 -04:00
Dzmitry Malyshau
c038c206e7 Add RODS texture binding property 2020-06-12 21:26:19 -04:00
bors[bot]
373a1c2bf0 Merge #715
715: Implement SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING r=kvark a=cwfitzgerald

## Connections

Closes #483. Extends support for #106.

## Description

This forwards the descriptor indexing features gfx-hal up to wgpu. 

Note this PR also changes the name of the `TEXTURE_BINDING_ARRAY` to `SAMPLED_TEXTURE_BINDING_ARRAY` to be more consistent with extensions.

## Testing

Texture-array example was simply extended to use descriptor indexing. This works on all platforms that the feature is supported. (thanks @stararawn)



Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-06-12 23:53:37 +00:00
Connor Fitzgerald
bfcc369bc7 Implement SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING 2020-06-12 19:52:10 -04: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
Dzmitry Malyshau
afc4517db1 Render bundle reset states, updated descriptors 2020-06-11 15:28:55 -04:00
Dzmitry Malyshau
fbf35e43a6 Render bundles 2020-06-11 15:28:55 -04:00
Connor Fitzgerald
57b3b72571 Implement TEXTURE_BINDING_ARRAY extension 2020-06-10 22:35:25 -04:00
Connor Fitzgerald
4258c60f46 Implement mappable primary buffers extension 2020-06-08 22:33:47 -04:00
Connor Fitzgerald
27ffe5026b Implement buffer to any copy bounds checking 2020-06-08 11:24:33 -04:00
Dzmitry Malyshau
16424bfac1 Add shader validation bool to DeviceDescriptor 2020-06-06 23:34:04 -04:00
Connor Fitzgerald
f32cb103b8 Implement extensions interface as described in #691 2020-06-06 02:00:41 -04:00
Connor Fitzgerald
ade7ce10b2 Rustification of Extensions and SamplerDescriptor 2020-06-02 21:04:25 -04:00
Dzmitry Malyshau
cc418e747d Implement Default for BufferSize and PowerPreference 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
7181bfe977 Move BufferSize to wgpu-types 2020-05-30 01:19:42 -04: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
dff37bb65d Move TextureDataLayout to wgpu-types 2020-05-26 00:15:09 -04:00