Commit Graph
91 Commits
Author SHA1 Message Date
Dzmitry Malyshau b95a66da5e Move AdapterInfo into wgt 2020-12-18 16:43:19 -05:00
Vincent Jousse ab64aa5b92 Fix bad copy/paste in #907 2020-12-18 21:37:17 +01:00
Dzmitry Malyshau f07cc8156b Update naga and gfx, move the shader validation into a shader descriptor bit 2020-12-17 11:33:47 -05:00
Connor Fitzgerald 8f430ab1ef Implement ETC2 and ASTC textures 2020-12-05 19:30:26 -05:00
Dzmitry Malyshau c6bc37dbde [error] render bundles 2020-11-23 12:00:47 -05:00
Dzmitry Malyshau ad824de268 [error] bind groups and layouts creation 2020-11-23 11:57:32 -05:00
Mikko Lehtonen 4498f172cc Retain labels for resources
As a braking api change, adds also label for the error id generation,
for labeling invalid ids too.

Also adds query methods the label.
2020-11-19 00:09:21 +02:00
Dzmitry Malyshau ac89fbab8a Drop surfaces and adapters 2020-11-13 18:39:14 -05:00
Dzmitry Malyshauandmonocodus[bot] 73d3f71caa Enable the non-fill polygon mode feature if requested (#1016)
* Enable the non-fill polygon mode feature if requested

* Update wgpu-core/src/instance.rs

Co-authored-by: monocodus[bot] <49363530+monocodus[bot]@users.noreply.github.com>

Co-authored-by: monocodus[bot] <49363530+monocodus[bot]@users.noreply.github.com>
2020-11-06 00:32:04 -05:00
Zicklag f7f1ff699a Implement OpenGL Backend For Unix Platforms 2020-11-04 20:32:33 -06:00
Zicklag 165d7717b4 Add Error Message When Surface Creation Fails 2020-11-02 20:24:30 -06:00
frbimo fdd561e69e remove PowerPreference::Default
Signed-off-by: frbimo <fr.bimo@gmail.com>
2020-10-12 19:17:44 +08:00
Dzmitry Malyshau 45ade807cc Only request features that are needed 2020-10-05 14:51:32 -04:00
Dzmitry Malyshau 0a67d6a7be Enable RBA feature where available 2020-10-05 10:21:39 -04:00
Adam Nemecek db1870e7fc use self 2020-09-25 19:11:46 -07:00
Connor Fitzgerald a9750f83bc Remove erroneous extra feature check 2020-09-23 18:13:54 -04:00
Manuel Woelker 336d070b26 add polygon_mode: PolyonMode to RasterizationStateDescriptor to allow drawing wireframes 2020-09-09 21:34:37 +02:00
Zicklag 7572dbeaf9 Use CFG Aliases to Replace the backends! Macro
Uses the `cfg_aliases` crate to replace the `backends!` macro and
provide a more natural way to gate backend specific code.
2020-08-29 21:55:17 -05:00
Justin Shrake 19eeee27ee Add AddressMode::ClampToBorder behind a feature 2020-08-22 13:23:50 -07:00
John Mitchell 4cb50e8395 Added image cube array. 2020-08-16 23:10:06 -04:00
Dzmitry Malyshau 44fdfb80d0 Fix support for d24unorm format 2020-08-13 17:26:44 -04:00
Gabriel Majeri 021251a908 Remove power module 2020-08-05 16:27:41 +03:00
Dzmitry Malyshau dbd7e2c579 Separate valid internal IDs from external ones 2020-08-04 11:16:59 -04:00
Connor Fitzgerald e5c647745e Implement TEXTURE_COMPRESSION_BC extension 2020-07-29 18:43:50 -04:00
Gabriel Majeri e860dd995f Handle command pool creation error 2020-07-29 09:56:42 +03:00
Connor Fitzgerald cb485f3798 Convert all logging to tracing and add fmt logger 2020-07-25 19:33:21 -04:00
Dzmitry Malyshau 21be559a9f Add depth clamping support 2020-07-22 11:03:36 -04:00
Gabriel Majeri 1b563c8e3d Safe error handling in instance module (#817)
* Safe error handling in instance module

* Revert alignment checks back to assertions
2020-07-18 18:11:04 -04:00
Connor Fitzgerald c8bcc50ed6 Implement PUSH_CONSTANTS feature 2020-07-13 12:47:09 -04:00
bors[bot]andGabriel Majeri d7ee89018b Merge #791
791: Unify `wgpu-core` and `wgpu-rs` types r=kvark a=GabrielMajeri

**Connections**
Closes #689.

**Description**
Moves a lot of types from `wgpu-rs` which were duplicated in `wgpu-core` to `wgpu-types`.

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

Corresponding `wgpu-rs` PR: https://github.com/gfx-rs/wgpu-rs/pull/437

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2020-07-13 15:45:09 +00:00
Gabriel Majeri f3b80f1d8d Unify wgpu-core and wgpu-rs types 2020-07-13 18:39:49 +03:00
bors[bot]andDavid Peicho 08c873969c Merge #790
790: core: make DeviceType repr(u8) r=kvark a=DavidPeicho

**Connections**

This PR will make gfx-rs/wgpu-native#43 mergeable.

**Description**

`DeviceType` wasn't made to be used in FFI. The enum is now set to `#[repr(u8)]`.

**Testing**

It's not tested 💯 


Co-authored-by: David Peicho <david.peicho@gmail.com>
2020-07-13 13:55:35 +00:00
David Peicho 257151b9a4 core: make DeviceType repr(u8) 2020-07-13 10:45:47 +01:00
Gabriel Majeri 9cd3d47ce7 Remove non-exhaustive markers 2020-07-12 19:56:04 +03:00
Connor Fitzgerald 238e6b74ee Populate limits struct 2020-07-07 16:12:03 -04:00
Dzmitry Malyshau 46230720b5 Remove UnsafeFeatures as we decided the top level guard is not useful 2020-07-06 23:46:46 -04:00
Oskar Nehlin 8a51f4bc7f Return result instead of panicking when requesting device. (#762)
* Return Result instead of panic for recoverable errors

* Update LimitsExceeded error variant

* Update LimitsExceeded error message
2020-07-06 16:45:11 -04:00
Oskar Nehlin 5b4b695ad3 Check parent adaptor limits instead of physical device limits (#761)
* Check parent adaptor limits instead of physical device limits

* Fix pr comment
2020-07-06 14:14:09 -04:00
bors[bot]andConnor Fitzgerald 43c67ac59c Merge #754
754: Implement MultiDrawIndirect Extensions r=kvark a=cwfitzgerald

**Connections**

Closes #742.

**Description**

These extensions, especially when combined with binding indexing, allow the creation of extremely cpu-efficient gpu powered pipelines.

Adds two extensions allowing various types of multi-draw-indirect
- MULTI_DRAW_INDIRECT (giving `multi_draw_indirect` and `multi_draw_indexed_indirect`)
- MULTI_DRAW_INDIRECT_COUNT (giving `multi_draw_indirect_count` and `multi_draw_indexed_indirect_count`)

This adds what I believe to be an extra restriction on the `*count` family of functions when compared to the underlying api. The buffer _must_ be large enough to draw `max_count` draws, even if that many draws are never drawn. This makes these operations no more unsafe than indirect would be, which is currently safe.

I did not implement these for renderbundles, but there's no reason they couldn't work, so those branches are marked with `unimplemented` as opposed to `unreachable`.

Additional Changes:
- Added some validation to the normal `draw_*_indirect` functions to prevent buffer overruns.
- The DX12 gfx-hal backend requires the strides to _always_ be non-zero, so I modified the normal indirect draws to use explicit strides.
- Made device limits and features `pub(crate)` as they need to be checked in random places in the code.

**Testing**

The change was tested using a modified version of wgpu-rs's texture-array example using a variety of permutations. I have not been able to test regular MULTI_DRAW_INDIRECT on mac, but I see no reason why that wouldn't work.

https://github.com/gfx-rs/wgpu-rs/pull/414

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-06-28 04:47:13 +00:00
Connor Fitzgerald 441b6e0d04 Implement MultiDrawIndirect Extensions 2020-06-27 23:43:23 -04:00
Andreas Reich cd87f1e80f added independent blending to the list of required features 2020-06-27 22:33:47 +02:00
Connor Fitzgerald ac62a11619 Convert Extensions + Capabilities into Features 2020-06-26 00:18:46 -04:00
Marvin Löbel 962f65ac27 Add backends! and backends_map! macros
to reduce code duplication in instance.rs
2020-06-23 00:41:01 +02:00
Connor Fitzgerald 62a870280f Refine Logging Levels 2020-06-22 02:13:04 -04:00
Connor Fitzgerald c1f0021a05 Add Chrome Backend 2020-06-20 20:55:59 -04:00
Connor Fitzgerald 1b2cf3cd22 Add Tracing and Instrument Entry Points 2020-06-20 14:26:50 -04:00
Marvin Löbel e88e3517d6 Move backend selection to Instance::new()
Keep `inputs` parameter in `pick_adapter()`
2020-06-18 22:04:16 +02:00
Connor Fitzgerald 15d0db8828 wgpu-types documentation pass 2020-06-17 20:38:44 -04:00
Connor Fitzgerald 5a7fb4c1e5 Implement Capability/Extension Split 2020-06-14 02:32:54 -04:00
Connor Fitzgerald bfcc369bc7 Implement SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING 2020-06-12 19:52:10 -04:00