Commit Graph

8 Commits

Author SHA1 Message Date
Vecvec
79a6f2cd31
Ray Queries (#6291)
* fix more compile errors

* fix err

* fix all compile errors

* fix clippy errors

* fix issues in ray-traced-triangle example

* fix clippy warnings

* fix wasm not compiling

* fix test

* fix clippy (again)

* fix some rustfmt issues

* fix more rustfmt issues

* fix even more rustfmt issues

* fix yet more rustfmt issues

* add #[allow(dead_code)] to some structs to fix clippy on web assembly

* more format fixes

* even more format fixes

* close to final format fixes

* final format fixes (hopefully)

* actual final format fixes (hopefully)

* move ray_cube_cube example and fix bugs

* move other examples

* fix crash when dropping

* fix test

* apply clippy and rustfmt changes

* fix some memory leaks

* fix incompatibility with new wgpu trunk changes

* fix clippy & fmt

* fix clippy errors on github

* update to trunk

* remove a line that printed log "Created blas ..." in device create tlas

* fix merge issues

* fix merge

* fix fmt

* restored example ray scene functionality

* WIP fix rebase

* Fix compile issues

* More fixes

* Fix rebase

* Add wgls backend write_value_type AccelerationStructure

* Add back xtask Cargo.lock

* Revert serde path

* Doc typos

* Add -diff

* Revert more serde

* Revert serde again?

* Fix doc typo

* add test

* clippy & fmt

* fix error "blas does not exist"

* fix various things

* fix unused acceleration structures causing invalid SPIR-V

* fix merge

* fix use after free in a different way (now moved tlas instances to wgpu_core)

* refactor & fmt

* remove accidentally created file

* remove accidentally created file (actually)

* merge & fix

* Fix problems

* fix validation error

* fix validation

* fix merge

* fmt

* fix merge

* use staging buffer trackers in creating the ray-tracing staging buffers (not the tlas_s)

* change one missed staging buffer's tracker

* wip: example

* finished shadow!

* fix merge

* clippy

* remove some uses of blas ids

* fmt

* fix merge

* deduplicate code shared between command_encoder_build_acceleration_structures and command_encoder_build_acceleration_structures_unsafe_tlas

* clippy

* fix merge

* fix warnings

* clippy & fmt

* re-add matching to get_raw_tlas_instance_size and tlas_instance_into_bytes

* fmt

* fix command

* wip: fix merge

* fix merge

* fmt & docs

* fix wasm clippy

* fix issues with tests

* fix issues with tests

* fmt & clippy (wasm)

* wip ray-traced-triangle (non hal)

* unify camera location in ray_shadows

* fix tests

* add readme to ray_traced_triangle

* note that vertex format must be f32x3 (not yet validated)

* changelog

* require VertexFormat::Float32x3

* fix compile error

* when creating and building acceleration structures require Features::RAY_TRACING_ACCELERATION_STRUCTURE is enabled

* remove duplicate workaround

* fix most feedback

* remove all changes from .gitattributes

* fix compile error in test

* more changes along same lines

* format

* apply feedback to more places

* fix `cargo clippy` not just `cargo clippy --all-features`

* cache max instances from tlas creation

* fix clippy

* fix examples

* fix tests

* remove now useless docs

* add more docs

* yet more docs

* still more docs

* Documentation.

* Running out of unique commit messages to say writing docs.

* Add more references to docs.

* Get BindGroup in scope

* Remove unintentional changes

* Remove #[allow(dead_code)]

* Remove old comments

* Add device.poll

* make ray_scene start right way up

* fmt

* move scratch buffer to its own module

* actually remove intentional changes (turns out wgt is inconsistent)

* use better names in ray_scene/shader.wgsl

* fmt

* remove more unintentional changes.

* work on ray_tracing use after free

* spelling

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* grammar

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>

* move things into struct (should be all vectors with 3 item types or more)

* remove long-standing locks.

* fmt

* move not using index buffer to test

* impl index & index mut for tlas package

* impl index & index mut for tlas package

* fix errors

* fix test errors

* move everything out of ray_tracing.rs

* more index_mut

* fmt

* fix docs links

* move to separate impl block

* fix older request review

* fmt

* remove missed deref

* fix wasm clippy

* change to suggestions

* fmt

* add a note as to why `command_encoder_build_acceleration_structures_unsafe_tlas` and `command_encoder_build_acceleration_structures` are currently separate

* add a todo to reconsider soon `command_encoder_build_acceleration_structures_unsafe_tlas`

* switch to mat4 in ray-tracing examples

* Combine RT Tests Under Single Submodule

* Add More Raytracing Tests and Re-Organize

* Documentation and Formatting Fixes

* Remove Forced Alignment in wgpu-hal

* work on out_of_order_as_build and add out_of_order_as_build_use

* fmt

* update test label naming

* fix one validation error

* fix clippy & fmt

* add acceleration structure creation tests

* make mis-matched index test use the correct function

* move validation into validate_command_buffer

* fix tests

* add blas and tlas to pending writes to remove (now unneeded) `device.poll()`s

* remove commented out code from examples and properly use the constants in ray_shadow

* add examples to examples\README.md

* rename ray tracing to ray queries in readme

* remove unneeded usage from scratch buffer creation

* use snatchables for raw acceleration structures

* format

* add EXPERIMENTAL_ to features

* fix missed comment

---------

Co-authored-by: Daniel Keitel <daniel.mg.keitel@fau.de>
Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
Co-authored-by: atlas dostal <rodol@rivalrebels.com>
Co-authored-by: vero <email@atlasdostal.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-11-09 17:59:48 +00:00
Andreas Reich
7b89b6d959
Fix web example build (#5832)
* Ensure webgl example build only contains webgl and webgpu example build only contains webgpu
* fix ip printed on run-wasm
* Update examples on running examples on the web
2024-06-20 15:52:49 +02:00
matt rice
b731495e05
Fix output args for render_to_texture example (#5338)
* Fix output args for render_to_texture example

* Fix output args for storage_texture example

* Fix dashes to underscore in example names.

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-03-09 10:04:38 +00:00
Leon
1823f8bbdf
Fixes and changes to the documentation for increasing clarity (#4806)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2023-12-01 14:02:00 -05:00
Gerard Fabregó
12ee31d6f9
Update examples readme files (#4774)
* Fix indentation in main examples readme file

* Update examples readme files

* Update hello_compute example readme and fix example not running with new command

* Fix srgb_blend example not working correctly and set readme accordingly
2023-11-25 22:59:40 +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
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