Commit Graph

206 Commits

Author SHA1 Message Date
Connor Fitzgerald
bb00d594f8
Fix Issue with Caching on Windows CI (#4284) 2023-10-23 04:31:22 +00:00
Connor Fitzgerald
3cc6a563ca
Re-add missing example tests (#4277) 2023-10-22 05:18:37 +00:00
Connor Fitzgerald
04ac5f2851
Update WARP and Install Mesa on Windows CI (#4270) 2023-10-22 00:34:00 -04:00
Connor Fitzgerald
543f921639
GPU Test Framework (#3873) 2023-10-19 12:06:42 -04:00
Nicolas Silva
f95d1c55e3
Expose Instance flags (#4230)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-11 17:39:04 +00:00
JustAnotherCodemonkey
f738551250
Add Extended Examples (#3885)
* Add the base of the example. May need refining and definitely fact-checking.

* Start change to changelog.

* Complete changelog change for repeated-compute.

* Apply suggestion to fix typos.

Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>

* Add storage-texture example which currently works native but needs to be changed to work for wasm. [no ci]

* repeated-compute now works on the web. [no ci]

* `storage-texture` now works on the web as well as native.

* Format because I forgot to do that (ugh).

* Add `storage-texture` to changelog.

* Add `render-to-texture` example.

* Not all the files got git added. Fixed it.

* Add `render-to-texture` to changelog.

* Make better readme's and add examples to said readme's.

* Oops. Put the example updates in the wrong place.

* Add `uniform-values` example.

* Apply clippy suggestions.

* Improved readme's and documentation.

* Fmt. Turning into the Joker rn.

* Make instructions for examples on the web more clear. \(Fmt and clippy happy\)

* hello-workgroups It doesn't work.

* Add basic comments and readme to hello-workgroups.

* Add hello-synchronization example. Currently doesn't have any tests but those should be added later.

* Forgot to check wasm compatibility for hello-synchronization. Fixed it.

* Add test for hello-synchronization.

* Make my examples downlevel defaults.

* Make uniform-values downlevel defaults. (Forgot to do that last commit.)

* Fix clippy doc complaints.

* Didn't fully fix the docs last commit. Got it here I think.

* Fix redundant bullet point in examples/hello-workgroups/README.md.

* Trim down the introduction section of examples/hello-workgroups/README.md.

* Add technical links section to examples/hello-workgroups/README.md.

* Use idiomatic Rust comments, break up big text wall into paragraphs, and fix some spelling errors.

* Move output image functions into examples/common and give output_image_wasm some upgrades.

* Modify changelog for moving output_image_native and output_image_wasm into wgpu-example.

* Fix output_image_wasm. (Formerly did not handle pre-existing output image targets.)

* Make a multiline comment be made of single lines to be more ideomatic.

* "Fix" more multiline comments. I think this is actually the last of them.

* Make the window a consistant, square size that's convenient for viewing.

* Make the window on uniform-values not endlessly poll, taking up 100% of the main thread in background at idle. Also, change layout a little and make native use nanos by default for logging.

* Make execute in hello-synchronization return a struct of vecs instead of using out parameters.

* Didn't realize the naming of wgpu_example::framework so I moved my common example utility functions into wgpu_example::utils.

* Add add_web_nothing_to_see_msg function to replace all the instances of adding "open the console" messages across the examples.

* Add small documentation to add_web_nothing_to_see_msg and change it to use h1 instead of p.

* Add documentation to output_image_native and output_image_wasm in examples/common.

* Do better logging for output image functions in wgpu-example::utils.

* Remove redundant append_child'ing of the output image element in wgpu-example::utils::output_image_wasm.

* Fix error regarding log message for having written the image in wgpu-example::utils::output_image_native.

* Fmt.

* In examples/README.md, re-arrange the examples in the graph to be in alphabetical order.

* Fix changlog item regarding wgpu-example::utils and the output image functions.

* Move all the added examples into one changelog item that lists all of them.

* Updated table in examples/README.md with new examples. Added new features to the table to accurately represent the examples.\n\nFor the new features, not all old examples may be fully represented.

* Fix inaccurate comment in hello-workgroups/src/shader.wgsl.

* Update examples/README.md to include basic descriptions of the basic examples as well as hints on how examples build off of each other.

* Remove `capture` example. See changelog entry for reasoning.

* Fix typo in hello-workgroups/shader.wgsl

* Change the method of vertex generation in the shader code of render-to-texture to make it more clear.

* Modify/correct message in repeated-compute/main.rs regarding the output staging buffer.

* Update message in uniform-values/main.rs about writing the app state struct to the input WGSL buffer.

* Add notice in repeated-compute/main.rs about why async channels are necessary (portability to WASM).

* Revise comment in uniform-values/main.rs about why we don't cast the struct using POD to be more clear.

* Change uniform-values to use encase for translating AppState to WGSL bytes.

* Cargo & Clippy: My two best friends.

* Add MIT-0 to the list of allowed liscences.

* Fix docs for wasm.

---------

Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
2023-10-08 02:05:51 -04:00
Connor Fitzgerald
93d2e5b4ba
Split MSRV in Two Parts (#4204)
* Split MSRV in two parts

* Use toml

* Fix CI

* Update names and cache hits for various jobs

* Comment
2023-10-03 21:03:32 -04:00
Jinlei Li
6df7e2d7e5
Revert "Ignore the exception values generated by the winit resize event" (#4195) 2023-10-02 14:42:06 +02:00
Andreas Reich
507101987b
Make StoreOp an enum instead of a bool (#4147)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-09-18 14:58:41 -04:00
Andreas Reich
0ffdae31a1
Metal encoder & pass timestamp support (#4008)
Implements timer queries via write_timestamp on Metal for encoders (whenever timer queries are available) and passes (for Intel/AMD GPUs, where we should advertise TIMESTAMP_QUERY_INSIDE_PASSES now).

Due to some bugs in Metal this was a lot harder than expected. I believe the solution is close to optimal with the current restrictions in place. For details see code comments.
2023-09-16 20:01:46 +00:00
Jim Blandy
54a7f0eac9
Skip test_multithreaded_compute on MoltenVK. (#4096)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-09-04 03:54:39 +00:00
Pieter-Jan Briers
e973a06268
Allow specifying minor GLES3 version (#3998) 2023-08-16 11:51:56 -04:00
Jinlei Li
cda3f21652
Fix capture example panic in the browser (#4043) 2023-08-13 16:06:22 +02:00
Christopher Fleetwood
3305e88d63
feature: Timestamp queries (#3636)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connor@modyfi.io>
2023-08-02 18:04:24 -04:00
Valaphee The Meerkat
494ae1a815
Add support for occlusion queries (#3402)
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-08-02 19:05:59 +00:00
Erich Gubler
8a8e00a5a5 refactor(wasm): remove unnecessary JsCast import 2023-07-25 17:05:28 -04:00
Erich Gubler
2492956014 refactor: satisfy clippy::manual_slice_size_calculation 2023-07-25 17:05:28 -04:00
Connor Fitzgerald
311065100b
Vulkan portability in CI (#3964) 2023-07-23 07:35:57 +00:00
Connor Fitzgerald
f1381233fb
Update dependencies (#3952) 2023-07-19 21:29:10 -04:00
Connor Fitzgerald
bd159ed57b
Fix mipmap example with queries (#3951) 2023-07-20 00:28:18 +00:00
Connor Fitzgerald
2602553355
Skip multithreaded compute test (#3945) 2023-07-19 18:01:04 -04:00
Jinlei Li
d089b9488b
Ignore the exception values generated by the winit resize event (#3916) 2023-07-19 17:07:48 -04:00
Fredrik Fornwall
1c43272d2a
Remove backend_bits from initialize_adapter_from_env (#3904)
Remove backend_bits from initialize_adapter_from_env, backends can
be specified using the backends field in InstanceDescriptor instead.
2023-07-05 18:21:39 +02:00
Connor Fitzgerald
db39b5423e
Formatting and example command fixes (#3872) 2023-06-15 20:05:26 +00:00
Connor Fitzgerald
10172e1f38
Move Examples and Tests to Their Own Crates (#3841)
Co-authored-by: Connor Fitzgerald <connor@modyfi.io>
2023-06-10 18:35:46 +00:00
Dzmitry Malyshau
dbb261b7f1 Remove wgpu-native and wgpu-remote 2020-04-16 22:35:59 -04:00
Dzmitry Malyshau
f3eee020e6 Check surface compatibility 2020-03-30 23:31:24 -04:00
Aaron Loucks
fdcf9e7067 Add inital debug labels
- bind group
- bind group layout
- command encoder
- texture
2020-03-24 19:43:11 -04:00
Dzmitry Malyshau
7f966be455 Update naming of bindings to entries 2020-03-16 10:06:54 -04:00
Dzmitry Malyshau
26657374f8 Update vertex layout naming 2020-03-14 12:44:04 -04:00
Dzmitry Malyshau
095f320470 Wholesome spec update.
Biggest change is that buffer binding is done one by one. There is a number of renamings of the fields, also the binding types are expanded.
2020-03-13 23:59:05 -04:00
Aaron Loucks
fe95fddf5a Use vulkan nomenclature for PresentMode variants
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPresentModeKHR.html
2020-03-06 00:48:45 -05:00
Aaron Loucks
5ca57374f6 Check power/battery status when selecting adaptors
PowerPreference::Default will now prefer discrete GPUs
when on AC power and will prefer integrated GPUs while
on battery power (i.e. the battery is discharging).
2020-01-12 17:26:54 -05:00
Park Joon-Kyu
e91cfa4dc3 Enable wayland support for examples/triangle 2020-01-02 17:10:45 +09:00
Dzmitry Malyshau
3908d2b5a1 Cleanup exports 2019-11-19 10:59:24 -05:00
Dzmitry Malyshau
6c632d1366 Separate native from the core 2019-11-16 00:36:23 -05:00
Dzmitry Malyshau
b9aed69bed More licenses for Gecko 2019-11-15 11:51:46 -05:00
Joshua Groves
2b1ce5d6d9 Use callback for request_adapter 2019-11-07 09:55:27 -06:00
Anton Lazarev
027a61a48d
return Result instead of panic 2019-11-01 11:11:43 -07:00
Dzmitry Malyshau
4635f1eb07 Extended remote example 2019-10-29 13:31:40 -04:00
bors[bot]
b71fc33c72
Merge #359
359: Make examples work again r=kvark a=GabrielMajeri

This PR fixes the C example code to not crash and actually run.

I've also added a few assertions to ensure a warning is emitted next time somebody forgots to increase `max_bind_groups` to something non-zero on device creation.

To help with debugging the examples, I've configured CMake to include debug info in the builds. Some new Makefile targets for the examples have been added to automate running them.

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
2019-10-26 21:08:16 +00:00
Gabriel Majeri
eb198a9c3e Fix C examples
Get the examples running again.

The compute example has been simplified to use only one buffer.

A new check has been added to ensure the `max_bind_groups`
device limit is properly set.
2019-10-26 22:13:53 +03:00
Dzmitry Malyshau
538c23b039 Implement shutdown for the remote server 2019-10-25 22:56:52 -04:00
Dzmitry Malyshau
175e992149 DX12/DX11 hookup, improved adapter selection 2019-08-29 09:44:34 -04:00
Dzmitry Malyshau
e84ae4a4b2 Feature-less backend selection
This PR removes optional backend features in favor of run-time
selection at the `request_adapter` entry point. Adapters from all
supported gpu backends on the platform are reported.

It also makes gfx-rs dependency to be public (for now).
2019-08-27 20:55:49 -04:00
Dzmitry Malyshau
1d36203c9a Raw window handle support instead of winit 2019-08-20 23:41:14 -04:00
yanchith
3abaed36c3 Rename buffer to encoder in wgpu_command_buffer_copy_* functions
This also regenerates `wgpu.h` and updates uses of
`wgpu_command_buffer_copy_buffer_to_buffer` in `compute/main.c`
2019-08-20 21:43:49 +02:00
Dzmitry Malyshau
f82ceba3c2 Minor renames to address the review comments 2019-08-16 22:36:30 -04:00
Dzmitry Malyshau
37afa0d98a Update API according to the upstream spec
Includes changes in texture view creation, enumeration mapping,
binding types, and more.
2019-08-15 23:24:35 -04:00
Dzmitry Malyshau
d37452ff27 Force pipeline barriers between unordered usages 2019-08-14 10:35:40 -04:00
Rukai
e61b16f7ed Update to gfx hal 0.3 2019-08-11 09:39:52 +10:00
Fabio Krapohl
6fee18f6f9 remove end pass return value and fix examples 2019-08-10 22:30:24 +02:00
Timo de Kort
842809bc0b add framework files 2019-07-27 14:30:20 +02:00
Timo de Kort
d759da409f add compute example 2019-07-27 14:26:06 +02:00
Noah Hüsser
c5c7092d9c Make PresentMode configurable
Disable vsync

Revert accidential hardcode of num_frames

Make the PresentMode configurable

Adapt examples
+ adjust style according to @kvrak

Adher to @kvarks wishes for style.

Examples build.

Fix unnecessary ampersand.
2019-07-11 18:58:44 +02:00
bors[bot]
b1d9de0406 Merge #169
169: Add Windows/glfw3 to CI r=kvark a=grovesNL



Co-authored-by: Joshua Groves <josh@joshgroves.com>
2019-06-05 01:55:24 +00:00
Joshua Groves
7e7a88b831 Add Windows/glfw3 to CI 2019-06-04 22:09:58 -02:30
bors[bot]
85740873d0 Merge #212
212: More consistent descriptor passing r=kvark a=porky11

also use pointer for descriptor in `wgpu_command_encoder_begin_render_pass` for consistency reasons

Co-authored-by: Fabio Krapohl <fabio.u.krapohl@fau.de>
2019-06-04 20:20:10 +00:00
Fabio Krapohl
8abc1c2668 also use pointer for descriptor in wgpu_command_encoder_begin_render_pass for consistency reasons 2019-06-04 22:13:48 +00:00
Fabio Krapohl
488367ce30 More consistent naming of pointer-size-pairs:
* always plural form without _ptr suffix for pointers
* always same name as pointer for size, but with _length suffix
* special case: single size applies to multiple pointers => only use length as name
2019-06-04 21:41:39 +00:00
bors[bot]
c204199dc2 Merge #192
192: add necessary windows lib files for vulkan, dx12, dx11 r=kvark a=Napokue

Introduce new argument BACKEND to specify the back-end framework in the hello_triangle_c CMake script. I will update the other examples, hello_remote_c & hello_compute_c (working on this one) in a future PR.

fix #188 

Co-authored-by: Timo de Kort <dekort.timo@gmail.com>
2019-05-27 14:41:11 +00:00
Timo de Kort
7bb528186f add DX11 support 2019-05-26 19:46:43 +02:00
Timo de Kort
9b0607973e resolve PR comments
- pass backends from the Makefile to the CMakeLists file
- add check to see if the BACKEND argument is set
- add dbghelp lib file
2019-05-26 18:23:19 +02:00
Timo de Kort
747defd01b add necessary windows lib files for vulkan/dx12
introduce new argument feature-native to specify the back-end framework
2019-05-25 18:42:59 +02:00
Joshua Groves
328e53852a Use required option for glfw3 2019-05-24 23:30:28 -02:30
Bruce Mitchener
b21a0c12af Remove unused variable on Metal code path. 2019-05-24 14:46:11 +07:00
Dzmitry Malyshau
a9063ce3eb Fix RenderPassColorAttachmentDescriptor 2019-05-15 22:38:59 -07:00
Dzmitry Malyshau
f024758e07 Track stencil reference 2019-05-14 11:58:10 -04:00
Dzmitry Malyshau
6a1dcb9565 API update with naming, formats, and extra fields 2019-05-14 10:31:25 -04:00
Rukai
637a0883e7 Handle resize in the triangle example 2019-05-13 20:57:49 +10:00
Dzmitry Malyshau
540451a66d Fix cbindgen macro expansion and CI 2019-05-10 21:55:09 -04:00
Dzmitry Malyshau
5eda162748 Readme update 2019-05-10 20:40:42 -04:00
Dzmitry Malyshau
6ce9cbd679 Remove Rust wrapper and examples 2019-05-10 20:40:42 -04:00
Rukai
16cc03be31 Update deps + upgrade examples to rust 2018 2019-05-07 22:38:41 +10:00
Dzmitry Malyshau
6ac666a5aa Introduce ClientFactory 2019-04-30 15:37:46 -04:00
Dzmitry Malyshau
61fca00f34 Remove wgpu-bindings in favor of configuration scripts 2019-04-30 12:45:05 -04:00
Dzmitry Malyshau
0011d9f4ff Global manager for instance names on the remote client 2019-04-30 09:19:40 -04:00
Dzmitry Malyshau
52ee3e019c Remote example and improved header, tested on CI 2019-04-29 22:41:09 -04:00
Alexis Sellier
c468840eee
Support dynamic offsets
Closes #125

* Add support for dynamic offsets when setting a bind group.
* Add new binding types: `UniformBufferDynamic` and `StorageBufferDynamic`
2019-04-26 22:20:54 +02:00
Atul Bhosale
af38d79d79
Format code using 'cargo fmt' 2019-04-26 22:01:47 +05:30
bors[bot]
993293f709 Merge #127
127: Track async mapping properly r=grovesNL,swiftcoder a=kvark

Fixes #117, fixes #95, fixes #132 

The change can be logically split into 3 parts:
  1. when `ActiveSubmission` is retired, we now move the mapped buffers into the "ready to map" vector. This was the missing bit that caused mapping to not work previously.
  2. mapping callbacks in Rust wrapper are refactored and they `unmap()` automatically now on users behalf
  3. we wait for idle before destroying the device, which allows us to process all the pending callbacks. This fix gets rid of the dummy submission our compute example used to do.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2019-04-25 13:36:59 +00:00
Dzmitry Malyshau
41141b1ae0 Wait for fences instead of device idle 2019-04-24 22:42:49 -04:00
psincf
e70b01ccc0
Fix winit event loop in the triangle example 2019-04-22 22:59:25 +02:00
Dzmitry Malyshau
1f4d67aeb2 Track async mapping properly 2019-04-22 13:57:35 -04:00
Dzmitry Malyshau
a3ffa7072a Fix the triangle examples 2019-03-31 20:03:24 -04:00
Dzmitry Malyshau
2ca7fd5077 Fix winit swapchain sizes in examples 2019-03-24 23:50:26 -04:00
bors[bot]
cf521d6074 Merge #96
96: Add the static lifetime bound to async buffer mapping callbacks r=kvark a=aloucks

These callbacks are executed outside of the mapping function and could previously reference data that had been dropped. Related #95.

Co-authored-by: Aaron Loucks <aloucks@cofront.net>
2019-03-23 02:21:03 +00:00
Aaron Loucks
e0811db8d4 Triage buffers prior to overwriting the submission index
This allows async buffer mapping to function when a renderpass
is also submitted on the queue. The state transition and fencing
still needs work, however.
2019-03-12 22:15:37 -04:00
Aaron Loucks
86e1249949 Add the static lifetime bound to async buffer mapping callbacks
These callbacks are executed outside of the mapping function and could
previously reference data that had been dropped. This fixes the
soundness issues described in #95, but not the buggy mapping
behavior.
2019-03-11 17:11:29 -04:00
Joshua Groves
5322f3c610 Reduce left indentation for nested structs 2019-03-08 07:15:36 -07:00
Joshua Groves
b2c58c7791 Add nested designated initialization 2019-03-07 20:48:37 -07:00
Joshua Groves
580e49f2cf Start rendering C example again 2019-03-07 20:15:12 -07:00
Joshua Groves
510865dd27 Restore GLFW for macOS 2019-03-07 19:19:10 -07:00
Joshua Groves
75ac875902 Start to update C example 2019-03-07 07:43:19 -07:00
Joshua Groves
fa2c2d7457 Combine Apple with other targets 2019-03-07 07:34:27 -07:00
Tristam MacDonald
1fe59e71db run cargo fmt 2019-03-05 20:41:24 -08:00
Tristam MacDonald
6ef53d7705 Convert shadow sample to map_async 2019-03-05 19:04:21 -08:00
bors[bot]
2d166d2155 Merge #80
80: Typed mapping of buffers r=kvark a=swiftcoder

Add a sprinkling of generics to remove the need for unsafe code to typecast slices resulting from mapping buffers.

Co-authored-by: Tristam MacDonald <tristam@trist.am>
2019-02-28 15:26:21 +00:00
Tristam MacDonald
524ff72fd3 Typed mapping of buffers
Add a sprinkling of generics to remove the need for unsafe
code to typecast slices resulting from mapping buffers.
2019-02-28 06:56:47 -08:00
bors[bot]
370236330f Merge #82
82: Add updated texture formats r=kvark a=unconed

Adds the texture formats from:
https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl


Co-authored-by: Steven Wittens <steven@acko.net>
2019-02-28 14:50:35 +00:00