Commit Graph
1225 Commits
Author SHA1 Message Date
Jim Blandy aba7197fe8 Update Naga to 0b60f410 (Thu 2022-6-16). (#2779) 2022-06-17 16:51:22 -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
Daisuke Kato 16c796578c Add symlink LICENSE files into crates. (#2604) 2022-05-29 03:07:42 -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 8b2e6fe3a2 Roll naga to 571302e (50 revisions) (#2672) 2022-05-18 21:09:22 -07:00
Jinlei Li 26f96c7dfe Add DEPTH32FLOAT_STENCIL8 featue (#2664) 2022-05-17 02:11:05 -04:00
Jim Blandy c608ee0bbe Accept both parking-lot 0.11 and 0.12.*, to avoid windows-rs. (#2660)
In parking_lot 0.12 and parking_lot_core 0.9.0, those crates switched
from the winapi crate to the official Microsoft windows-sys crate.
This is fine, except that windows-sys and its dependencies are even
larger than winapi. Some users may wish to stick with winapi for the
time being; this change allows wgpu to accommodate them.
2022-05-16 01:16:53 -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
Poly 8e62ca0538 Add new integrated GPU to the list: AMD Renoir
Renoir is codename for AMD series of mainstream mobile and desktop APUs based on the Zen 2 CPU and Vega GPU microarchitectures succeeding Picasso.
2022-05-11 20:32:43 -07:00
Poly bfcf5fa513 Make GLES DeviceType unknown by default 2022-05-11 20:32:43 -07:00
Jim Blandy 85b4815f83 Rename timeout_us to timeout_ns, to match actual units. (#2645) 2022-05-06 21:32:30 -04:00
Jim Blandy ee3d23d546 Raise wgpu_hal::MAX_COLOR_TARGETS to 8. (#2640) 2022-05-03 04:07:15 -04:00
Emilio Cobos Álvarez a613a568b6 Update parking_lot. (#2639) 2022-05-03 04:28:17 +00:00
Ashley ebca3298f0 Remove gles compressed texture log::error! (#2630) 2022-04-25 17:38:57 -04:00
Connor Fitzgerald e54a36ee78 Move texture-array example over to wgsl (#2618) 2022-04-25 18:32:53 +00:00
Connor Fitzgerald bc850d2a0e Bind group deduplication (#2623) 2022-04-25 04:19:25 +00:00
Dragoș Tiselice 59d640a107 metal: Don't skip incomplete binding resources. (#2622) 2022-04-21 19:49:33 +00:00
Ashley ff07716f79 Do a downlevel check for anisotrophy and enable it in the webgl backend (#2616)
* Do a downlevel check for anisotrophy and enable it in the webgl backend

* Run cargo fmt

* Change to sample_parameter_i32
2022-04-20 20:56:16 -04:00
Jinlei Li 0b61a19124 metal: fix some supported limits 2022-04-18 20:40:03 -07:00
Jim Blandy 6d7c092dad Update Naga to 85056524 (2022-4-18). 2022-04-18 20:27:42 -07:00
Jim Blandy 3d10678a91 Update to Naga 0e2bb019. 2022-04-18 09:09:47 -07:00
Jim Blandy 579f809573 Avoid new WGSL reserved words in wgpu examples. 2022-04-17 21:33:55 -07:00
Kevin Reid cb7ad30d58 Prefix every wgpu-generated label with (wgpu internal).
This is intended to help developers new to wgpu or to graphics debugging
quickly recognize in a debugging tool which items are wgpu-generated, as
opposed to either part of their program or part of the platform graphics
system.

I also removed existing marker-like text such as leading underscores and
angle brackets.
2022-04-15 22:39:08 -07:00
xiaopengli89 abdf1cd741 Add raw_queue for d3d12 device 2022-04-15 21:50:32 -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 988990c24d Fix doc links. (#2579) 2022-04-05 18:56:25 +00:00
Jim Blandy 75e82afd35 wgpu-hal: Work around cbindgen bug: ignore gles::egl module. (#2576) 2022-04-03 19:32:10 -04:00
Alphyr d45e6b4119 Update ash to 0.37 (#2557) 2022-03-27 22:15:58 -07:00
Igor Shaposhnik c5d5dbc7eb [naga] Update naga with new struct members separator 2022-03-16 20:42:21 -07:00
Jinlei Li ba07db90c8 metal: improve push | pop_debug_marker 2022-03-14 22:21:46 -07:00