Commit Graph
419 Commits
Author SHA1 Message Date
Nicolas Silva a3e3d2503f Update naga to 1be8024. (#3405) 2023-01-19 15:25:25 +00:00
Elabajaba 81569dd6c3 Updated Dxc integration for DX12 backend (#3356)
Co-authored-by: unknown <alimilhim5@gmail.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Closes https://github.com/gfx-rs/wgpu/issues/2722
closes https://github.com/gfx-rs/wgpu/pull/3147
2023-01-18 21:25:56 +00:00
Jinlei Li 0849e78600 Add view_formats in TextureDescriptor (#3237)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Closes https://github.com/gfx-rs/wgpu/issues/3030
2023-01-18 16:03:56 -05:00
Teodor Tanasoaia fae740df5c Fix being able to sample a depth texture with a filtering sampler (#3394) 2023-01-18 15:53:50 -05:00
Nicolas Silva 5a2e60c50e Update naga to e98bd92 (#3352) 2023-01-10 14:04:18 -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 6b6bc69ba0 Check for webgl2 validation errors and catch issues (#3296) 2022-12-20 15:51:17 -05:00
Erich Gubler 3cc6621fd3 Resolve Rust 1.66 clippy lints (#3304) 2022-12-16 17:23:12 -05:00
David Huculak f14bee6740 Add blit shader comment (#3301) 2022-12-16 01:34:32 -05: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
Connor Fitzgerald 7960c5e154 Disable multithreaded gl compute on llvmpipe (#3251) 2022-12-01 04:28:09 +00:00
Jim Blandy 9c6a60d97c Fix surface creation cfgs in example framework. (#3246) 2022-11-30 16:46:24 -05:00
Connor Fitzgerald 183ba3f231 Make Surface::get_default_config return an Option. 2022-11-27 01:50:47 -05:00
Connor Fitzgerald 84cb3e65a9 Unify Surface Capabilities APIs under one function call 2022-11-27 01:50:47 -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 fb67de908e refactor: resolve clippy::explicit_auto_deref 2022-11-07 17:36:04 -08:00
Connor Fitzgerald ce081796c8 Rework CI (#3097) 2022-10-14 22:55:36 -04:00
Benjamin Loison 435ce062a9 Correct a typo (#3108) 2022-10-15 01:00:49 +00:00
Jinlei Li caee97e402 Add get_default_configure to simplify user creation of SurfaceConfiguration (#3034) 2022-10-13 06:15:46 +00:00
Lukas HerzbergerandConnor Fitzgerald 3cd93983b2 Create instance from worker (#2858)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-10-08 05:49:20 +00:00
Olaroll f57db150f2 Fixed missing device feature in mipmap example (#3081) 2022-10-08 05:42:57 +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
Jim Blandy 2cd08a1c9c Placate Clippy 0.1.63. (#2977) 2022-08-24 17:25:59 -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
Jinlei Li 61796b1d59 Relax render pass color_attachments validation (#2778)
* Make the color attachments `Option`-al in render pipelines, render passes, and render bundles

* vk:  `Option`-al color attachments support

* dx12: sparse color_attachments support

* Only non-hole attachments is supported on wasm target and gl backend

* deno_webgpu: `Option`-al color attachments support

* Follow all suggestions
2022-06-27 16:10:18 -07:00
Jim Blandy 36ae2ceda3 Pass ShaderModuleDescriptor to create_shader_module by value.
This will allow us to pass module representations that are neither
`Copy` nor `Clone`, like `naga::Module`.
2022-06-26 23:34:16 -07: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
Connor Fitzgerald 7df4fd1cd4 Use FIFO swapchain in examples 2022-06-20 23:15:28 -07: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
Jim Blandy fd22c7f269 Increase max_outliers on wgpu water example reftest. (#2767)
The example says:

    Using AMD RADV POLARIS12 (Vulkan)

The test says:

    thread 'water' panicked at 'Image data mismatch! Outlier count 464 over limit 460. Max difference 213', wgpu/examples/water/../../tests/common/image.rs:134:13

I checked the `water-difference.png` file, and it's just a few dots
here and there. The example seems to run fine.
2022-06-14 00:45:23 -04:00
StevenandConnor Fitzgerald df1472d4a3 Fix bunnymark test screenshot and replace rand with nanorand (#2746)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-06-10 21:44:27 +00:00
kwillemsenandKoen Willemsen ed9cdb7946 Fixed builtin(primitive_index) for vulkan backend (#2716)
Co-authored-by: Koen Willemsen <koen.willemsen@materialise.be>
2022-06-07 20:24:46 +00: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 FitzgeraldandJim Blandy 5bd0a6c4ac Implement submission indexes (#2700)
* Implement submission indexes

* Write some unit tests for poll

* Update wgpu/src/lib.rs

Co-authored-by: Jim Blandy <jimb@red-bean.com>

* Unify Maintain in both wgc and wgpu

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2022-06-05 17:22:25 -04:00
Connor Fitzgerald 32af4f5607 Convert map_async from being async to being callback based (#2698) 2022-05-31 11:22:21 -04:00
Connor Fitzgerald c12ae0880f Check that all vertex outputs are consumed by the fragment shader (#2704) 2022-05-29 23:38:11 +00:00
Jim Blandy 84efe2b18b Actually use RenderBundleEncoder::set_bind_group in tests. 2022-05-21 01:51:34 -07:00
Jim Blandy a5e7275b9c Document random bits and pieces. 2022-05-11 20:17:32 -07:00
Connor Fitzgerald e54a36ee78 Move texture-array example over to wgsl (#2618) 2022-04-25 18:32:53 +00:00
Jinlei Li 5706263917 Rename dispatch -> dispatch_workgroups 2022-04-20 23:24:21 -07:00
Jim Blandy 06ee8a6862 Permit non-struct, non-array types as buffers.
Fixes #2583.
2022-04-18 09:50:51 -07:00
Jim Blandy 579f809573 Avoid new WGSL reserved words in wgpu examples. 2022-04-17 21:33:55 -07:00
Igor Shaposhnik eff50436f5 Update to Naga rev 1720725 2022-04-15 22:22:48 +03:00
Jim Blandy a47b5c554f Update to Naga rev 7aaac25f. 2022-04-13 14:41:26 -07:00
Jim Blandy 4cba5ffbed wgpu/examples/shadow: Don't run on llvmpipe. (#2595) 2022-04-13 21:37:39 +00:00
Alphyr 58f318550d Fix clippy lints (#2560) 2022-03-28 09:00:09 -04:00
David A Roberts 46eea16335 Generate 1x1 mip level (#2551)
Just a minor off-by-one error that meant the final 1x1 mip level wasn't being generated. I don't think it makes any substantial difference to the rendered result.
2022-03-23 21:19:41 -04:00
Alphyr b0da1a2c1d Switch from cgmath to glam in examples (#2544) 2022-03-21 10:32:59 -04:00