Commit Graph
2137 Commits
Author SHA1 Message Date
Jim Blandy 215884184b Reformat comments in wgpu-core. (#3102) 2022-10-13 18:34:44 +00:00
Jim Blandy fa4d8401e8 Use std::fmt::Formatter::debug_struct for RenderPass. (#3100) 2022-10-13 14:00:54 -04:00
Nicolas Silva eca04f59db Make some errors not fatal (#3094) 2022-10-11 13:40:30 -04:00
daxpedda 02cc2ae234 [BREAKING] Make Shader(Module)Source::Wgsl optional (#2890) 2022-10-08 01:12:50 -04:00
Nicolas Silva 0a3e209c90 Shrink the default max binding index to 640 and expose it in Limits.
Following the corresponding changes happening in WebGPU.
2022-10-06 10:12:16 -07:00
Jim Blandy c781971792 When a command encoder is dropped, destroy its hal command buffer. (#3069)
Fixes #2965.
2022-10-06 01:06:55 -07:00
Connor Fitzgerald 872b436104 Update version to 0.14 2022-10-05 18:45:25 -04:00
Connor Fitzgerald 91e0dbd1ae Update naga + deps 2022-10-05 18:45:25 -04:00
Mikko Lehtonen 60fd2a32e9 Implement missing PrettyError impls (#3066) 2022-10-05 18:43:52 -04:00
i509VCB 2372895944 Handle unsupported surfaces more gracefully (#3054) 2022-10-05 16:42:06 -04:00
SpecificProtagonist b65ebb4b30 remove copyless (#3050) 2022-09-26 05:15:35 +00: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
Mauro GentileandMauro Gentile cdf6ee0c87 Updating TextureFormat matching specs (#2954)
Co-authored-by: Mauro Gentile <Mauro.Gentile@ubisoft.com>
2022-09-20 12:08:06 -04:00
daxpedda 95408cd48b [BREAKING] Wrap ShaderSource::Naga in Cow<'static> (#2903) 2022-09-19 00:50:46 -04:00
ImbrisandConnor Fitzgerald 41006d7a88 Buffer usages mismatch check and documentation for mapped_at_creation size requirement. (#3023)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-09-19 04:41:29 +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
Alphyr d1c94d09e2 Update dependencies (#3021) 2022-09-18 23:53: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
Jim Blandy bec26b79ec Don't use a callback to return backend instance handles. (#2991)
Change `Instance::as_hal<A>` to simply return an
`Option<&A::Instance>`, rather than passing it to a callback. We're
just borrowing a reference to some `wgpu_hal::Api::Instance` owned by
the `wgpu_core::instance::Instance`, so there's no special scoping or
locking magic required here.
2022-09-02 17:32:58 -07:00
Jim Blandy 701564da8c Use () instead of PhantomData as IdentityManager's Input type. (#2972)
* Use () instead of PhantomData as IdentityManager's Input type.

PhantomData suggests that there's some sort of persuasion required
for lifetime variance inference or other sorts of arcana, but it
doesn't seem to be necessary at all. `()` works just fine.
2022-09-02 15:37:21 -07:00
Jim Blandy 58bc205f2a Update to Naga b209d911 (2022-9-1).
This removes an expected failure on AMD RADV. I guess #2751 was our
bug all along.
2022-09-02 11:33:55 -07:00
Jim Blandy 7d138e2e76 Avoid overflow in check texture copy bounds. (#2963) 2022-08-28 20:07:04 -04:00
Jim Blandy a0dfb28b8d Document wgpu_core id handling, factories, etc. (#2973) 2022-08-28 19:49:09 -04:00
Jim Blandy 2cd08a1c9c Placate Clippy 0.1.63. (#2977) 2022-08-24 17:25:59 -04:00
Jim Blandy c6ca2a7d0d Always free staging buffers (#2961)
* Have `prepare_staging_buffer` take a raw hal Device.

This helps the borrow checker understand that we can borrow
`pending_writes`'s encoder and the raw Device at the same time.

* Always free staging buffers.

We must ensure that the staging buffer is not leaked when an error
occurs, so allocate it as late as possible, and free it explicitly when
those fallible operations we can't move it past go awry.

Fixes #2959.

* Some tests for texture and buffer copies.

* Add CHANGELOG.md entry.
2022-08-13 18:25:49 -07:00
Jim Blandy 33d313cba9 Document some wgpu-core resource tracking types (#2960) 2022-08-13 20:35:57 -04:00
Nicolas SilvaandConnor Fitzgerald 6e99cd3a3e Fix calculation/validation of layer/mip ranges in create_texture_view (#2955)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-08-14 00:01:19 +00:00
Nicolas Silva 96a85b3ac5 Add missing validation in copy_texture_to-Buffer. (#2958) 2022-08-13 19:48:17 -04:00
Jim Blandy d655017439 Implement "strict_asserts" feature in wgpu-core. (#2872)
Since `wgpu-core`'s public functions are supposed to validate their
parameters, the internal `track` module skips many of Rust's usual
run-time checks in release builds. However, some `wgpu-core` users are
happy to pay the performance cost in exchange for more safety. The
`"strict_asserts"` feature causes `wgpu_core` to perform the same
checks in release builds as it does in debug builds.
2022-08-08 00:45:39 -04:00
Wyatt Herkamp f7526ae960 winit 0.27 Update and raw-window-handle 0.5 (#2918) 2022-08-04 06:09:37 +00:00
Nicolas Silva ef3b31cd9a Map bounds check (#2938)
* Validate that map_async's range is not negative.

map_async already checks that the range's end is within the bounds of the buffer, so this also ensures the range start is within bounds.

* Add an entry in the changelog.
2022-08-03 20:28:36 -07:00
Nicolas Silva e59c33046b Validate against the maximum binding index (#2892)
* Validate binding indices in create_bind_group_layout.

* Add an entry in the changelog
2022-08-01 16:25:32 -04:00
SeamoooandConnor Fitzgerald 0dce58dfbd changed websys features in core and hal to align with used features (#2922)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-08-01 19:06:26 +00:00
Nicolas SilvaandConnor Fitzgerald a05c8dc2dc Fix buffer zeroing with offset in map_buffer (#2916)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-07-31 22:05:18 +00:00
Valentin 271bb8690e Fix documentation claiming shader entry points must return void (#2911) 2022-07-26 03:40:32 +00:00
Nicolas Silva d0aa3f471a Validate the number of color attachments in create_render_pipeline (#2913) 2022-07-25 23:28:52 -04:00
Connor Fitzgerald 537c6bed4e Add warning when using CompareFunction::*Equal without an invariant Attribute (#2887) 2022-07-21 02:24:49 -04:00
Seamus Mulholland-Patterson 6d4677fd7f added downlevel restriction error message for InvalidFormatUsages error 2022-07-15 14:11:04 -04:00
Nicolas Silva 6058676dd2 Record that the buffer is mapped when its size is zero. (#2877)
* Record that the buffer is mapped when its size is zero.

* Avoid internally trying to map a zero-sized buffer if mapped_at_creation is true.

* Add an entry in the changelog.
2022-07-13 18:01:12 +00:00
Nicolas Silva af345cd6c3 Validate the range in map_async. (#2876)
* Validate the range in map_async.

* Add an entry in the changelog.
2022-07-13 12:34:36 -04:00
i509VCB db24c066cb fix panic with as_hal functions (#2871) 2022-07-12 14:38:59 -04:00
Sébastien Marleau 2ce1318c8c fix deduplication not taking into account render bundles (#2867) 2022-07-10 22:15:52 +00:00
Nicolas Silva 324de1bef6 Ensure the BufferMapCallback is always called. (#2848)
* Ensure the BufferMapAsyncCallback is always called.

This solves two issues on the Gecko side:
 - The callback cleans up after itself (the user data is deleted at the end of the callback), so dropping the callback without calling it is a memory leak. I can't think of a better way to implement this on the C++ side since there can be any number of callback at any time living for an unspecified amount of time.
 - This makes it easier to implement the error reporting of the WebGPU spec.

* Update the changelog.
2022-07-07 23:29:05 -07:00
Connor Fitzgerald 59f4efe93a Prevent get_texture_format_features from saying textures always support COPY_* 2022-07-06 11:06:34 -04:00
Connor Fitzgerald 7e369fdd57 Fix texture multi-sample-ability check with TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES 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 Fitzgerald 7d85efb301 Fix out of bounds access when surface texture is written to by multiple command buffers 2022-07-03 01:08:40 -04:00
Connor Fitzgerald eea8edb8a0 Fix AutoNoVsync on OpenGL 2022-07-03 01:08:40 -04:00
Spencer C. Imbleau (he/him) 72a4ef9362 Fixes #2840 (#2842) 2022-07-03 02:00:25 +00:00
Connor Fitzgerald 1ceef24261 Add changelog for 0.13 (#2823)
* Changelog

* Update CHANGELOG.md

* Bump versions to 0.13
2022-06-30 20:25:49 +00:00