Commit Graph
188 Commits
Author SHA1 Message Date
Jim Blandy 215884184b Reformat comments in wgpu-core. (#3102) 2022-10-13 18:34:44 +00:00
i509VCB 2372895944 Handle unsupported surfaces more gracefully (#3054) 2022-10-05 16:42:06 -04:00
2c1d7a8a5c Split Blendability and Filterability into Two Different TextureFormatFeatureFlags (#3012)
* Split Blendability and Filterability into Two Different TextureFormatFeatureFlags

* Update CHANGELOG.md

* Split out individual booleans to improve readability

* Make sure blendablity is correctly set for guaranteed format features of WebGPU

* Cargo fmt

Co-authored-by: Xander Warnez <xander.warnez@materialise.be>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-09-21 19:39:01 +00:00
Jinlei Li 44399bb4a3 Expose alpha_mode, support non-opaque mode on metal and vk backends (#2836) 2022-09-19 00:10:21 -04:00
i509VCB 9e3efd7019 pass around RawDisplayHandle and RawWindowHandle in implementation (#3022)
This change is to help with an attempt to allow the Context type in wgpu to be swappable at runtime. In order to do that, the functions provided by Context and it's associated types need to be object safe. Instead of passing a impl trait that combines both HasRawWindowHandle and HasRawDisplayHandle, we seperate the types into their RawDisplayHandle and RawWindowHandle parts internally to reduce some of the hal implementation code mess.
2022-09-15 16:29:20 -07:00
Wyatt Herkamp f7526ae960 winit 0.27 Update and raw-window-handle 0.5 (#2918) 2022-08-04 06:09:37 +00:00
Connor Fitzgerald 59f4efe93a Prevent get_texture_format_features from saying textures always support COPY_* 2022-07-06 11:06:34 -04:00
Craig 1da5bbd7b4 Prevent OpenGL from taking preference over Vulkan (#2853)
* Prevent OpenGL from taking preference over Vulkan

* update changelog

* fix wasm build of example
2022-07-06 00:11:22 -04:00
Connor Fitzgeraldandbjorn3 ea05b44f38 Improve Presentation Api (#2803)
* Add new presentation modes

* Expand presentation formats

* Add Surface::get_supported_modes

* Update to rust 2021 and improve some metal surface code

* Update wgpu-types/src/lib.rs

Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>

* Fix windows build errors

* Fix issues with ALLOW_TEARING

Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2022-06-30 14:24:17 -04:00
Connor Fitzgerald 464b61d01c Flip span labels to work better with tools (#2820) 2022-06-28 19:49:51 +00:00
victorvde 7375acb230 get_supported_formats: sort like the old get_preferred_format and simplify return type (#2786)
* get_supported_formats: sort srgb first like the old get_preferred_format

* get_supported_formats: simplify return type
2022-06-22 21:04:18 +00:00
Nicolas Silva 5dcd19c167 Add a vulkan workaround for large buffers. (#2796)
* Add Limit::max_buffer_size.

* Prevent very large buffer with some drivers.

Some drivers run into issues when buffer sizes and ranges are larger than what fits signed 32 bit integer. Adapt the maximum buffer size accordingly.
2022-06-22 12:31:53 -04:00
StevenandConnor Fitzgerald 0d4d3f4ceb Change get_preferred_format to get_supported_formats (#2783)
* Change all the functions

* Return the set of supported TextureFormat specified by WebGPU

* Remove redundant filtering and use list directly

* Replace pops with first

* Remove now unused function

* Fix doc and clarify preffered format

* Dereference enums

* Remove unused list

* Remove fancy coode

* Update wgpu-core/src/device/mod.rs

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-06-18 00:21:02 -04:00
Harald ReingruberandZicklag 25b16d5cc8 OffscreenCanvas Support for WebGL Backend (#2603)
* First attempt of exposing create_surface_from_canvas for webgl

* Test Fix Compile For WebGL Offscreen Canvas

* Only specify web-sys feature version in wgpu-core, so that patch version is taken from workspace

* Reuse already existing fn create_surface_from_canvas

* Remove unnecessary unsafe

* Remove unsafe prefix also from top-level create_surface_from_canvas

* Add create_surface_from_offscreen_canvas() for webgl

* Cargo fmt

* Store webgl2_context instead of canvas, which works also for OffscreenCanvas

* Copy skybox example for OffscreenCanvas example

* Use offscreen_canvas instead in newly created example

* Update skypbox_offscreen readme.md

* Allow enabling OffscreenCanvas in examples via http://localhost:8000/?offscreen_canvas=true

* Fix cargo fmt

* [fix warning] Only import FromStr for wasm32

* [fix warning] Exclude offscreen_canvas_setup from non-wasm32

* [fix warning] Add ImageBitmap feature as well so that all related methods can be used

* Fix cargo fmt

* Fix emscripten build

* Remove `webgl` feature from wgpu-core as webgl is the only wasm32 backend

Co-authored-by: Zicklag <zicklag@katharostech.com>
2022-06-07 01:57:16 -04:00
Connor Fitzgerald 9114283707 Tracking Optimization and Rewrite (#2662)
* Texture state full is dead code

* temp

* temp2 - next is lifetime only

* temp3 - all trackers in place

* temp4 - continue muddling along

* temp5 - doodle doodle

* temp6 - continuous progress is continuous

* temp7 - pro-gress

* temp8 - Add refcounts to trackers

* temp9 - Soundness, generics, refcounts, and epochs

* temp10 - Compiling?!1?!1?!1

* temp11 - Add bind group state optimization

* temp12 - Safety and adding size setting

* temp13 - unsafe

* temp14 - Abstract all the state transitions

* temp15 - It verks! kinda...

* temp16 - it more verks!

* temp17 - debugging and unit tests

* temp18 - fixing unfixed things

* temp19 - hmmm

* temp20 - curious about line deltas

* temp21 - working texture trackers

* temp22 - write merge/update/barrier for buffers

* temp23 - cleanup and buffers

* temp24 - clippy cleanup

* temp25 - Add inline markers on buffer functions

* temp26 - Fix buffer trackers

* temp27 - fixed texture insert to handle both sides

* temp28 - document tracker and usages

* temp29 - document track/mod.rs

* temp30 - convert STORAGE_WRITE to STORAGE_READ_WRITE

* temp31 - Add some debug asserts to make sure we can't insert invalid states

* temp32 - clippy is opinionated sometimes

* temp33 - renaming and documentation

* temp34 - logging
2022-05-24 11:36:13 -04:00
Poly bfcf5fa513 Make GLES DeviceType unknown by default 2022-05-11 20:32:43 -07:00
Connor Fitzgerald 73f42352f3 Dx11 Backend (#2443) 2022-03-12 17:14:18 +00:00
Connor Fitzgerald 80da80b497 Move limit comparison logic into wgpu-types for easy reuse 2022-02-24 23:52:41 -05:00
Connor Fitzgerald b87e50feae Rename get_downlevel_properties to get_downlevel_capabilities 2022-02-24 23:52:41 -05:00
Jinlei Li 01628a1fad vulkan: HDR ASTC formats support 2022-02-20 00:00:06 -05:00
Jinlei Li fa35c0a0f4 Re-allow vk backend on Apple platforms via vulkan-portability feature 2022-02-18 20:26:53 -05:00
Xiaopeng Li 8c351970ce Support to create surface from visual on Windows (#2434)
* Support to create surface from visual on Windows, add mpo(Multiple Plane Overlay) feature to AdapterInfo

* Expose create_surface_from_visual method

* Fix code style

* Make code more concise

* Revert mpo from AdapterInfo
2022-02-07 14:57:57 -05:00
Dzmitry Malyshau dbec075cdc Texture format MSAA capabilities 2022-01-11 09:32:25 -05:00
Connor Fitzgerald 276de0e2d6 Fix trac(y/ing) compile issue 2021-12-30 10:46:07 -05:00
Dzmitry Malyshau a8caa367ee Add limits for compute storage and max invocations 2021-12-08 21:43:41 -05:00
Dzmitry Malyshau e867a7434c Let GLES/Angle path compile on macOS 2021-12-05 17:09:36 -05:00
Dzmitry Malyshau ab28009d80 Angle support on Windows
Also remove the macros module in favor of generic functions.
2021-12-05 17:09:36 -05:00
Dzmitry Malyshau 693bc58bdd Validate device descriptor before opening (#2159) 2021-11-06 17:09:52 -04:00
Dzmitry Malyshau 04b8ff2c9e Silence downlevel caps warning on secondary backends 2021-10-15 15:02:49 -04:00
Connor Fitzgerald c3d906856f Add spans to provide more information profile gaps 2021-10-03 22:54:15 -04:00
Dzmitry Malyshau 1ee6036f44 Implement software adapter selection 2021-10-01 17:22:51 -04:00
Connor Fitzgerald b679342d9e Support descriptor arrays shorter than binding length 2021-09-30 14:11:51 -04:00
Connor Fitzgerald 7766ed194b Improve CI testing code 2021-09-14 13:34:07 -04:00
Luke Street 76bcd9c494 Implement min_{uniform,storage}_buffer_offset_alignment limits (#1923)
* Implement min_{uniform,storage}_buffer_offset_alignment limits

* Add Limits::using_alignment

* Update docs & examples

* Create binding_model::buffer_binding_type_alignment fn
2021-09-08 13:53:02 -04:00
Riccardo Zaglia 0a2be6099c Add Texture::as_hal() 2021-08-31 10:30:23 -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
Lonsdaleiter 64ffdd52ad Added is_surface_supported (#1763) 2021-08-04 14:27:08 +00: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
Dzmitry Malyshau 552a5f138e Rename texture usage names 2021-07-28 00:17:54 -04:00
Riccardo Zaglia 2657849977 [Vulkan] Initialize wgpu objects from raw handles 2021-07-25 21:51:40 +02: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 c01f6a557e hal/dx12: enable the backend in wgpu-core 2021-07-13 01:01:19 -04:00
Connor Fitzgerald 130ddcf561 Unify CI and testing 2021-07-04 15:22:51 -04:00
bors[bot]andDzmitry Malyshau 7ab950e465 Merge #1592
1592: Detailed limits check and error r=cwfitzgerald a=kvark

**Connections**
Related to #1590

**Description**
The old comparison "A < B" was simply wrong, because it would do every field in order and could bail out mid-way without reaching for all limits.

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-03 01:12:43 +00:00
Dzmitry Malyshau 23b587246a Detailed limits check and error 2021-07-02 20:17:12 -04:00
Clayton Walker 25c452cbdd Add metal layer back in 2021-07-02 15:51:11 -06:00
Connor Fitzgerald 53e2c95dc8 Fix wgpu-info display by moving masks to associated functions 2021-07-02 01:15:19 -04:00
Dzmitry Malyshau ba006cfaa7 Rename ColorWrite, TextureUsage, and BufferUsage 2021-06-30 14:57:38 -04:00