Commit Graph
388 Commits
Author SHA1 Message Date
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
Fichtelcoder 36877c3749 Fix resizing behaviour of hello-triangle example (#2543) 2022-03-21 01:21:51 +00:00
Dzmitry Malyshau 326af60df8 Expect shadow example to pass on Vulkan (#2541) 2022-03-19 05:58:14 +00:00
Igor Shaposhnik c5d5dbc7eb [naga] Update naga with new struct members separator 2022-03-16 20:42:21 -07:00
skierpage c314c55788 Correct program output ("Steps", not "Times") (#2535)
Since 985c1feb4 , hello-compute has output "Steps: ...", not "Times: ..."
2022-03-11 19:32:54 -05:00
Layl 3c85fe6782 Fix incorrect filtering used in mipmap generation (#2525) 2022-03-10 20:14:17 +00:00
Connor Fitzgerald b1b02fb239 Round up clear texture tests to block size 2022-02-28 21:38:52 -08:00
Connor Fitzgerald 36defcfdc2 Expand skybox outlier count due to llvmpipe 2022-02-28 21:38:52 -08:00
Connor Fitzgerald 3f30a8011f Prevent uncaught validation error on water example 2022-02-28 21:38:52 -08:00
Connor Fitzgerald 4d7f6eb07a Implement validation canary 2022-02-28 21:38:52 -08:00
Connor Fitzgerald 52badfb63c Mark expectant test failures on ANGLE 2022-02-28 21:38:52 -08:00
Connor Fitzgerald e9b13b74c4 Make tests properly request their own limits 2022-02-24 23:52:41 -05:00
Connor Fitzgerald 283a9fceeb tests/gles: properly label tests that don't run without some downlevel features 2022-02-24 23:52:41 -05:00
Connor Fitzgerald b87e50feae Rename get_downlevel_properties to get_downlevel_capabilities 2022-02-24 23:52:41 -05:00
Dmitry SharshakovandConnor Fitzgerald 70db03dc99 Use EGL surfaceless platform when windowing system is not found (#2339)
* Use EGL surfaceless platform when windowing system is not found

Falling back to egl::DEFAULT_DISPLAY usually results in X11 EGL platform being picked and then rejected because of unavailability on a head/GPU-less system. EGL_PLATFORM_SURFACELESS_MESA works with both radeonsi and llvmpipe/swrast when Xorg/Wayland sockets are being hidden from application. Needs to be tested in a truly GPU-less environment such as CI it is required to run in. Addresses #1551

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Set backend for capture by environment variables

Useful for testing surfaceless

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Check for EGL_MESA_platform_surfaceless extension before using surfaceless platform

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Format

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Unify types for GLES config tiers

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Remove red.png

Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>

* Enable GL backend for CI

* Bump outliers count for skybox_etc2 due to llvmpipe test (102)

* Add SURFACE_TYPE PBUFFER_BIT requirement to off-screen surface tier

* Re-nix GL Backend on CI

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2022-02-19 05:21:05 +00:00
Lucas Kent bfcdcd6486 Update dev deps (#2493) 2022-02-18 23:24:18 -05:00
Jinlei Li 1c17d15507 Metal backend ASTC HDR formats support (#2477) 2022-02-15 09:43:16 -05:00
currypseudo a604535972 fix: blit example use trianglelist and 3 vertices 2022-02-12 23:29:54 -05:00
Hiroaki Yutani c262e83d78 Add a ⭐ to the feature matrix of examples README (#2457)
* Add a ⭐ to the feature matrix of examples README

* Empty commit to try invoking the CI checks
2022-02-06 12:36:46 -05:00
Samuel Hurel 3e0305d27d Allow non struct buffers in wgsl (#2451)
* Bump naga

* Update examples
2022-02-05 09:53:04 -05:00
Jinlei Li b10f7ed407 Make shadow example runnable on iOS Android devices (#2433) 2022-02-01 18:08:35 -05:00
Jinlei Li 77b2c25684 Fix msaa-line example's unnecessary MSAA data store 2022-01-25 09:09:06 -05:00
João Capucho dcd07f0391 Update to upstream naga 2022-01-22 18:36:26 -05:00
Dzmitry Malyshau 36220b4da5 Update WGSL example shaders to use assignment ops 2022-01-11 11:45:33 -05:00
Dzmitry Malyshau 01f62baad2 Limits 1D texture mips to 1 2022-01-10 12:22:49 -05:00
Dzmitry Malyshau 043e36c59a Test WebGPU backend with extra features 2022-01-06 12:48:40 -05:00
Wumpf 2fa75aaf05 Do texture init via clear passes when possible (#2307)
* CLEAR_COMMANDS extension is now more of a window into wgpu zero-init
this has mostly implications on the constraints, but also allows a more leaky documentation which makes sense for this non-standard function as there is no other place to look it up

* clear_texture via renderpasses wip

* 3D depth textures are no longer allowed, volumes are always cleared via CPY_DST

* cleanup texture's clear_views

* rename CLEAR_COMMANDS to CLEAR_TEXTURE

* separate clear_texture into reusable & more descriptive parts

* texture clear views are now created ahead of time

* discarded surface fixup goes through new clear_texture method now

* onq ueue texture initialization now goes threw clear_texture
pending inits need to store Stored textures now though, causing more ref count bumping

* texture init on queue_write_texture now also goes through new clear_texture

* transfer functions on commandbuffer use now new texture init route

* merge collect_zero_buffer_copies_for_clear_texture into clear_texture_via_buffer_copies

* clear functions now take TextureInitRange

* Fix clippy lints

* command_encoder_clear_texture no longer takes write lock on texture

* TextureClearMode encodes now is_color

* code cleanup, mostly about `use`

* Handle volume textures in clear_texture_via_render_passes properly

* texture clear no longer requires id::Stored

* init tracking fixes for volumes and init on partial subresource writes

* texture creation enforces COPY_DST only if absolutely necessary

* unrolled functional chain, reduce unsafe scope size

* fix clippy lints

* clear_texture test no longer creates 1D textures

see #2323

* 3D textures are no longer cleared as render target since this isn't supported on Metal

* fix deno building issue, fix formatting

* TextureInner::Surface can now be zero initialized
2021-12-28 17:05:53 -05:00
Wumpf b0654e17af [example] fix conserative-raster low res target getting zero sized on resize (#2318)
* [example] fix conserative-faster low res target getting zero sized on resize

* [sample] conservative-raster: fix low res target aspect ratio being wrong
2021-12-26 12:02:21 -05:00
Dzmitry Malyshau ec1d022a75 Error scopes API (#2299) 2021-12-17 04:39:48 +00:00
Dzmitry Malyshau 3960658529 Remove block decorations (#2292) 2021-12-15 12:29:37 -05:00
Dzmitry Malyshau c1c855bb98 Allow strip index format None if no indexed drawing is done 2021-12-07 18:58:06 -05:00
Neil Blakey-Milner 4f639622d0 Add strip_index_format to linestrip in conservative-raster example (#2199) 2021-11-22 14:01:24 +00:00