* 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>
Some module doc comments were using `/*! ... */` syntax and had
leading ` *` prefixes on each line. This interferes with the
tracking of `clippy::doc_lazy_continuation`, so switch those over
to `//!` style comment blocks.
This leaves `/*! ... */` blocks alone which didn't prefix each
line.
* rename `command_encoder_run_*_pass` to `*_pass_end` and make it a method of compute/render pass instead of encoder
* executing a compute pass consumes it now such that it can't be executed again
* use handle_error instead of handle_error_nolabel for wgpu compute pass
* use handle_error instead of handle_error_nolabel for render_pass_end
* changelog addition
* feat: `compute_pass_set_push_constant`: move panics to error variants
Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>
---------
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
* move out compute command to separate module
* introduce ArcComputeCommand
* stateless tracker now returns reference to arc upon insertion
* add insert_merge_single to buffer tracker
* compute pass execution now works internally with an ArcComputeCommand
* compute pass execution now translates Command to ArcCommand ahead of time
* don't clone commands in compute pass execution
* remove doc hiding
* use option insert
* clippy fix
* fix private doc issue
* remove unnecessary copied over doc hide
Replace the `wgpu_core:🆔:Id::transmute` method, the `transmute`
private module, and the `Transmute` sealed trait with some associated
functions with obvious names.
* 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>
* Remove generic parameter in compat::Manager.
The code is specific to bind group layout ids and the generic parameter gets in the way.
* Add a test.
The test actually covers wgpu's configuration where deduplication does not require the indirection rather than the new code. I used it to debug the new code with the configuration hard-coded. It's tedious to add a test to cover dedpuplication of bind group layouts for users of wgpu_core to provide their IDs, we can rely on the CTS which has test for that.
* Implement bind group layout deduplication for all configurations
Currently wgpu-core implement bind group layout deduplication only when it creates its own resource IDs. In other words it works for wgpu but not in Firefox.
This PR bridges the gap by allowing an optional indirection in bind group layouts: each BGL may store an ID referring to its "deduplicated" BGL.
When referring to a BGL the rest of the code must make sure to follow the indirection. The exception is command buffer processing which is considered hot code and where we first validate against the provided BGL ID and only follow the indirection if the initial check failed.
The main pain point with this approach is the various places where wgpu-core manually updates reference counts: we have to be careful about following the indirection to track the right BGL.
* Avoid making decisions based on the size of some generic type.
This change is to help with an attempt to allow the Context type in wgpu to be swappable at runtime. In order to do that, the functions provided by Context and it's associated types need to be object safe. Instead of passing a impl trait that combines both HasRawWindowHandle and HasRawDisplayHandle, we seperate the types into their RawDisplayHandle and RawWindowHandle parts internally to reduce some of the hal implementation code mess.
* Implement submission indexes
* Write some unit tests for poll
* Update wgpu/src/lib.rs
Co-authored-by: Jim Blandy <jimb@red-bean.com>
* Unify Maintain in both wgc and wgpu
Co-authored-by: Jim Blandy <jimb@red-bean.com>
The `min_index` parameter has no useful effect. Because the range 0..n is pushed
on the free list, index values less than `min_index` do get allocated.
Document `IdentityManager` and `TypedId`.
* Renamed clear_buffer to fill_buffer (keeping up with spec)
* fill_buffer does not require CLEAR_BUFFER feature
* Changed ClearBuffer to FillBuffer for `trace` feature
* Renamed clearBuffer for web backend
* enable CLEAR_COMMANDS feature for all adapters
* replaced fill_buffer with clear_buffer (minus variable value)
* Improve clear buffer/texture test
and remove unused clear-buffer.ron test
* renamed clear_image to clear_texture
* skeleton for new wgpu-hal clear_texture
* clear_texture implementation for vulkan
* clear_texture now restricts usage
* clear_texture implementation for dx12
* Implemented clear_texture for Metal backend
* Clean up GLES clear_buffer and leave note on how to implement clear_texture in the future
* fix linux compilation & formatting issues
* comment & namespace fixes
* Extent3d has now a simple mipmap calculating function
Fix incorrect use of texture.size in clear_texture for metal/dx12
Fix incorrect mip/layer ranges in clear_texture for metal/dx12