Commit Graph

6857 Commits

Author SHA1 Message Date
dependabot[bot]
3a2413a8bb
Bump num-traits from 0.2.16 to 0.2.17 (#4218)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 10:05:36 -04:00
Jim Blandy
fe484b3a1b Require that Function and Private variables be CONSTRUCTIBLE.
Change the validator to enforce WGSL's requirement that all variables
in the `function` and `private` address spaces must have constructible
types.

Mark the `RayQuery` type as `CONSTRUCTIBLE`, since it is intended to
be used for local variables.

Add a regression test.
2023-10-09 12:27:05 +02:00
Jim Blandy
fa0fed100e compact: Don't assume Emitted expressions are live.
If an `Emit` statement covers an `Expression` that is not otherwise
used by any `Statement`, remove it from the `Arena` anyway. An `Emit`
statement controls when `Expression`s are evaluated, but it doesn't
have any side effects, so unless an expression is used by some other
statement, it's not necessary to the program.
2023-10-09 12:21:43 +02:00
Jim Blandy
e820c33abf compact: Minor cleanups.
- Simplify visibility markings.

- Remove some testing comments. (Tests carried out.)

- Remove some commented-out code.
2023-10-09 12:21:43 +02: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
Brad Werth
e6097ce3d4
Make buffer_map and buffer_unmap check for device validity, add tests. (#4212)
* Make buffer_unmap check for device validity, add tests.

This patch makes buffer_unmap check for a valid device, and corrects
buffer_map to return the appropriate error for an invalid device.
Tests are added for both operations.

It also adds device validity checks to device_maintain_ids and to the
functions that get and set buffer sub data.

* Update changelog and test comment.

* Run rustfmt.

* Update test device_lose_then_more to specify more buffer usages to keep Vulkan happy.
2023-10-07 16:28:07 +02:00
Jim Blandy
c6716033da Improve docs for FunctionInfo::process_expression. 2023-10-06 18:43:22 +02:00
Jim Blandy
31f547580c Remove expression argument to FunctionInfo::process_expression.
We're already passing the handle and the arena, so it's superfluous.
2023-10-06 18:43:22 +02:00
Teodor Tanasoaia
4d6e0005f4
[valid] Disallow NaNs and infinities (#2508)
* [valid] disallow NaNs and infinities

* document literal float constraints
2023-10-05 12:50:36 -07:00
daxpedda
c85cbea39e
Bump khronos-egl to v6 (#3807) 2023-10-05 14:01:32 -04:00
Teodor Tanasoaia
f37db5affc
[wgsl] remove outerProduct (#2535) 2023-10-05 19:14:52 +02:00
dependabot[bot]
1495e159fa
Bump log from 0.4.17 to 0.4.20 (#4210)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-05 00:31:22 -04:00
Nicolas Silva
198e1dfadc
Validate that resources belong to the right device. (#4207) 2023-10-04 14:39:03 -04:00
Teodor Tanasoaia
7d1005faad
[WebGPU] validate polygon mode (#4196) 2023-10-04 12:27:27 +00:00
Nicolas Silva
32b761a591
Implement a missing part of bind group layout deduplication (#4200)
* Don't create a raw bind group layout for duplicates.

* Fully support bind group layout deduplication in Pipeline::get_bind_group_layout

---------

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-04 11:12:19 +02:00
Leo Kettmeir
d0a7f46e3a
update deno and spec (#4143)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-04 04:25:56 +00:00
Connor Fitzgerald
d2f8bd0eed
Update Readme (#4206)
* Update MSRV language

* Some more basic readme updates
2023-10-04 02:12:52 +00: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
Connor Fitzgerald
90a8feab77
Add v0.17.* changelog (#4203) 2023-10-03 23:49:05 +00:00
Teodor Tanasoaia
e63b0f6f17
[vulkan] set spir-v capabilities based on downlevel flags (#4197) 2023-10-03 16:34:36 -04:00
Elabajaba
61300afd22
update gpu-allocator to 0.23 (#4198) 2023-10-03 16:32:13 -04:00
Alix Bott
a4d733b2e6
Fix x11 hang when resizing on vulkan (#4184)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-10-03 20:24:54 +00:00
dependabot[bot]
e677b1ea43
Bump async-executor from 1.5.3 to 1.5.4 (#4186)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 20:19:37 +00:00
Teodor Tanasoaia
fd02a12726
Make GLES optional on Windows & macOS (#4185) 2023-10-03 16:16:24 -04:00
Teodor Tanasoaia
422c636877
Add Rgb10a2Uint format (#4199) 2023-10-03 14:56:21 +02:00
dependabot[bot]
1cf3bdf0bd
Bump libloading from 0.8.0 to 0.8.1 (#4192)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.8.0 to 0.8.1.
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.0...0.8.1)

---
updated-dependencies:
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 14:14:34 +02:00
Teodor Tanasoaia
6668d0694c
Add Rgb10a2Uint format (#2525) 2023-10-03 13:36:14 +02:00
Teodor Tanasoaia
613da72ac0
[spv-out] require ClipDistance & CullDistance capabilities if necessary (#2528) 2023-10-03 13:34:56 +02:00
Jinlei Li
6df7e2d7e5
Revert "Ignore the exception values generated by the winit resize event" (#4195) 2023-10-02 14:42:06 +02:00
Nicolas Silva
9ff61fee9f
Trace logging adjustments (#4188) 2023-10-02 09:05:56 +02:00
Evan Mark Hopkins
9f3cdb61aa
[msl-out] Make varyings' struct members unique (#2521) 2023-09-29 12:26:23 +02:00
Teodor Tanasoaia
c927d3ec82 remove duplicated code 2023-09-28 15:16:18 -07:00
teoxoy
e6a47ba262 disable uniformity analysis for the fragment stage 2023-09-28 20:33:11 +02:00
teoxoy
ee236e6c9b [valid] make sure textureSampleBias is only used in the fragment stage 2023-09-28 20:33:11 +02:00
Teodor Tanasoaia
f72489be00
validate variable initializer for address spaces (#2513) 2023-09-28 20:32:46 +02:00
Nicolas Silva
9a76c483da
Add trace level logging to most API entry points (#4183)
* Add trace level logging to most API entry points

* Add a changelog entry
2023-09-28 18:29:44 +02:00
Jim Blandy
a17a93ef8f
snapshots: convert_wgsl: Remove redundant cubeArrayShadow entry. (#2514)
The duplicate entry was introduced accidentally in #1845.
2023-09-28 09:09:57 +02:00
dependabot[bot]
caad255737
Bump winit from 0.28.6 to 0.28.7 (#4181)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-28 02:40:41 -04:00
Brad Werth
57f8757fad
Add device destroy method (#4163)
Plus tests that ensure that an invalid device behaves correctly.
Mostly a stub implementation otherwise.
2023-09-27 14:34:23 +02:00
dependabot[bot]
8d32dc2b47
Bump async-executor from 1.5.1 to 1.5.3 (#4174)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 23:45:02 -04:00
dependabot[bot]
2b1ea39028
Bump thiserror from 1.0.48 to 1.0.49 (#4178)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 23:44:52 -04:00
Evan Mark Hopkins
a898522e10
Rename identifiers containing double underscores (#2510) 2023-09-26 16:46:02 +02:00
dependabot[bot]
21e20076a0
Bump gpu-descriptor from 0.2.3 to 0.2.4 (#4173)
Bumps [gpu-descriptor](https://github.com/zakarumych/gpu-descriptor) from 0.2.3 to 0.2.4.
- [Changelog](https://github.com/zakarumych/gpu-descriptor/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zakarumych/gpu-descriptor/commits)

---
updated-dependencies:
- dependency-name: gpu-descriptor
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 09:41:31 +02:00
Jim Blandy
3666f1aef8
Add test case for #4167, marked as an expected failure. (#4168) 2023-09-25 19:55:55 -04:00
Jacob Hughes
27f2ce397a Re-export Naga (#4172) 2023-09-25 13:23:03 -07:00
Jim Blandy
3bcb114adb snapshots: Change messages for generating output.
Change printlns in the backend functions to say "generating" instead
of "writing" before calling the Naga backends. "Writing" suggests
writing output to a file; "generating" seems more accurate for calling
a backend.
2023-09-25 07:59:41 -07:00
Jim Blandy
5af7ebc955 snapshots: Consolidate path handling.
Add a new type, `Input`, representing a particular Naga input file,
with methods to generate related paths - output files with a
particular extension, parameter files, and the input file itself.
Use this throughout `snapshots.rs` to generate paths.

Give `Input` utility methods for reading and writing files.
2023-09-25 07:59:41 -07:00
Jim Blandy
4329a6a51b snapshots: Name convert_glsl_variations_check output consistently.
Rather than adding a `-glsl` suffix to the name, just rely on
`check_targets`' standard naming behavior, treating
`tests/in/variations.glsl` like any other snapshot input.
2023-09-25 07:59:41 -07:00
Jim Blandy
0c69735f59 Change naga:🔙:spv::DebugInfo::file_name to a &Path.
This makes it a bit easier to use in the CLI and snapshot tests.
2023-09-25 07:59:41 -07:00
Jim Blandy
7060246357 Give convert_glsl_folder's output more consistent names.
Don't replace dots with dashes in the output filenames for no reason.
Instead, give them names consistent with those generated by
`write_output_glsl`.
2023-09-25 07:59:41 -07:00