Commit Graph
1055 Commits
Author SHA1 Message Date
Jim Blandy 2cd08a1c9c Placate Clippy 0.1.63. (#2977) 2022-08-24 17:25:59 -04:00
Jinlei Li f918ac1ed1 vk: fix astc_hdr formats support (#2971)
* vk: fix `astc_hdr` formats support

* Update CHANGELOG
2022-08-20 19:18:39 +00:00
Jinlei Li a08ea2a255 metal: add the missing msg_send![view, retain] call within from_view (#2976)
* metal: add the missing `msg_send![view, retain]` call within `from_view`

* Update CHANGELOG
2022-08-20 07:14:57 -07:00
Wyatt Herkamp f7526ae960 winit 0.27 Update and raw-window-handle 0.5 (#2918) 2022-08-04 06:09:37 +00:00
i509VCB 8444fbe460 vulkan: fix issues querying multiview support (#2934) 2022-08-01 20:55:53 -04:00
ReeceandABuffSeagull 4cbf8cfcf1 Fix opening of renderdoc lib (#2930)
* Fix opening renderdoc lib

Renderdoc needs to not be opened by us, but instead open the existing copy.
Unfortunately this requires OS specific flags for opening, plus `libloading`
doesn't have full API coverage currently.

* Added changelog entry for #2930

* Hide RTLD_NOLOAD behind a cfg for unix

Co-authored-by: ABuffSeagull <reecevanatta@hey.com>
2022-08-01 01:39:55 +00:00
Kevin Reid b784eee5af Silence clippy::let_unit_value false positives on objc::msg_send calls. (#2924) 2022-07-31 17:55:37 -04:00
Valentin 271bb8690e Fix documentation claiming shader entry points must return void (#2911) 2022-07-26 03:40:32 +00:00
i509VCB 75519839be export AdapterContext in Gles hal (#2870) 2022-07-25 23:37:50 -04:00
Jinlei Li ecf3f5ec38 metal | vulkan-portability: extract the generic code into get_metal_layer (#2826) 2022-07-10 23:06:32 -04:00
i509VCB a108efe6b6 expose context and display from adapter and device for egl hal (#2860) 2022-07-10 18:50:54 -04:00
i509VCB 0dfb1115d2 document Adapter::new_external in wgpu-hal (#2863) 2022-07-10 18:49:53 -04:00
i509VCB 94c065cb33 allow access to queue family index in vulkan hal device (#2859) 2022-07-07 19:43:13 -04:00
Connor Fitzgerald 259991e258 Refactor GLES's texture_format_capabilities 2022-07-06 11:06:34 -04:00
Connor Fitzgerald 499e9e628e Properly query SRV and UAV format features for depth formats 2022-07-06 11:06:34 -04:00
Connor Fitzgerald bb273a908f DX12/VK allow texture_format_capabilities to be called on any texture format 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
Jinlei LiandConnor Fitzgerald b574354af4 gl: fix depth stencil texture format capability (#2854)
* gl: fix depth stencil texture format capabilitys

* Update CHANGELOG

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-07-06 03:37:26 +00:00
Connor Fitzgerald 87552a92cc Fix GL_EXT_color_buffer_float detection on desktop 2022-07-03 01:08:40 -04: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
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
Nicolas Silva 892c272d18 Replace android-properties with android_system_properties. (#2815)
The former use statically linked Android libc symbols while the latter loads them dynamically. This is required to support old and new versions of Android with the same binary. It unblocks updating wgpu in Gecko.

Fixes #2805.
2022-06-27 16:56:11 -04:00
Connor Fitzgerald 84633a8b12 Force binding sizes to be multiples of 16 on webgl (#2808) 2022-06-27 02:39:51 +00:00
tuchs 1af3b9096c Fix gles buffer-texture copy for 2d arrays (#2809) 2022-06-26 00:21:38 +00:00
Connor Fitzgerald de5fe90f20 Restrict WriteTimestamp Inside Passes (#2802)
* Define feature flags in terms of the previous

* Add WRITE_TIMESTAMP_INSIDE_PASSES feature
2022-06-25 01:23:13 -04: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
Jinlei Li f4c01052ef Rename MAX_COLOR_TARGETS to MAX_COLOR_ATTACHMENTS to match spec 2022-06-16 20:36:15 -07:00
Nicolas Silva 191537021e Expose naga span location helpers (#2752)
* Expose the source location in CreateShaderModuleError.

* Bump naga dep to 89bed99.
2022-06-14 23:10:22 -04:00
Ashley a880eb9642 [WebGL] Add a downlevel capability for rendering to floating point textures (#2729)
* Add a downlevel capability for rendering to floating point textures

* Rename capabilities to _capabilities

* Run cargo fmt

* Pass downlevel_flags to the adapter

* Add wgt::DownlevelFlags::COLOR_ATTACHMENT_FLOAT to dx11

* Remove downlevel_flags from the adapter and use is_ext_color_buffer_float_supported instead

* Add DownlevelFlags::WEBGPU_TEXTURE_FORMAT_SUPPORT

* Apply suggestions
2022-06-14 00:43:56 -04:00
i509VCB e0327b1db7 expose vulkan physical device capabilities, enabled device extensions (#2688) 2022-06-10 15:32:52 -04:00
Jinlei Li 5e070783bc vk: fix PIPELINE_STATISTICS_QUERY feature support (#2750) 2022-06-08 01:08:16 -04: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
Josh Groves be625f9a01 gles: allow clearing index buffers on WebGL (#2740) 2022-06-07 02:08:51 -04:00
Jinlei Li 31c6b39c20 metal: check if in the main thread when calling create_surface (#2736) 2022-06-07 02:07:38 -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
Ashley 717bc40106 Add Features::MULTI_DRAW_INDIRECT to Metal (#2737) 2022-06-06 08:00:34 -04:00
Ashley a3b241857d [gles] Handle cubemap copies (#2725) 2022-06-05 17:23:31 -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
Robert Bragg 444836f747 Acquire texture: Option<std::time::Duration> timeouts (#2724)
* surface.acquire_texture: pass Option<Duration> for timeout

A std::time::Duration allows for timeouts to be specified more clearly in
Rust using whatever units are convenient for the caller, and an Option also
makes it clearer in case no timeout is wanted, as opposed to passing a
bitwise !0 as special timeout value.

Notably there was an impedance mismatch with the Vulkan backend that
takes a 64bit timeout in nanoseconds and uses u64::MAX to indicate no
timeout and the backend was not mapping a given u32::MAX into a u64::MAX

* surface.acquire_texture: ignore timeout for Android < 11

Prior to Android 11 then Android's vkAcquireNextImageKHR implementation was
non-conformant and didn't support timeouts and additionally would log a
verbose warning if a timeout was requested.

For reference this version of AcquireNextImageKHR doesn't support timeouts:
https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-mainline-10.0.0_r13/vulkan/libvulkan/swapchain.cpp#1426
and this version does:
https://android.googlesource.com/platform/frameworks/native/+/refs/tags/android-mainline-11.0.0_r45/vulkan/libvulkan/swapchain.cpp#1438
(i.e. timeout support was added in Android 11)

This patch adds a dependency on the `android-properties` crate that provides
a simple wrapper for the `__system_property_set` syscall so that the
platform version can be read via the `ro.build.version.sdk` property
and then for versions < 30 (corresponds to Android 11) any timeout
given to `acquire_texture` will be ignored (and `u64::MAX` will be
passed to Vulkan)
2022-06-04 16:05:40 +00:00
Xiaopeng Li 46420212d7 Add raw_adapter method for dx12 hal adapter (#2714) 2022-06-04 01:20:13 -04:00
Jinlei Li 8063edc648 Add DEPTH24UNORM_STENCIL8 feature (#2689) 2022-05-30 15:29:12 -04:00
i509VCB 2c9c5bbbe5 expose egl display in gles (#2670) 2022-05-29 03:05:57 -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
i509VCB 435188cb89 expose some underlying types in Vulkan hal 2022-05-22 08:49:04 -07:00
Jinlei Li eb260ba7a6 metal: fix Depth24Plus | Depth24PlusStencil8 capabilities (#2686) 2022-05-22 08:31:15 -07:00
Ashley 1ec26784c4 [Gles] Fix clearing depth and stencil at the same time (#2675) 2022-05-19 17:10:27 -04:00
Jinlei Li 26f96c7dfe Add DEPTH32FLOAT_STENCIL8 featue (#2664) 2022-05-17 02:11:05 -04:00
Jinlei Li 8e5ac75d45 metal: fix Rgb9e5Ufloat capabilities and sampler_lod_average support (#2656) 2022-05-14 01:06:06 +00:00
Jinlei Li ddf1903b03 Add SHADER_FLOAT16 feature (#2646)
* Add SHADER_FLOAT16 feature

* vk: check SHADER_FLOAT16 feature
2022-05-12 22:14:19 -07:00