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

Ray tracing compaction #6609

Open
wants to merge 454 commits into
base: trunk
Choose a base branch
from
Open

Conversation

Vecvec
Copy link
Contributor

@Vecvec Vecvec commented Nov 25, 2024

Connections
Follow up to #6291

This is entirely able to be reviewed.

Description
Adds the function compact_blas as specified in #1040. This needed two more functions in wgpu-hal. These are based on DX12 and the function call EmitRaytracingAccelerationStructurePostbuildInfo(). On Vulkan this call is emulated with query sets. Compaction does not need any additional featues. Depending on the GPU and BLAS contents compaction may not be possible. In that case the BLAS will be duplicated (logic done by GPU driver).

This change is shown by ray_cube_compute, which now compacts the BLAS before using it. This shows the requirements of the function.

Testing
Adds two more tests, testing valid and invalid compaction operations.

Checklist

  • Run cargo fmt.
  • Run taplo format. - done by CI
  • Run cargo clippy. If applicable, add:
    • N/A --target wasm32-unknown-unknown
    • N/A --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Vecvec and others added 30 commits April 6, 2024 18:48
# Conflicts:
#	naga/src/back/spv/writer.rs
#	wgpu-core/src/hub.rs
#	wgpu-core/src/registry.rs
#	wgpu/src/backend/wgpu_core.rs
 Merge commit 'fb3b33d09233140533a9e431256a8690bf4c5d42' from wgpu/trunk into ray-tracing
…rds do not support (and it now works!) currently missing validation
…cing-updated

# Conflicts:
#	Cargo.lock
#	wgpu-core/src/command/mod.rs
#	wgpu-core/src/device/resource.rs
#	wgpu-core/src/track/mod.rs
#	wgpu-core/src/validation.rs
#	wgpu/src/backend/webgpu.rs
#	wgpu/src/context.rs
…cing-updated

# Conflicts:
#	wgpu-core/src/command/compute.rs
#	wgpu-core/src/track/mod.rs
# Conflicts:
#	.gitattributes
#	examples/src/ray_cube_compute/mod.rs
#	examples/src/ray_cube_fragment/mod.rs
#	examples/src/ray_scene/mod.rs
#	wgpu-core/src/command/compute.rs
#	wgpu-core/src/command/ray_tracing.rs
#	wgpu-core/src/device/life.rs
#	wgpu-core/src/device/queue.rs
#	wgpu-core/src/device/ray_tracing.rs
#	wgpu-core/src/device/resource.rs
#	wgpu-core/src/hub.rs
#	wgpu-core/src/track/mod.rs
#	wgpu/src/backend/webgpu.rs
#	wgpu/src/backend/wgpu_core.rs
@Vecvec Vecvec mentioned this pull request Dec 16, 2024
26 tasks
@Vecvec
Copy link
Contributor Author

Vecvec commented Jan 6, 2025

Moving into draft as https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32616 seems to be taking some time to be merged.

Edit: it has merged, now waiting on the next steps (see description)

@Vecvec Vecvec marked this pull request as draft January 6, 2025 07:30
@cwfitzgerald cwfitzgerald removed their assignment Jan 14, 2025
Vecvec and others added 7 commits January 15, 2025 08:48
# Conflicts:
#	CHANGELOG.md
#	examples/src/ray_cube_compute/mod.rs
#	tests/tests/ray_tracing/as_build.rs
#	wgpu-core/src/command/ray_tracing.rs
#	wgpu-core/src/device/life.rs
#	wgpu-core/src/device/queue.rs
#	wgpu-core/src/device/ray_tracing.rs
#	wgpu-core/src/ray_tracing.rs
#	wgpu-core/src/track/ray_tracing.rs
#	wgpu-hal/src/dx12/command.rs
#	wgpu/src/api/command_encoder.rs
…vice was being lost (turns out dx12 puts copies dst then src). :(
@Vecvec
Copy link
Contributor Author

Vecvec commented Jan 16, 2025

I've decided that instead of waiting I'll add llvmpipe to be skipped as it is at fault not this code.

@Vecvec Vecvec marked this pull request as ready for review January 16, 2025 11:46
@cwfitzgerald cwfitzgerald self-assigned this Jan 16, 2025
@JMS55
Copy link
Collaborator

JMS55 commented Jan 25, 2025

Mesa has released the patch in v24.3.4 https://docs.mesa3d.org/relnotes/24.3.4.html

@Vecvec
Copy link
Contributor Author

Vecvec commented Jan 25, 2025

That's great! I'll open an issue for CI to be updated.

# Conflicts:
#	CHANGELOG.md
#	tests/tests/ray_tracing/as_build.rs
#	wgpu-core/src/command/ray_tracing.rs
#	wgpu-core/src/device/ray_tracing.rs
#	wgpu-hal/src/dx12/command.rs
#	wgpu-hal/src/dx12/conv.rs
#	wgpu-hal/src/lib.rs
#	wgpu/src/api/command_encoder.rs
#	wgpu/src/backend/webgpu.rs
#	wgpu/src/backend/wgpu_core.rs
#	wgpu/src/dispatch.rs
# Conflicts:
#	CHANGELOG.md
#	tests/tests/ray_tracing/as_build.rs
#	wgpu-core/src/command/ray_tracing.rs
#	wgpu-core/src/device/ray_tracing.rs
#	wgpu-hal/src/dx12/command.rs
#	wgpu-hal/src/dx12/conv.rs
#	wgpu-hal/src/lib.rs
#	wgpu/src/api/command_encoder.rs
#	wgpu/src/backend/webgpu.rs
#	wgpu/src/backend/wgpu_core.rs
#	wgpu/src/dispatch.rs
…-tracing-compaction

# Conflicts:
#	wgpu-core/src/device/ray_tracing.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

5 participants