`Global::device_drop` was wrongly assuming `device_poll` with `Maintain::Wait` was called but this is not a documented invariant and only `wgpu` was upholding this.
* 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>
This change uses `include_wgsl!(…)` in usages where an
`include_str!("….wgsl")` was used to construct
a `ShaderModuleDescriptor`'s `source, but the `label` was set to `None`.
This should (1) showcase a nice idiomatic convenience we offer in our
examples better, (2) make code more concise, and (3) get some
automatically generated labels in diagnostics where it seems it won't
hurt.
* Change the signature of `wgpu_core::Global::queue_submit` to return
a `(SubmissionIndex, …)` in addition to its current error type.
* Change the control flow of errors in `Queue::submit` to break to the
end of a block. This is similar to what we already do in many APIs in
`wgpu_core`.
* Hoist the scope of the local `submit_index` binding so it can be used
at the point where we need to convert current error paths to also
return the submission index.
Later, we will likely want to avoid actually retrieving a new submission
index so we can minimize the critical section of code. We'll need to
figure out a strategy for returning a valid (but not necessarily unique)
index in the case of failures that prevent successful submission.
This is just an API change for all the "set_bind_group" calls. Calls
that pass a Some() argument should have unchanged behavior. The None
cases are left as TODOs.
The test harness creates the instance and adapter that a test should use. Tests should not create these with default configurations or configs from the environment.
* Make `wgpu_test::valid` print errors it detects.
When a block passed to `wgpu_test::valid` actually raises validation
errors, include the full error in the panic message.
---------
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
Introduce a new module, `naga:🔙:continue_forward`, containing
shared code for rendering Naga `Continue` statements as backend
`break` statements and assignments to introduced `bool` locals.
See the module's documentation for details.
- [hlsl-out] Transform degenerate single body switches into `do-while`
loops. Properly render `Continue` statements enclosed by
`Switch` statements enclosed by `Loop` statements.
- [glsl-out] Transform degenerate single body switches into `do-while`
loops.
Improve `naga xtask validate spv` error message.
Fixes#4485.
Fixes#4514.
This option was only evaluated for Metal backends, and now it's required
there so the option is going away. It is still configurable for tests
via the PipelineOptions struct, deserialized from .ron files.
This also fixes some type problems with the unpack functions in
writer.rs. Metal << operator extends operand to int-sized, which then
has to be cast back down to the real size before as_type bit conversion.
The math for the snorm values is corrected, in some cases using the
metal unpack_snorm2x16_to_float function because we can't directly
cast a bit-shifted ushort value to half.
Add `wgpu_core::device::Device::last_successful_submission_index`,
which records the fence value that `Maintain::Wait` should actually
wait for. See comments for details.
Fixes#5969.
Ensure that samplers using non-`Nearest` mipmap filtering are
considered "filtering samplers" when deciding bind group layout
compatibility.
Add tests for layout `NonFiltering` validation.
Fixes#5948.
* Expose gpu allocation configuration options
This commit adds hints to control memory allocations strategies to the configuration options. These hints allow for automatic profiles such as optimizing for performance (the default, makes sense for a game), optimizing for memory usage (typically more useful for a web browser or UI library) and specifying settings manually.
The details of gpu allocation are still in flux. The goal is to switch vulkan and metal to gpu_allocator which is currently used with d3d12. gpu_allocator will also likely receive more configuration options, in particular the ability to start with smaller memory block sizes and progressively grow the block size. So the manual settings already provision for this upcoming option. Another approach could be to wait and add the manual option after the dust settles.
The reason for providing presets and defining values in the backends is that I am convinced that optimal fonigurations should take hardware capabilities into consideration. It's a deep rabbithole, though, so that will be an exercise for later.
* changelog
* Update CHANGELOG.md
Co-authored-by: Andreas Reich <r_andreas2@web.de>
* Add a comment about not entirely knowing what we are doing
---------
Co-authored-by: Andreas Reich <r_andreas2@web.de>