Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade ray-tracing branch to main branch #2

Merged
merged 2,783 commits into from
Jan 17, 2024

Conversation

Vecvec
Copy link

@Vecvec Vecvec commented Dec 13, 2023

Connections
upgrades this branch to wgpu trunk, also fixes the tlas memory leak for me

Description
This branch is missing a lot of commits, this PR adds those, and also brings the tlas and blas structs up to work with those changes.

Testing
Tested with the three examples added by this change, as well as a basic program that (in a loop) creates blas and tlas, and immediately frees them.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown (done by github actions)
    • --target wasm32-unknown-emscripten (done by github actions)
  • Run cargo xtask test to run tests. (done by github actions)
  • Add change to CHANGELOG.md. I do not think this is applicable as this is part of the ray-tracing PR ([wgpu-core] Inline RayQuery Support gfx-rs/wgpu#3631).

Now ready for review

torokati44 and others added 30 commits November 26, 2023 17:54
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.65 to 0.3.66.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: js-sys
  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>
…#4798)

Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.3 to 4.5.0.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](JamesIves/github-pages-deploy-action@v4.4.3...v4.5.0)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.65 to 0.3.66.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: web-sys
  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>
Introduce new variants of `naga::ScalarKind`, `AbstractInt` and
`AbstractFloat`, for representing WGSL abstract types.
Introduce new variants of `naga::Literal`, `AbstractInt` and
`AbstractFloat`, for representing WGSL abstract values.
The large `match` statement in `Lowerer::construct` seems to flop back
and forth between two indentation levels as it's edited, making the
diffs hard to read. Rewrite it to use deferred initialization of
`expr`, so that `cargo fmt` doesn't have to decide whether or not to
put the `match` on the same line as `let expr`. This makes subsequent
diffs easier to read.
Delete the `first_component_ty_inner` field from
`front::wgsl::lower::construction::Components::Many`. With the
introduction of abstract types, it will no longer be possible to infer
the type of the vector being constructed by looking at the type of its
first constructor argument alone: automatic conversion rules might
need to be applied to that argument.
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
When a constructor builtin has an explicit type parameter, like
`mat2x2<f32>`, it should not produce an abstract matrix, even if its
arguments are abstract.
Bumps [wasm-bindgen-futures](https://github.com/rustwasm/wasm-bindgen) from 0.4.38 to 0.4.39.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: wasm-bindgen-futures
  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>
…d size ... is outside of the supported range` warning) (gfx-rs#4796)

* Remove surface extent validation

* silence pnext vulkan validation warning which can happen on surface resize

* remove old VUID-VkSwapchainCreateInfoKHR-imageExtent-01689 validation warning ignore

* Validate surface against max texture size
@daniel-keitel
Copy link
Owner

@Vecvec the main change I am contemplating, is to somehow make the information stored in the creation info part of the wgpu-core library and reference count all required resources.

The problem at the moment is, that a reference to Blas is required to build/update the blas, so lifetimes get in the way sometimes.
Another problem is that acceleration structures don't keep there resources alive. (You get an error if you drop a vertex buffer used in a ac, when it is used).
I think it would be better (and more performant to validate), if it worked like Texture and TextureView, where the view keeps the texture alive if the Texture is dropped.

cwfitzgerald and others added 19 commits January 10, 2024 17:56
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Remove the Destroyed state from Storage

It used to be how we handled destroying buffers and textures but we moved to different approach.

* Explicit check for destroyed textures/buffers in a few entry points

This used to be checked automatically when getting the resource from the registry, but has to be done manually now that we track we track the destroyed state in the resources.
* Prevent a few integer overflows

* Add a changelog entry

* use u64
* Convert Tests to Use Async Poll

* Update examples/src/repeated_compute/mod.rs

Co-authored-by: Andreas Reich <r_andreas2@web.de>

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
…gfx-rs#5032)

This clarifies that the Rust and C-style callbacks/closures need to be
consumed (not called) before they are dropped. It also makes the from_c
function consume the param closure so that it can be dropped without
panicking.

It also relaxes the restriction that the callback/closure can only be
called once.
…-rs#5044)

* Rename backends: web -> webgpu, direct -> wgpu_core

* rename context objects for web & core

* allow webgpu & webgl features side-by-side

* make sure webgl ci doesn't use webgpu

* update any_backend_feature_enabled

* add panicing generate_report method for compatibility

* RequestDeviceErrorKind::Web rename, fixup various cfg attributes

* automatic webgpu support detection

* changelog entry

* fix emscripten

* fix weird cfg, fix comment typo

* remove try_generate_report again

* Make get_mapped_range_as_array_buffer WebGPU only again
# Conflicts:
#	wgpu-core/src/device/life.rs
#	wgpu/src/backend/wgpu_core.rs

load_model(&mut scene, "/examples/ray-scene/cube.obj");
load_model(&mut scene, "/ray_scene/cube.obj");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
load_model(&mut scene, "/ray_scene/cube.obj");
load_model(&mut scene, "/skybox/models/teslacyberv3.0.obj");

@@ -482,10 +475,14 @@ impl wgpu_example::framework::Example for Example {
for y in 0..side_count {
let instance = self
.tlas_package
.get_mut_single((x + y * side_count) as usize)
.get_mut_single((x + y) * side_count)
.unwrap();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change the example should behave like before

Suggested change
.unwrap();
.get_mut_single(x + y * side_count)

@daniel-keitel daniel-keitel merged commit f39a44c into daniel-keitel:ray-tracing Jan 17, 2024
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.