Commit Graph

1179 Commits

Author SHA1 Message Date
James0124
a06ef71fd7
Add validation in accordance with WebGPU GPUSamplerDescriptor valid… (#3353)
* Add validation in accordance with WebGPU `GPUSamplerDescriptor` valid usage for `lodMinClamp` and `lodMaxClamp`.

`lodMinClamp` must not be negative, and `lodMaxClamp` must be >= `lodMinClamp`

* Add changelog entry.

* Run `cargo fmt`.
2023-01-06 13:16:16 +01:00
Jinlei Li
33e5b7af26
vulkan feature exclude macOS and iOS by default (#3292)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Closes https://github.com/gfx-rs/wgpu/issues/3287
2023-01-04 21:35:29 +00:00
Teodor Tanasoaia
784ee43be7
Make ObjectId structure and invariants idiomatic (#3347) 2023-01-04 15:13:59 -05:00
Nathan Adams
186a29c34d
Implement TextureFormat::Stencil8 + add stencil example (#3343)
* Implement TextureFormat::Stencil8

* Add stencil-triangles demo to test Stencil8 and show how to use stencil testing

* Added changelog for Stencil8
2023-01-02 13:47:10 +01:00
Connor Fitzgerald
9670e9e6b9 Make sure all doctests and tests in wgpu-types run 2022-12-21 17:24:46 -05:00
Andreas Reich
eaa87ba42c
Force all adapters to report min buffer alignment of 32 (#3262) 2022-12-21 13:46:15 -05:00
Connor Fitzgerald
9b9cc330ca
Fix up strict-assert usage (#3320)
* Removes unused assertions.rs

* Strict assert macro fixes

* Strict asserts shouldn't be default on wgpu
2022-12-20 22:04:45 -08:00
Connor Fitzgerald
5241633b3a
Implement Presentation Timestamp Correlation (#3240)
Co-authored-by: Jim Blandy <jimb@red-bean.com>
2022-12-20 17:52:08 +00:00
Teodor Tanasoaia
62e932b0a8
Add missing DEPTH_BIAS_CLAMP and FULL_DRAW_INDEX_UINT32 downlevel flags (#3316)
* add missing `DEPTH_BIAS_CLAMP` and `FULL_DRAW_INDEX_UINT32` downlevel flags

* add changelog entry

* use require_downlevel_flags
2022-12-20 18:21:54 +01:00
Teodor Tanasoaia
14886ee142
Sync depth/stencil copy restrictions with the spec (#3314)
* sync depth/stencil copy restrictions with the spec

* add changelog entry
2022-12-20 15:26:00 +01:00
i509VCB
052bd17d41
Context dynamic dispatch (#3051) 2022-12-19 19:17:19 -05:00
Jim Blandy
de070b2846
Fix documentation comments for Rust 1.66. (#3310)
Somewhere after 1.64 but by 1.66, `rustdoc` started checking for
unmatched HTML tags in doc strings, meaning that text like

    /// Convenience function turning Option<Selector> into this enum.

causes problems, since `rustdoc` will pass through `<Selector>` as
HTML tag, which browsers displaying the output will misunderstand.
2022-12-19 11:41:19 -08:00
Erich Gubler
3cc6621fd3
Resolve Rust 1.66 clippy lints (#3304) 2022-12-16 17:23:12 -05:00
Jim Blandy
0e4c7dd6d2
Remove workspace inheritance (#3295) 2022-12-15 15:46:28 -05:00
Imbris
645469d2f9
Small typo fix in TextureViewDescriptor docs (#3300) 2022-12-15 15:19:00 -05:00
Connor Fitzgerald
3ce5ca866b
Improve dynamic offset binding errors (#3294) 2022-12-15 00:53:42 +00:00
Jim Blandy
a50836e0cb
Make wgpu-core users responsible for choosing back ends. (#3254) 2022-12-07 20:58:45 -05:00
Jim Blandy
537f077132
Evaluate gfx_select's #[cfg] conditions at the right time. (#3253)
See the comments in the code for details.
2022-12-05 12:47:42 -08:00
Kevin Reid
2209463a54
Return an error instead of panicking when canvas context is unavailable (#3052)
* Low-level error handling in canvas context creation (for WebGPU and WebGL 2).

Part of fixing #3017. This commit changes the handling of `web_sys`
errors and nulls from `expect()` to returning `Err`, but it doesn't
actually affect the public API — that will be done in the next commit.

* Breaking: Change type of `create_surface()` functions to expose canvas errors.

Part of fixing #3017.
2022-11-30 23:41:29 -05:00
Nicolas Silva
e90aacea96
Validate texture copy ranges earlier to prevent integer overflow (#3090)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-12-01 01:20:48 +00:00
Nicolas Silva
a9d33193b3
Fix incorrect offset in get_mapped_range (#3233)
* Add a test.

* Fix incorrect offset in get_mapped_range.

* Add an entry in the changelog.
2022-11-30 16:45:49 -05:00
Connor Fitzgerald
84cb3e65a9 Unify Surface Capabilities APIs under one function call 2022-11-27 01:50:47 -05:00
Nicolas Silva
82e9dcf8f7
Allow unspecified bits when deserializing the API's bitflags (#3229) 2022-11-25 23:13:22 -05:00
Jim Blandy
d4b1d57f3c
Move ResourceMetadata into its own module, and give it a proper interface (#3213) 2022-11-23 17:29:20 -05:00
Jim Blandy
73b23f1c8d
Move minimum supported rust version (MSRV) from 1.65 back to 1.64. (#3231) 2022-11-23 21:22:03 +00:00
Jim Blandy
f41a1c294b
Remove unnecessary mutability from ResourceMetadata field uses. (#3210) 2022-11-15 21:52:12 +00:00
Erich Gubler
18f3f5f6f0
Enable unsafe_ops_in_unsafe_fn lint in all workspaces (#3044) 2022-11-14 10:49:39 -08:00
i509VCB
0e937c8cd0
make Ids a u64 internally (#3178) 2022-11-09 15:48:07 -05:00
Ali
3c82a4cd5c
Added support for MSAA(x2,x8) beyond WEBGPU restrictions for native a… (#3140)
Closes https://github.com/gfx-rs/wgpu/issues/2910
2022-11-09 15:19:05 -05:00
Erich Gubler
319a916cb6 refactor: fix label shadow warning for new_alpha_mode 2022-11-07 17:36:04 -08:00
Erich Gubler
fb67de908e refactor: resolve clippy::explicit_auto_deref 2022-11-07 17:36:04 -08:00
Andreas Reich
b838b0871c
Added new UNRESTRICTED_INDEX_BUFFER downlevel flag. (#3157)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-11-07 15:45:50 -05:00
Nicolas Silva
db30e3909a
Avoid integer overflow on multiplication in write_texture. (#3146) 2022-11-07 15:31:19 -05:00
i509VCB
32febc5c9e export the strict assert macros uniformly 2022-11-01 04:59:24 -04:00
i509VCB
085e41171f use debug_assert_** with not(feature = "strict_asserts")
strict_asserts should at least validate with the debug_assert_** family of macros in debug builds. Otherwise undefined behavior can sneak by.
2022-11-01 04:59:24 -04:00
Harald Reingruber
51b34c5b51
Improve compute shader validation error message (#3139)
* Improve compute shader validation error message

* Add entry to changelog.

* Improve error message wording (by cwfitzgerald)

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

* Add credit and PR link to changelog

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-10-29 17:49:03 -04:00
Jinlei Li
dcc0baa1ff
Fix texture_as_hal internal unwrap may cause panic (#3131) 2022-10-26 17:13:43 -04:00
i509VCB
d81cb46be0
enable doc_auto_cfg for docs.rs (#3113)
* enable doc_auto_cfg for docs.rs

This should expose more feature labels in the generated documentation and removes the needs for the manually labeling the features for a type, function or enum variants.

* enable docsrs cfg when building docs for master
2022-10-26 17:07:25 -04:00
Jinlei Li
cc448817e7
Use cargo 1.64 workspace inheritance feature (#3107) 2022-10-20 01:41:17 -04:00
Xiaopeng Li
754a4bad80
Add Surface::as_hal_mut (#3123) 2022-10-19 16:06:23 -04:00
Jim Blandy
b28a87e298
Global init remove dummy argument (#3101) 2022-10-13 17:41:58 -04:00
Nicolas Silva
d1ff3838b8
Expose the full Result type to the rust map_async callback (#2939) 2022-10-13 15:41:52 -04:00
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